Re: Subdomain Config Questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It was thus said that the Great Aaron Todd once stated:
> Hello,
> 
> I am looking to configure Apache in a way that I've never done  
> before.  I've tried describing this to google to see what it spits  
> out, but I am unsure of the results.  What I am looking to do is have  
> a set of files in the main web root of my server.  I'd like any  
> subdomain to use these files as it it would if they were in its own  
> web root.  

  And then ... 

> Basically I'd like a.domain.com and  
> b.domain.com to be structured exactly the same, but serve up different  
> content text and images.  When I update the main code it will update  
> for all the subdomains without uploading files to each one.

  I'm not quite sure exactly what you want, but I'm guessing you want to
house all the content for all the sites under a single folder.  It's
certainly possible to do something like (very minimal configuration here):

<VirtualHost 10.0.0.10:80>
  ServerName	www.example.net
  DocumentRoot	/var/www/html
</VirtualHost>

<VirtualHost 10.0.0.10:80>
  ServerName	a.example.net
  DocumentRoot	/var/www/html/site-a
</VirtualHost>

<VirtualHost 10.0.0.10:80>
  ServerName	b.example.net
  DocumentRoot	/var/www/html/site-b
</VirtualHost>

> The google searching I did seemed to come back with  
> "subdomain wildcards".  I have tried any of the configuration examples  
> I found on it yet.  So it may or may not be what I want.  The seconds  
> thing I need to happen is that I'd like to set a PHP session variable  
> based on the subdomain name.  Or set something to I can distinguish  
> between each one given.  

  Doing things this way, Apache will pass along the domain name of the site
to PHP.  While there is a way to set things up so you can host a vast number
of sites with very little configuration change [1], but the problem with
that is that each host *must* have the same configuration; if you have to
vary the configuration even a bit, then you can't use it (from my
understanding).

  -spc (More on this at [2])

[1]	http://httpd.apache.org/docs/2.0/vhosts/mass.html

[2]	http://httpd.apache.org/docs/2.0/vhosts/


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux