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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating virtual host in different locations in Apache 2

Status
Not open for further replies.

Bengal313

IS-IT--Management
Jun 6, 2003
7
0
0
US
I am trying to do something in Apache 2 that IIS made it easy as point and click.

I have a xp machine that has Apache to installed. I my default webserver document root is,

C:\Program Files\xampp\htdocs

I have two websites "desktop.com" and "storix.com"

desktop.com files are stored in the default webserver location, but the storix.com is located on an external drive S:\My Webs.

How do I create virtual hosts that can have onsite located on the default location and the other on the external drive. Reason for the external drive is because I am able to work at home and work without having to sync.


I tried this but didn't work. Do I need th add/tweak something in the config file?

I am trying to use name-based with the same ip setup.






# Use name-based virtual hosting.
NameVirtualHost *:80

<VirtualHost *>

ServerName lc.desktop.com
DocumentRoot "C:/Program Files/xampp/htdocs"

CustomLog logs/lc.desktop.com.access.log combined
ErrorLog logs/lc.storix.com.error.log

</VirtualHost>


<VirtualHost *>

ServerName lc.storix.com
DocumentRoot "S:/My Webs"

CustomLog logs/lc.storix.com.access.log combined
ErrorLog logs/lc.storix.com.error.log

</VirtualHost>
 
You will probably also need a <Directory> directive for S:\My Webs because it is outside the main document root.
 
Okay, What would be the syntax and where would I insert it? Thanx. Also will this allow me to execute php scripts of that external directory?
 
Also I was reading about

Alias, AliasMatch and ScriptAliasMatch, should I use them if which one and how (Syntax)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top