Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- Date: Wed, 25 Oct 2006 10:22:01 +0900
- From: Keith Bawden <isdj@example.com>
- Subject: Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- References: <4539A93C.6000606@example.com> <17721.48833.820331.644734@example.com> <453CA863.4030205@example.com> <17724.51748.744759.150@example.com> <453D43EC.9080508@example.com>
- User-agent: Thunderbird 1.5.0.7 (X11/20060909)
Dave M G wrote: > However, I also had a few PHP and HTML files that weren't associated > with any web site, not in any subdirectory. Just files for testing > scripts and whatnot. > > Now that I've set up some subdirectories to behave as web sites, I can > no longer access these other files. If I go to http://localhost, it > defaults to the first of the virtual web sites I have. > > Now that I'm mapping some directories to behave like web sites, do I > have to do that for any files I want to access through my local Apache > server? Or have I made a mistake somewhere that is making the first in > the list of web sites be the default for localhost? Hello, Where are these "files for testing located"? Once you know this check your apache configuration to see if you have a DocumentRoot directive that points to that location. e.g If your testing files are in /var/www then you should have something like this in you config: DocumentRoot /var/www/ You may have inadvertently deleted your default DocumentRoot when you implemented virtual directories. The way I have mine setup is to use sub domains (or fake domains) for most virtual hosts: e.g. NameVirtualHost * <VirtualHost *> ServerName www.bawdo.com DocumentRoot /var/www/main ... <VirtualHost *> ServerName work.bawdo.com DocumentRoot /var/www/work ... If you do not want to setup your own local DNS server then put entries in your /etc/hosts file and ensure files comes before dns in your /etc/nsswitch.conf file (e.g. hosts: files dns) This way you can test your multiple sites out using the "real" URLs. For example if you had two clients: www.fred.com and www.wilma.com you would setup your hosts file as such: 127.0.0.1 www.fred.com 127.0.0.1 www.wilma.com Now with the appropriate virtual hosts setup you can work with http://www.fred.com and http://www.wilma.com locally. Regards, Keith
- References:
- [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: Dave M G
- [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: stephen
- Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: Dave M G
- Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: stephen
- Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Open source intelligence
- Next by Date: Re: [tlug] .jp domain
- Previous by thread: Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- Next by thread: Re: [tlug] Can I make a subdirectory of localhost behave like a root directory for a site?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links