Liam Delahunty: Home Tips Web Contact
Recommended laptop
under £500
.

Think I deserve a present? See my Amazon Wish List

Windows apache virtualhost

This will allow one to set up apache so that you can access a web site stored locally on a windows box in a more convienient manner: http://sitename rather than http://127.0.0.1/sitename/. It's useful to test things and looks neat!

In the httpd.conf file add a line to the bottom such as:

Include "C:/Program Files/Apache Group/Apache/conf/vhosts.conf"

Create and open that file and add lines such as

NameVirtualHost *

<VirtualHost *>
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/" ServerName 127.0.0.1
</VirtualHost>

<VirtualHost *>
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/npw/"
ServerName npw
</VirtualHost>

<VirtualHost *>
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/liamdelahunty/"
ServerName ld
</VirtualHost>

<VirtualHost *>
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/worldwideco/"
ServerName ww
</VirtualHost>

Now find the HOSTS.SAM file, which may be in C:/windows/. Save it in same directory as HOSTS without the extention. Add the corresponding lines:

127.0.0.1 localhost
127.0.0.1 ld
127.0.0.1 npw
127.0.0.1 ww

Now restart apache and you will be able to see all your local websites using http://127.0.0.1/ or visit one directly using http://ld/ etc.

Share this!  



Apache Pcfg Openfile Unable To Check Htaccess | Apache Windows Virtualhost | Browsers Sizes


 

  Tips | Home | Search | Contact

Link here: