0% found this document useful (0 votes)
33 views2 pages

Apache Server

The document configures an Apache web server on a Red Hat system. It creates a virtual host for the domain linux.com pointing to the /var/www/html/virtual directory. Basic authentication is enabled for this directory by adding an .htaccess file requiring a username and password. The httpd service is restarted to apply the changes.

Uploaded by

kallolmaity
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

Apache Server

The document configures an Apache web server on a Red Hat system. It creates a virtual host for the domain linux.com pointing to the /var/www/html/virtual directory. Basic authentication is enabled for this directory by adding an .htaccess file requiring a username and password. The httpd service is restarted to apply the changes.

Uploaded by

kallolmaity
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Apache Server

RH253

Unit 6

[root@home ~]# rpm -qa | grep httpd system-config-httpd-1.3.3.1-1.el5 httpd-2.2.3-11.el5 httpd-manual-2.2.3-11.el5 [root@home ~]# chkconfig --list | grep httpd httpd 0:off 1:off 2:off [root@home ~]# chkconfig --level 345 httpd on [root@home ~]# chkconfig --list | grep httpd httpd 0:off 1:off 2:off [root@home ~]# cd /var/www/html/ [root@home html]# cat file.html <html> <head> <title> My web Page </title> </head> <body bgcolor=gray> <h1> This is an sample page created in httpd web page </body> </html> [root@home ~]# vi /etc/httpd/conf/httpd.conf NameVirtualHost 192.168.0.1:80 <VirtualHost 192.168.0.1:80> ServerName linux.com ServerAdmin root@home.linux.com DocumentRoot /var/www/html DirectoryIndex file.html ErrorLog logs/dummy-host.example.com-error_log CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> [root@home ~]# httpd -t Syntax OK [root@home ~]# service httpd restart Stopping httpd: Starting httpd: [FAILED] [ OK ] 3:on 4:on 5:on 6:off 3:off 4:off 5:off 6:off

To Make Security
[root@home ~]# vi /etc/httpd/conf/httpd.conf NameVirtualHost 192.168.0.1:80 <VirtualHost 192.168.0.1:80> ServerName linux.com ServerAdmin root@home.linux.com DocumentRoot /var/www/html/virtual DirectoryIndex file.html <Directory /var/www/html/virtual> Order deny,allow Allow from all AllowOverride AuthConfig </Directory> </VirtualHost> [root@home virtual]# httpd -t

Apache Server
Syntax OK [root@home ~]# cd /var/www/html/ [root@home html]# mkdir virtual [root@home html]# cd virtual

RH253

Unit 6

[root@home virtual]# cat file.html <html> <head> <title> My web Page </title> </head> <body bgcolor=gray> <h1> This is an sample page created in httpd web page </body> </html> [root@home virtual]# vi .htaccess AuthName "Home Sweet Home" AuthType Basic AuthUserFile /etc/httpd/conf/htpass require valid-user [root@home virtual]# htpasswd -cm /etc/httpd/conf/htpass sunny New password: Re-type new password: Adding password for user sunny [root@home virtual]# service httpd restart Stopping httpd: Starting httpd: in client click on Application-> Internet-> Firefox Web Browser in address bar type http://192.168.0.1 or linux.com Enter user name & password To open the page [ [ OK OK ] ]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy