Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Host for Apache 2

Status
Not open for further replies.

OOzy

Programmer
Jul 24, 2000
135
0
0
SA
Dears,

How can I setup a virtual host. I usually type 127.0.0.1 in my browser totest my site but I need to work on another site in a different directory?

I would like to type

for 127.0.0.1

I heard that I need to setup DNS or use /etc/hosts file

I am running Apache, PHP4, Mandrake 10. I am not sure which appache Iam running but when I do 'apachectl graceful' it says "Reloading httpd2"

I hope that I am not running apache2 as it is not recommended to useapache2 and php in production.Best Regards
 
I hope that I am not running apache2 as it is not recommended to useapache2 and php in production.


As for the Vhost setup, read a few posts on this forum, there are hundreds that explain this.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Dear Oozy,

if you only want to be able to access the site with that domain name from your own computer, then just add the following line to your /etc/hosts file:

127.0.0.1 #your domain

if you want other people inside your lan or on the internet to be able to access your site then you have to setup dns for the domain you registered.

These steps make sure people can find which IP resolves to your domain name.

After that your apache server needs to be told that is a valid name for itself, and which directory etc is the documentroot for that name. With virtualhosts you could point several names to one apache server and have them show different pages. (eg. virtual hosts)

there are many many many excellent tutorials on setting up virtualhosts under Apache.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top