Showing posts with label Web_Server. Show all posts
Showing posts with label Web_Server. Show all posts

Monday, 11 July 2016

How to Install & Configure Apache for both GUI & CLI mode on CentOS/RHEL 6.X

Install & Configure Apache for both GUI & CLI mode on CentOS/RHEL 6.X


What is ApacheGUI?


This tools is a free and open source package designed for system administrators to manage the functionality of Apache Web Server from a browser, such as edit configuration and web document files directly from browser, download, search or visualize Apache Logs in real time, install, edit or remove Apache modules, view runtime statistics or detailed graphs transactions of Apache HTTP Server.



Step 1: Stop the Selinux, and Update the Date Time on the Server :



# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service iptables stop
# chkconfig iptabes off
# yum -y install ntpd
# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on

Step 2: Install Java of your choise. here installed open jdk you can install oracle java also:



# yum -y install httpd httpd-develjava

Step 3: Download ApacheGUI:



# cd /opt
# wget http://jaist.dl.sourceforge.net/project/apachegui/1.11-Linux-Solaris-Mac/ApacheGUI-1.11.0.tar.gz
# tar -zxvf ApacheGUI-1.11.0.tar.gz
# cd ApacheGUI/bin

Step 4.Start the server:



# ./run.sh
# service iptables stop

If you want to Change the server port from 9999.

# vi /opt/ApacheGUI/tomcat/conf/server.xml

find 9999 and change to any port you like.

Step 5. Configure Apache GUI:



Browse : http://Server-IP/Domain:9999/ApacheGUI/



Use following credentials to login into ApacheGUI tool If Asked

Username: admin
Password: admin

Step 6. Configure Apache GUI from Web Panel :


Next, the tool will prompt you on How Apache Web Server was installed?
Choose Package option, if you installed Apache on RHEL/CentOS using yum package management tool and hit OK to move forward.

Server Root: /etc/httpd
Primary Configuration File: /etc/httpd/conf/httpd.conf
Configuration Directory: /etc/httpd
Log Directory: /logs
Modules Directory: /etc/httpd/modules
Binary File: /usr/sbin/apachectl
Username: root
Password: redhat
Password: redhat

** After you finish hit on Submit button to apply configuration and you’re done.
** Now you can control Apache Web Server with all its configuration files and edit web documents directly from your browser

Step 7. Create init script for Apache GUI :



# vi /etc/init.d/apache-gui

#!/bin/sh
#
#
# System startup script for apache-gui
#
### BEGIN INIT INFO
# Provides: apache-gui
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the apache-gui
# Description:       Start the apache-gui
### END INIT INFO
#
# chkconfig: 2345 20 80
# description: Runs the apache-gui
# processname: apache-gui
#
# Source function library
. /etc/init.d/functions

case "$1" in
    start)
    cd /opt/ApacheGUI/bin/
./run.sh
       ;;
    stop)
   cd /opt/ApacheGUI/bin/
./stop.sh
        ;;
restart)
cd /opt/ApacheGUI/bin/
./stop.sh
./run.sh
    *)
        echo $"Usage: $0 {start|stop}"
        exit 2
esac
exit $?

--- save & quit (:wq) ---

# chmod 755 /etc/init.d/apache-gui

** Start apchegui as the service now.

# service apache-gui start
# service apache-gui stop
# chkconfig apache-gui on

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Thursday, 3 December 2015

How to Install Lamp on Centos 7


Install Lamp on Centos 7
1. Install Apache:

# yum -y install httpd httpd-devel

2. Edit httpd.conf file:

# vi /etc/httpd/conf/httpd.conf

add this last line-
RewriteEngine on
CheckCaseOnly On

----Save & Quit (:wq)----

3. make logs directory:

# mkdir /logs

4. Go to /var/www/html :


# vi index.html

Make A HTML
add those line...

<html>
<marquee direction="left">
<font size="12" color="red">
!!!....Restricted zone....!!!
</font>
</marquee>
</html>

----Save & Quit (:wq)----

5. Install MySQL Database Server:

# yum install wget
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
# yum install -y mysql-server mysql mysql-devel

6. Start Mysqld Service:

# systemctl restart mysqld

7. Changing MySQL Root Password:


# mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit

8. Check by logging in:


# mysql -u root -p
Enter Password: <your new password>


mysql> show databases;
+--------------------------------+
| Database               |
+---------------------------------+
| information_schema |
| mysql                         |
+---------------------------------+
2 rows in set (0.00 sec)


mysql> exit

9. Install PHP5 Scripting Language:

# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

# yum install -y  php56w php56w-cli php56w-mysql php56w-pdo php56w-pecl-memcache php56w-xml php56w-imap php56w-mbstring php56w-mcrypt php56w-common php56w-fpm       php56w-odbc php56w-devel  php56w-xmlrpc php56w-soap php56w-pecl-igbinary php56w-pdo php56w-ldap php56w-xml php56w-imap php56w-pear php56w-gd

10. Create a file named /var/www/html/info.php:


# vi /var/www/html/info.php


<?php
  phpinfo();
?>

----Save & Quit (:wq)----

11. Restart Apache to load php:

# systemctl restart httpd

12. Then point your browser to http://ip address/info.php:


Ex- http://192.168.72.249/info.php

13. Download this phpMyAdmin rpm:


# cd /var/www/html
# wget https://files.phpmyadmin.net/phpMyAdmin/4.4.10/phpMyAdmin-4.4.10-english.tar.gz

14. Extract the tar File & Rename it :


