Re: Help in setting up one http server for two different domains

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

 






Thanks for the help to both of you,

I've got both sites up now.

Jim


> > Hello,  I've got a server that is currently serving one website with a
> > registered domain and dns.  I would like to use the same server to also
> > serve another domain.  Reading about name-based virtual hosting at
> > http://httpd.apache.org/docs/1.3/vhosts/name-based.html I can't seem to
> > get the second url to load- I keep getting the same first domain's
> > webpage. The path for the first domain is from /var/www/html. The path > > for the second domain is set right now to /var/www/html/seconddomain...
> >
> > So anywhoooo...  Comments???
> >
> > Thanks,
> >
> > Jim
> >
> >
> This is how I would do it.
> Main domain would be setup at /var/www/html/firstdomain
> and the second /var/www/html/seconddomain
>
> <VirtualHost *:80>
> 	ServerAdmin email@xxxxxxxxx
> 	DocumentRoot /var/www/html/firstdomain
> 	ServerName firstdomain.com
> 	ServerAlias www.firstdomain.com
> 	ErrorLog logs/firstdomain-error_log
> 	CustomLog logs/firstdomain-access_log common
> </VirtualHost>
>
> <VirtualHost *:80>
> 	ServerAdmin email@xxxxxxxxx
> 	DocumentRoot /var/www/html/seconddomain
> 	ServerName seconddomain.com
> 	ServerAlias www.firstdomain.com
> 	ErrorLog logs/seconddomain-error_log
> 	CustomLog logs/seconddomain-access_log common
> </VirtualHost>
>
> Hope this helps

Note that you need a:
NameVirtualHost *:80
in the global section above those to make it work.  (And
fix the typo in the second ServerAlias).  Also you can
add additional names in the ServerAlias entry if you want.

--
  Les Mikesell
    lesmikesell@xxxxxxxxx



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux