Go Back   HTMLCenter Web Development Forums > Web Design and Development > Servers

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-28-2006, 12:04 PM
shakim's Avatar
Registered User
 
Join Date: Apr 2002
Location: Michigan, USA
Posts: 36
Creating Virtual Directory in Apache

In IIS you were able to install the web server in windows and then create virtual directories anywhere, including a external drive. This way the location on the external drive (directory ) would act as a webserver location. You were able to execute scripts. Is there a way to do that with apache 2.0?
__________________
"Knowledge Speaks but, Wisdom Listens"
www.shumonhakim.com
Reply With Quote

  #2 (permalink)  
Old 08-28-2006, 01:34 PM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
I think so, in your "httpd.conf" you can map the virtualhost to be on any drive - even an external harddrive. I'm guessing you mean windows, so yeah. The external drive should have a drive letter and I don't see why it should not work.
Reply With Quote
  #3 (permalink)  
Old 08-28-2006, 03:44 PM
shakim's Avatar
Registered User
 
Join Date: Apr 2002
Location: Michigan, USA
Posts: 36
According to this doucumentation,

http://httpd.apache.org/docs/2.0/vhosts/name-based.html

You can set up different sites under the same ip address but it looks like they all have to reside under the httdocs folder. Is it possible to have a site in the httdocs folder and another in a external drive, example S:/mywebs.

Then I could just say www.urlone.com //which should point to the folder in httdocs directory
and www.urltwo.com //which should point to the folder on my external drive.



It would be kinda nice if there was a easy to read step by step tutorial on how to set up virtual host where files are stored inside and outside of the httdocs folder.
__________________
"Knowledge Speaks but, Wisdom Listens"
www.shumonhakim.com

Last edited by shakim : 08-28-2006 at 03:53 PM.
Reply With Quote
  #4 (permalink)  
Old 08-28-2006, 11:49 PM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
Code:
 NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
You already found it. I highlighted the important terms.

Reply With Quote
  #5 (permalink)  
Old 08-29-2006, 09:43 AM
shakim's Avatar
Registered User
 
Join Date: Apr 2002
Location: Michigan, USA
Posts: 36
So where would I point to the directory where the files for each url is stored?
__________________
"Knowledge Speaks but, Wisdom Listens"
www.shumonhakim.com
Reply With Quote
  #6 (permalink)  
Old 08-29-2006, 10:48 AM
shakim's Avatar
Registered User
 
Join Date: Apr 2002
Location: Michigan, USA
Posts: 36
I tried it this way but it didn't work. When I type any of the urls both of them launches the site that is located C:/Program Files/xampp/htdocs. I need lc.storix.com to launch the sites located at S:\My Webs


Code:
# 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>
__________________
"Knowledge Speaks but, Wisdom Listens"
www.shumonhakim.com

Last edited by shakim : 08-29-2006 at 11:20 AM.
Reply With Quote
  #7 (permalink)  
Old 08-29-2006, 02:49 PM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
On unix, there is a script called "apachectl" (Apache Control), when you issue "apachectl configtest", it tests the configuration. I think you probably have the same tool on windows, and you can use it via "cmd.exe".

If you don't have the "apachectl" script, check for program called "httpd" which is the core webserver process. I am not sure if it is called "httpd.exe" for you, anyway, look around. This program also takes various parameters via "cmd.exe". E.g. "httpd -t" test the configuration.

Last but not least, I am not sure if spaces are permitted in paths.

Hope that helps!
Till
Reply With Quote
  #8 (permalink)  
Old 05-22-2007, 09:50 AM
jazzy_rosez's Avatar
Registered User
 
Join Date: Jan 2002
Location: Virginia Beach, Va
Posts: 81
Spaces

no spaces are not allow. so the file name would have to be My_Web. see if that help.

and one sec.. pulling out my apache papers from my class last term...

Okie a few stupid basic questions. Did you setup your DNS forward and reverse look ups? Did you restart the server? Restart the DNS? Have SQL active?

Jazz
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a favicon? Allen Graphics and Flash 7 02-04-2007 06:19 PM
Hey Allen....Thanks For Creating It... FatBoyToSlim New Member Introductions 0 08-18-2006 11:38 AM
Creating Style Sheets ctbrons Programming and Scripting 3 05-04-2006 05:28 PM
Creating a file and saving it locally - PHP curtiss Programming and Scripting 6 03-25-2006 11:26 AM
Apache Setup Error ekeyte Servers 1 01-28-2006 05:37 PM


All times are GMT -5. The time now is 11:04 PM.

 
KickApps
Clicky Web Analytics


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter