How to set up a virtual host in Apache?
Submitted by: Administratorapache provide two type of virtual hosting 1- ip based and
2- name based.
to configure name based your dns should work properly.
go to the /etc/httpd/conf/httpd.conf file and remove # from
the start of of Namevertualhost *:80
and than at the end of file write the content below
<VirtualHost "IP of your apache server":80>
ServerAdmin root@krishna.com
DocumentRoot /var/www/krishna/krishna.html
DirectoryIndex krishna.html
ServerName www.krishna.com
ErrorLog /home/apache/logs/error/hostedsites/error_log
TransferLog /home/apache/logs/access/hostedsites/access_log
</VirtualHost>
restart your httpd service by running the command
Service httpd restart or /etc/init.d/httpd restart
Submitted by: Administrator
2- name based.
to configure name based your dns should work properly.
go to the /etc/httpd/conf/httpd.conf file and remove # from
the start of of Namevertualhost *:80
and than at the end of file write the content below
<VirtualHost "IP of your apache server":80>
ServerAdmin root@krishna.com
DocumentRoot /var/www/krishna/krishna.html
DirectoryIndex krishna.html
ServerName www.krishna.com
ErrorLog /home/apache/logs/error/hostedsites/error_log
TransferLog /home/apache/logs/access/hostedsites/access_log
</VirtualHost>
restart your httpd service by running the command
Service httpd restart or /etc/init.d/httpd restart
Submitted by: Administrator
Read Online Apache Job Interview Questions And Answers
Top Apache Questions
☺ | What is Apache? |
☺ | Does Apache act as a Proxy server? |
☺ | What is htpasswd? |
☺ | What is multiviews? |
☺ | How to check for the httpd.conf consistency and any |
Top Best Web Servers / Services Categories
☺ | IIS Interview Questions. |
☺ | Web Services Interview Questions. |
☺ | Web Hosting Interview Questions. |
☺ | Tomcat Server Interview Questions. |
☺ | Web Browser Interview Questions. |