Forum Moderators: phranque
I have my Apache dir on my D drive and I have some directories on my E drive that I would like hosted. How do I go about this? Not everything will fit on the same drive.
Thanks
Sam
What you need are Virtual Hosts: just right for this job. Virtual hosts allow one instance of Apache to host several sites, either as name-based or IP address-based hosts.
Here's the guide to virtual hosts on Apache 1.3:
[httpd.apache.org...]
If this a test/development machine (I assume it is), then go for name-based virtual hosting, add site names such as "site1.dev", site2.dev", etc. in your hosts file, then add the virtual hosts for each, with the document root pointing to the appropriate directory on the E: drive.
On my D drive is nothing but my Apache files. On my E drive I have a folder of pictures, a folder of music, etc. I want to use those pictures in my website. I'd also like the directory to be browseable. Other than putting the directories into my htdocs dir, I don't understand how to do it.
In ISS you just right clicked on a folder and made it a virtual dir. That was pretty convenient. I understand that Apache isn't going to be so OS related.
I know that I need to go into my httpd.conf and add in a virtual directory, but I just don't get what all to put. I tried adding one and the site wouldn't work all together. Where in the httpd.conf do I add it?
Sorry about all the questions. I guess it sounds like I want all the answers spoon fed to me. I've read the documentation and I'm reading over it again. I'm just so used to IIS, that it's hard to follow this.
Thanks
Are you looking to use the same images/folders for several virtual sites, or are there specific, separate folders for each site?
I want to be able to use the images on my html pages and also have a link so that my images dir is browseable.
[edited by: jdMorgan at 1:55 am (utc) on Oct. 9, 2004]
[edit reason] Removed specifics per TOS [/edit]
Open up you httpd.conf file in Notepad, and find the line beginning:
DocumentRoot And change the path from
D:\Program Files\Apache\htdocs (or whatever the path is now), to E:\mysite (or whatever folder you want on E:) Then place the images in, for example,
E:\mysite\images and restart Apache. (Added: you might want to review the Terms of service [webmasterworld.com] for the forum, particularly about placing URLs to your sites).
So I can't setup a virtual directory? I have to change the entire documentroot?
Looks like I need to move some stuff around on my HDDs.
Thanks for all of the advice.
[httpd.apache.org...]
Then you can spread your content wherever you want.