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?



> 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?

I'd probably set up sym links with a common include directory. Each
virtual server is it's own little web property. Another way to do the same
thing is to use an include or require in the web page with the actual
location (relative or otherwise) to the actual file. The php processer
doesn't care that the file is in or outside of the web space so long has
it has permissions for it.

In my case I have a dozen sites in a single directory and a 13th directory
(include\) with common scripts and definitions. Each of the 12 sites has a
require("../include/somefile.php"); statement. I've got about 30 virtual
sites on this server using about 10 different IP addresses.

You may also want to be sure to set multiple server aliases for each
vitural server. I generaly set *.domain.ext www.domain.ext and domain.ext
for my stock setup ensuring that everything gets there properly (unless
you don't want it to).



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links