I am having a problem with subdomains, alias & virtual hosts Centos 4.3, Apache 2.0.52 & PHP 5.04 I can get the primary to work, but not the aliased servers. http.conf extract ********* NameVirtualHost * <VirtualHost *> ServerName www.domain.com DocumentRoot /var/www/html/domain/ ServerAlias www.altdomain.com <http://www.altdomain.com> </VirtualHost> <VirtualHost *> ServerName subdomain.domain.com DocumentRoot /var/www/html/subdomain/ ServerAlias www.subdomain.altdomain.com <http://www.subdomain.altdomain.com> </VirtualHost> ********** dave -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20060609/34c16fb4/attachment-0002.html>
On Fri, 2006-06-09 at 15:41 -0600, Dave J. Hornford wrote:> I am having a problem with subdomains, alias & virtual hosts > Centos 4.3, Apache 2.0.52 & PHP 5.04 > I can get the primary to work, but not the aliased servers. > http.conf extract > ********* > NameVirtualHost * > <VirtualHost *> > ServerName www.domain.com > DocumentRoot /var/www/html/domain/ > ServerAlias www.altdomain.com > </VirtualHost> > > <VirtualHost *> > ServerName subdomain.domain.com > DocumentRoot /var/www/html/subdomain/ > ServerAlias www.subdomain.altdomain.com > </VirtualHost> > **********The name as used in the browser URL must match exactly what you specify as the ServerName or a ServerAlias (you can have more than one name there). Are you sure everything is spelled exactly right and you didn't omit the domain name in the browser? The first one in the list is used if nothing matches. -- Les Mikesell lesmikesell at gmail.com
Dave J. Hornford wrote:> I am having a problem with subdomains, alias & virtual hosts > Centos 4.3, Apache 2.0.52 & PHP 5.04 > I can get the primary to work, but not the aliased servers. > http.conf extract > ********* > NameVirtualHost * > <VirtualHost *> > ServerName www.domain.com <http://www.domain.com> > DocumentRoot /var/www/html/domain/ > ServerAlias www.altdomain.com <http://www.altdomain.com> > </VirtualHost> > > <VirtualHost *> > ServerName subdomain.domain.com > DocumentRoot /var/www/html/subdomain/ > ServerAlias www.subdomain.altdomain.com > <http://www.subdomain.altdomain.com> > </VirtualHost> > ********** >Are you trying to access the alias on the local machine or a remote machine? Does DNS reflect the correct information, or need to be updated to reflect the alias(es)?