PACKAGES NEEDED FOR CONFIGURATION
httpd
IF THE PACKAGES ARE NOT AVAILABLE INSTALL THROUGH YUM INSTALLER
yum install httpd
THE MAIN CONFIGURATION CAN BE EDITED AS FOLLOWS
vim /etc/httpd/conf/httpd.conf
shift+g==>
<VirtualHost 192.168.0.X:80>
DocumentRoot /var/www/html
ServerName stationX.example.com
</VirtualHost>
CREATING THE WEBPAGE
cd /var/www/html
echo " This is test page for web server" > index.html
DAEMON SERVICES SHOULD BE STARTED AND ENABLED AFTER REBOOT
service httpd start/restart/reload
chkconfig httpd on
NOTE: Before proceed to verification, confirm that your ip addr is resolved to Domain name or vice
versa.
VERIFICATION OF WEB SERVER
links
Enter the URL name as
stationX.example.com ========>to view webpage.
SECURING ACCESS TO YOUR WEBSITE
mkdir /var/www/virtual
vi /etc/httpd/conf/httpd.conf
shift+g==> NameVirtualHost 192.168.0.X:80
<VirtualHost 192.168.0.X:80>
DocumentRoot /var/www/virtual
ServerName wwwX.example.com
</VirtualHost>
<Directory /var/www/virtual>
AllowOverride AuthConfig
</Directory>
CREATING THE WEBPAGE
cd /var/www/virtual
echo " This is test page for virtual web server" > index.html
CREATING THE SECURITY
cd /var/www/virtual
vim .htaccess
AuthName "virtual webpage"
AuthType Basic
AuthUserFile /var/www/virtual/pass
require valid-user
CREATING HTPASSWORD TO THE USER
htpasswd -c /var/www/virtual/pass <username>
chmod 640 pass
DAEMON SERVICE RELOADED
service httpd reload
VERIFICATION OF WEB SERVER
links
Enter the URL name as
wwwX.example.com ========>to view webpage.
This is going to ask for username and password, If you are provide the username and password then the website will be displayed
No comments:
Post a Comment