# tar -zxvf phpMyAdmin-4.4.10-english.tar.gz
# mv phpMyAdmin-4.4.10-english phpmyadmin

15. Edit the /etc/httpd/conf/httpd.conf File :


# vi /etc/httpd/conf/httpd.conf

Add those Lines : (line number 158)
<Directory /var/www/html/phpmyadmin>
    Options  -Indexes +Multiviews +FollowSymLinks
        DirectoryIndex index.php index.html
    AllowOverride All
    Allow from all
</Directory>

----Save & Quit (:wq)----

16. Rename the config.sample.inc.php File :

#cd /var/www/html/phpmyadmin

# mv config.sample.inc.php config.inc.php

17. Now needs a secret passphrase (blowfish_secret):


# vi /var/www/html/phpmyadmin/config.inc.php


$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
Just Add Password - $cfg['blowfish_secret'] = 'Your Password but wrong pass'


$cfg['blowfish_secret'] = 'wron pass'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

$cfg['Servers'][$i]['host'] = 'MySQL_Server_Name'; ← Database Server Hostname.

----Save & Quit (:wq)----

18. Start the httpd & mysql Service & stop iptables :

# systemctl enable httpd
# systemctl enable mysqld
# systemctl stop firewalld.service

and stop selinux

19. Point your browser to: http://ip.address/phpmyadmin :


ex- http://192.168.72.249/phpmyadmin
User Name: root
Password: Mysql_Password

---- DONE,Thanks ----

Tuesday, 1 December 2015

How To Install Apache Web Server on Centos/RHEL


How To Install Apache Web Server on Centos/RHEL

1. Install Apache:

# yum -y install httpd httpd-devel


2. Edit httpd.conf file:

# vi /etc/httpd/conf/httpd.conf


#ServerName www.example.com:80

Just Add this Line-
ServerName ip address of server:80

Check this Line-991
NameVirtualHost *:80

Last-add this line-
DocumentRoot "/var/www/html"

add this last line-

RewriteEngine on
CheckCaseOnly On


----Save & Quit (:wq)-----


make logs directory...

#mkdir /logs


3. Go to /var/www/html :


# vi index.html

Make A HTML
add those line...


<html>
<marquee direction="left">
<font size="12" color="red">
!!!....Restricted zone....!!!
</font>
</marquee>
</html>


----Save & Quit (:wq)----

# vi /etc/httpd/conf.d/192.168.100.251.conf

then paste those line

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin deb.mind009@gmail.com
  ServerName 192.168.100.251


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html
  DocumentRoot /var/www/html


  # Custom log file locations
  LogLevel warn
  ErrorLog  /logs/192.168.100.251-error_log
  SetEnvIf Request_URI "\.(jpg|xml|png|gif|ico|js|css|swf|js?.|css?.)$" DontLog
  CustomLog /logs/192.168.100.251-access_log combined Env=!DontLog

</VirtualHost>

----Save & Quit (:wq)----

# vi /etc/httpd/conf.d/debojyoti.com.conf (FOR VIRTUAL HOSTS)

<VirtualHost *:80>

  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin deb.mind009@gmail.com
  ServerName www.debojyoti.com
  ServerAlias debojyoti.comi


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.php index.html
  DocumentRoot /var/www/html/debojyoti.com


  # Custom log file locations
  LogLevel warn
  ErrorLog  /logs/debojyoti.com-error_log
  SetEnvIf Request_URI "\.(jpg|xml|png|gif|ico|js|css|swf|js?.|css?.)$" DontLog
  CustomLog /logs/debojyoti.com-access_log combined Env=!DontLog

</VirtualHost>

----Save & Quit (:wq)----

4. Start httpd Service:

# /etc/init.d/httpd start

------ DONE,Thanks-------

How to Install Tomcat7 on Centos/RHEL 6.X


Install Tomcat7 on Centos/RHEL
Make sure apache configuration is done.

Step 1. Install JAVA

# wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm

# yum install jdk-8u5-linux-x64.rpm

# java -version

# export JAVA_HOME=/usr/java/jdk1.8.0_05

# export PATH=$PATH:$JAVA_HOME

# echo $JAVA_HOME

# vi /etc/profile.d/java.sh

#!/bin/bash
JAVA_HOME=/usr/java/jdk1.8.0_05
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

save and exit


# chmod +x /etc/profile.d/java.sh

# source /etc/profile.d/java.sh

# java -version

Step 2: Download and Extract Tomcat Archive

# cd /tmp

# wget http://psg.mtu.edu/pub/apache/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz

# tar -zxvf apache-tomcat-7.0.57.tar.gz

# mv apache-tomcat-7.0.57 /usr/local/tomcat7

Step 3. Add the init scripts for it.

# vi /etc/init.d/tomcat

#!/bin/bash
# description: Tomcat Start Stop Restart-SOM
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.8.0_05
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/local/tomcat7

case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0

save and exit


# chmod 755 /etc/init.d/tomcat

Step 4 . Start the tomcat as a service.

# service tomcat start

# chkconfig tomcat on


Step 5. Access Tomcat in Browser

http://ipaddress:8080 OR http://hostname:8080

Step 6. Setup User Accounts. Paste inside <tomcat-users> </tomcat-users> tags.

# vi /usr/local/tomcat7/conf/tomcat-users.xml

<role rolename="manager-gui" />
<user username="manager" password="redhat" roles="manager-gui" />

<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="nasant" roles="manager-gui,admin-gui" />

save and exit.


# service tomcat restart

# service httpd restart

----- DONE,Thanks -----