Apache Configuation with SSI(Server Side Includes)
Step 1 : Install packages for apache
[root#] yum install httpd*
Step 2 : Verify the packages of apache
[root#] rpmquery -qa | grep httpd
o/p:
httpd-2.2.15-5.el6.i686
httpd-tools-2.2.15-5.el6.i686
httpd-devel-2.2.15-5.el6.i686
httpd-manual-2.2.15-5.el6.noarch
Step 3 : Get the hostname
[root#] hostname
o/p:
server.tyit.com
Step 4 : Get the IPAddress
[root#] ifconfig
o/p:
192.168.2.111
Step 5 : Using GUI navigate to directory "/var/www"
5.1 Create a directory "virtual" inside this -- aready created
5.2 Create a page "c.shtml" inside virtual and write following :
SSI Apache pahe
todays date
Step 6: Open the configuration file "/etc/httpd/conf/httpd.conf"
Go to end of file :
#
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#
ServerAdmin root@server.tyit.com
DocumentRoot /var/www/virtual
ServerName server.tyit.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
Go to Line 816 :
AddType text/html .shtml
Go to Line 817 :
AddOutputFilter INCLUDES .shtml
Go to Line 317 :
318 :
Order allow,deny
319 :
Allow from all
333 :
Options +Includes
** Save the file and come to terminal
Step 7 : Give full permissions to virtual directory
[root#] chmod -R 777 /var/www/virtual
Step 8: Stop the firewall
[root#] service iptables stop
Step 9: Start and restart apache service
[root#] service httpd start
[root#] service httpd restart
Step 10 : Make the service enable at boot time
[root#] chkconfig httpd on
Step 11: Turn off linx security and restart apache
[root#] setenforce 0
[root#] service httpd restart