Configuration of apache Web Server on Linux server.

# Configuration of Web Server.
------------------------------
# Port Number:80
----------------
# Required RPMS:
----------------
httpd-2.2.3-6.el5
httpd-manual-2.2.3-6.el5
system-config-httpd-1.3.3.1-1.el5

# Configuration Files:
----------------------
/etc/httpd/conf/httpd.conf

# Required Services and Daemons:
--------------------------------
httpd

# Configuration Steps:
----------------------
# IP BASE WEB SERVER:
---------------------
vi /etc/httpd/conf/httpd.conf
133 # listen 12.34.56.78:80
134 listen 192.168.150.51:80
250 ServerAdmin root@server.praveshsailor.com
264 ServerName server.praveshsailor.com:80
280 DocumentRoot "/var/www/html"
390 DirecctoryIndex index.html index.html.var
:wq

# Check the network settings as per server and restart the services.
chkconfig httpd on
service httpd restart

# Verify the server on Internet browser/Command prompt browser.
elinks
Enter URL
192.168.150.51

# NAME BASE WEB SERVER:
-----------------------
# For Name base server, create your own Virtual Host.
vi /etc/httpd/conf/httpd.conf
326 # Auth AllowOverride -Disable/Comment this line.
971 NameVirtualHost 192.168.150.51:80
984 <Virtual Host 192.168.150.51:80>
985 ServerAdmin root@server.praveshsailor.com
986 DocumentRoot /var/www/html
987 ServerName server.praveshsailor.com
988 DirectoryIndex index.html
989     ErrorLog logs/server.praveshsailor.com-error_log
990     CustomLog logs/server.praveshsailor.com-access_log common
991 </virtualHost>

0992<VirtualHost 192.168.150.51:80>
0993    ServerAdmin root@server.praveshsailor.com
0994    DocumentRoot /var/www/praveshsailor/
0995    ServerName www.praveshsailor.com
0996    ErrorLog logs/www.praveshsailor.com-error_log
0997    CustomLog logs/www.praveshsailor.com-access_log common
0998    <Directory /var/www/praveshsailor>
0999 Options Indexes Includes
1000 AuthType Basic
1001 AuthName "Password Prtected Test"
1002 AuthUserFile /etc/httpd/webpass
1003 Require user webuser
1004    </Directory>
1005</virtualHost>
:wq

# To set the authentication to your web, Configure the webuser and password
htpasswd -c /etc/httpd/webpass webuser

# mkdir /var/www/praveshsailor

# Copy some *.html pages from your system to /var/www/praveshsailor/
e.g. private.html, options.html

# Goto following file and make the changes as shown.
vi /etc/hosts
# At the E.O.F. Just add this line.
192.168.150.51 www.praveshsailor.com
:wq

# Check the network settings as per server and restart the services.
chkconfig httpd on
service httpd restart

# Verify the website on Internet browser/Command prompt browser.
elinks
Enter URL
server.praveshsailor.com
www.praveshsailor.com

# Client Side:
# Goto following file and make the changes as shown.
vi /etc/hosts
# At the E.O.F. Just add this line.
192.168.150.51 www.praveshsailor.com
:wq

# Verify the website on Internet browser/Command prompt browser.
elinks
Enter URL
192.168.150.51
server.praveshsailor.com
wwww.praveshsailor.com

# To open another web page in explorer, search the web pages i.e. *.html. Then  choose one of the web pages and copy it in /var/www/html/ folder.
vi /etc/httpd/conf.d/welcome.conf
# Comment all the lines in this file if you want to open ur own web page
:wq

# If you want to open the web page in Microsoft Systems, then add the host
entry in Microsoft o.s. as;
# Goto c:\WINDOWS\system32\drivers\etc\hosts and add the entry like;
192.168.150.51 server.praveshsailor.com
192.168.150.51 www.praveshsailor.com

# To clear the dns cache use command on cmd prompt,
arp -d
# After doing this your web page will not be displayed.

Comments

Popular Posts

Install and configure rsyslog Centralized logging server in CentOS

Connecting to Your Linux Instance from Windows Using PuTTY

How to fix postfix/smtp Network is unreachable error