Networking Forums

Networking Forums > Computer Networking > Linux Networking > Setting up Multiple VirtualHosts in Apache

Reply
Thread Tools Display Modes

Setting up Multiple VirtualHosts in Apache

 
 
Rick
Guest
Posts: n/a

 
      07-09-2005, 07:01 PM
I've been working on setting up a web server on DSL, with which I will
host multiple domain names from the same IP address. I have set up
what will be my "main" domain name and it is working fine. I set up
bind/named to host my own name server, and set up "ns1.mydomain.com",
"ns2.mydomain.com" with my domain registrar to point to the name server
at my IP address. The main domain is working perfectly with Apache.

Now I'd like to set up an additional domain to run as another
VirtualHost from the same IP address. I have configured that domain at
my registrar with the DNS servers "ns1.mydomain.com",
"ns2.mydomain.com". What other steps do I need to follow to get this
domain pointing to the correct site? I have already set the site up in
the httpd.conf file, presumably the correct way. I suspect I may have
to add another "hosts" file to bind/named, but I'm not sure how to
configure it.

Any help and input would be excellent. Thanks in advance.

Rick

 
Reply With Quote
 
 
 
 
Baho Utot
Guest
Posts: n/a

 
      07-09-2005, 07:30 PM
begin virus.scr.txt On Sat, 09 Jul 2005 12:01:02 -0700, Rick wrote:

> I've been working on setting up a web server on DSL, with which I will
> host multiple domain names from the same IP address. I have set up
> what will be my "main" domain name and it is working fine. I set up
> bind/named to host my own name server, and set up "ns1.mydomain.com",
> "ns2.mydomain.com" with my domain registrar to point to the name server
> at my IP address. The main domain is working perfectly with Apache.
>
> Now I'd like to set up an additional domain to run as another
> VirtualHost from the same IP address. I have configured that domain at
> my registrar with the DNS servers "ns1.mydomain.com",
> "ns2.mydomain.com". What other steps do I need to follow to get this
> domain pointing to the correct site? I have already set the site up in
> the httpd.conf file, presumably the correct way. I suspect I may have
> to add another "hosts" file to bind/named, but I'm not sure how to
> configure it.
>


If the httpd.conf is config'd properly then you should be good to go,
apache should take care of the rest.

> Any help and input would be excellent. Thanks in advance.
>
> Rick


--
Tayo'y Mga Pinoy

 
Reply With Quote
 
Robert
Guest
Posts: n/a

 
      07-09-2005, 11:33 PM
Rick wrote:
> I've been working on setting up a web server on DSL, with which I will
> host multiple domain names from the same IP address. I have set up
> what will be my "main" domain name and it is working fine. I set up
> bind/named to host my own name server, and set up "ns1.mydomain.com",
> "ns2.mydomain.com" with my domain registrar to point to the name server
> at my IP address. The main domain is working perfectly with Apache.
>
> Now I'd like to set up an additional domain to run as another
> VirtualHost from the same IP address. I have configured that domain at
> my registrar with the DNS servers "ns1.mydomain.com",
> "ns2.mydomain.com". What other steps do I need to follow to get this
> domain pointing to the correct site? I have already set the site up in
> the httpd.conf file, presumably the correct way. I suspect I may have
> to add another "hosts" file to bind/named, but I'm not sure how to
> configure it.
>
> Any help and input would be excellent. Thanks in advance.
>
> Rick
>

Here's how I do it with dyndns.org on a Slackware box;

Listen 80
BindAddress *
ServerName www.xxxx.dyndns.org
# --- I put mine in /home
DocumentRoot "/home/www/blogsite"
# This should be changed to whatever you set DocumentRoot to.
<Directory "/home/www/blogsite">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# Use name-based virtual hosting.
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin (E-Mail Removed)
ServerName xxxx.dyndns.org
ServerAlias *.xxxx.dyndns.org
DocumentRoot /home/www/blogsite
ErrorLog /var/log/apache/blogsite_error_log
CustomLog /var/log/apache/blogsite_access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin (E-Mail Removed)
ServerName yyyyy.dyndns.org
ServerAlias *.yyyyy.dyndns.org
DocumentRoot /home/www/yyyyy
ErrorLog /var/log/apache/yyyyy_error_log
CustomLog /var/log/apache/yyyyy_access_log common
</VirtualHost>

Hope I didn't miss anything.

--Robert
 
Reply With Quote
 
Rick
Guest
Posts: n/a

 
      07-10-2005, 12:27 AM
Thanks for the help! I've got it all working. Sometimes it takes a
while for the DNS changes to take effect, so when you're not quite sure
you're doing it right - as is my case - you don't know whether what
you've done is going to work or not.

Rick

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cgi-bin not visible to apache with virtualhosts Ohmster Linux Networking 8 06-01-2004 04:53 AM
Apache (bug?) and multiple apr_brigade_partition errors Jem Berkes Linux Networking 0 12-14-2003 09:10 PM
setting up Apache. Dave Linux Networking 2 11-11-2003 02:05 AM
Setting up apache help Ian Linux Networking 2 10-07-2003 01:15 PM
Apache & VirtualHosts R.Gunn Linux Networking 7 07-22-2003 02:34 PM



1 2 3 4 5 6 7 8 9 10 11