You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Doug Robson <dr...@chartertn.net> on 2004/09/19 05:06:46 UTC

[users@httpd] Virtual Hosting and file structure question

SooperNoob here... 

I need to know if what I want to do is (1) possible and (2) how to do it if it is. :) 

I want to set up Apache to do Virtual Hosting on one hardware server, serving 
more than 100 web sites. I want to allow the web site clients to have access 
to updating their content as far as the text input goes, but I want to have my own 
control over CSS, and templates for layout and presentation under my control 
through a set of files and scripts that are kept separate from each Virtual Host's 
Document Root structure. 
How do I go about creating a file structure that can be referenced by the HTML 
pages from inside the Virtual Hosts Document Root structure that Apache 
serves to requesting browser clients which resides in a file structure not in 
the Virtual Hosts Document Root? That is, when the HTML index.html page 
is being served from VH Doc. Root, and it makes reference to somescript.php 
or some other template file NOT under VH Doc. Root, how can the connection 
be made to them? Where do you put it, and what directives do you put into 
the Virtual Host container setup in httpd.conf to support that kind of referencing? 

The idea here is that I have a lot of supporting files consisting of logic (scripting) 
and formatting files (templates, CSS's, etc) that will be common to every 
Virtual web host - so extensive that I do not want to fill up valuable disk space 
replicating it in each and every Virtual Host's Doc. Root structure. So I want to 
break out the common stuff and have it reside physically on disk only once and 
be able to refer to it from within the scope of every Virtual server. 
Essentially, I'm wanting to know if there is a way to 
serve files outside of the DocumentRoot of each Virtual 
Host. If so, how does it work. 

I am wondering if "Symlinks" is somehow a possible solution, but I can't find
a detailed explanation of what this means or how it is typically used with
examples, etc.

I've probably been as clear as mud in stating my quest, but that's about as 
good as I can make it now with my totally newbie and incomplete understanding 
of Apache at this point. 

Looking for lots of kind, patient help. 

Doug 
drobson@chartertn.net 

Re: [users@httpd] Virtual Hosting and file structure question

Posted by Joshua Slive <js...@gmail.com>.
[Please post in plain text.]

> The idea here is that I have a lot of supporting files consisting of logic (scripting) 
> and formatting files (templates, CSS's, etc) that will be common to every 
> Virtual web host - so extensive that I do not want to fill up valuable disk space 
> replicating it in each and every Virtual Host's Doc. Root structure.

Someone already answered your question in a correct, though not
incredibly gentle way.  Was there something about that answer you
didn't understand?

Anyway, you can use an Alias directive.  Any Alias directive placed in
the main server context (outside any <VirtualHost>) will apply to all
virtual hosts.

See:
http://httpd.apache.org/docs-2.0/urlmapping.html#outside

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org