APACHE (WEB SERVER)
-------------------
Package Required :httpd*
Script :/etc/init.d/httpd
Daemon :httpd
Port :80
Configurationfile :/etc/httpd/conf/httpd.conf
Sys V Service
Related Things : web based authentication
---------------------------------------------
yum install httpd* -y
service httpd restart (/etc/init.d/httpd)
chkconfig --list | grep -i httpd
chkconfig httpd on
vim /etc/httpd/conf/httpd.conf
copy last 7line and pest it at last
uncomment 7line and make changes to the file as need
<VirtualHost 192.168.0.73:80>
ServerAdmin root@server73.example.com
DocumentRoot /var/www/html
ServerName server73.example.com
ErrorLog logs/server73.example.com-error_log
CustomLog logs/server73.example.com-access_log common
</VirtualHost>
:wq!
service httpd restart
elinks --dump server73.example.com
-----------------------------------------------------------------------
name based virtual
-----------------
mkdir /var/www/virtual
mkdir /var/www/virtual/
vim /var/www/virtual/index.html
this is name based virtual hosting
:wq!
vim /etc/httpd/conf/httpd.conf
copy 7line pest it at last line
<VirtualHost 192.168.0.73:80>
ServerAdmin root@server73.example.com
DocumentRoot /var/www/virtual/
ServerName www73.example.com
</VirtualHost>
uncomment the line and give your ipaddress (or you can keep *:80)
NameVirtualHost 192.168.0.73:80
:wq!
sevice httpd restart
elinks --dump www73.example.com
---------------------------------------------------------------
User based hosting
------------------
useradd student
su - student
mkdir public_html
vim public_html/index.html
THIS IS STUDENT WEB PAGE
:wq!
chmod 711 /home/sudent
restorecon -R /home/student/public_html/
setsebool -P httpd_enable_homedirs=1
vim /etc/httpd/conf/httpd.conf
Comment this line
#UserDir disabled (line no : 366)
Uncommet this line
UserDir Public_html (line no: 373)
service httpd restart
Wednesday, November 16, 2011
Apache (Web Server)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment