Bluehost.com Web Hosting $6.95

Virtual domains with apache on SuSE

This is a discussion on Virtual domains with apache on SuSE within the Linux Web Servers forums, part of the Web Server and Related Forums category; I am getting a new server setup using SuSE 9.2 and mostly standard components from the suse distro, including ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-12-2005
bronto
 
Posts: n/a
Default Virtual domains with apache on SuSE

I am getting a new server setup using SuSE 9.2 and mostly standard
components from the suse distro, including apache2.

I am trying to get virtual hosts set up, using the standard method, not
automatic virtual hosts. Sites need to be identified by host, not IP.
In other words, I need to be able to designate a site path anywhere on
the system, not necessarily only subdirectories within one directory.
I've read through the docs here:
http://httpd.apache.org/docs-2.0/vhosts/name-based.html

Originally, mod_vhost_alias was enabled; my understanding is that's for
the automatic virtual hosts, and I've disabled it. UseCanonicalName is
off. NameVirtualHost is set to my only IP address.

The default server's path is:
DocumentRoot /srv/www/htdocs

virtual host 1 is:
<VirtualHost *>
DocumentRoot /home/vhost1/public_html
ServerName "vhost1.subdom.csd-bes.net"
<Directory "/home/vhost1/public_html">
allow from all
Options +Indexes
UseCanonicalName off
</Directory>
</VirtualHost>

virtual host 2 is:
<VirtualHost *>
DocumentRoot /home/vhost2/public_html
ServerName "vhost2.subdom.csd-bes.net"
<Directory "/home/vhost2/public_html">
allow from all
Options +Indexes
UseCanonicalName off
</Directory>
</VirtualHost>

In this configuration, all sites resolve to the vhost1 path. If I
supply the specific IP address for vhost1 in the config above, all
sites resolve to the vhost2 path. If I supply the IP address to both
vhosts, all sites resolve to the default path.

What's going on here?

  #2 (permalink)  
Old 07-12-2005
David Efflandt
 
Posts: n/a
Default Re: Virtual domains with apache on SuSE

On 11 Jul 2005 21:38:12 -0700, bronto <bronto@csd-bes.net> wrote:
> I am getting a new server setup using SuSE 9.2 and mostly standard
> components from the suse distro, including apache2.
>
> I am trying to get virtual hosts set up, using the standard method, not
> automatic virtual hosts. Sites need to be identified by host, not IP.
> In other words, I need to be able to designate a site path anywhere on
> the system, not necessarily only subdirectories within one directory.
> I've read through the docs here:
> http://httpd.apache.org/docs-2.0/vhosts/name-based.html
>
> Originally, mod_vhost_alias was enabled; my understanding is that's for
> the automatic virtual hosts, and I've disabled it. UseCanonicalName is
> off. NameVirtualHost is set to my only IP address.
>
> The default server's path is:
> DocumentRoot /srv/www/htdocs
>
> virtual host 1 is:
><VirtualHost *>
> DocumentRoot /home/vhost1/public_html
> ServerName "vhost1.subdom.csd-bes.net"
><Directory "/home/vhost1/public_html">
> allow from all
> Options +Indexes
> UseCanonicalName off
></Directory>
></VirtualHost>
>
> virtual host 2 is:
><VirtualHost *>
> DocumentRoot /home/vhost2/public_html
> ServerName "vhost2.subdom.csd-bes.net"
><Directory "/home/vhost2/public_html">
> allow from all
> Options +Indexes
> UseCanonicalName off
></Directory>
></VirtualHost>
>
> In this configuration, all sites resolve to the vhost1 path. If I
> supply the specific IP address for vhost1 in the config above, all
> sites resolve to the vhost2 path. If I supply the IP address to both
> vhosts, all sites resolve to the default path.
>
> What's going on here?


Is the public IP used in NameVirtualHost actually on this computer? If
the server is behind NAT or dynamic IP, you would likely need to use
wildcard NameVirtualHost *

I also had to use a bogus main ServerName, but that may be because my
default vhost is a nameless worm trap, and when main ServerName matched
one of my vhosts, things did not work right.

Also check if anything in /etc/hosts might be throwing things off course
if any of the names or IP are listed there.
  #3 (permalink)  
Old 07-12-2005
bronto
 
Posts: n/a
Default Re: Virtual domains with apache on SuSE

That's it! Thanks :)

I am setting this server up at home prior to installing it in the data
center, and I have it sitting behind a Netgear, which is NAT, I
believe.

Problem solved. :D

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:50 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0