|
|
|
|
||||||
| comp.info.servers.unix Web servers for UNIX platforms. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
As a novice to Apache, I am trying to setup Virtual hosts on a 'fresh'
Suse 9.3 installation. The 9.3 is fully patched as of today. Short question: Has anybody successfully used Yast to setup virtual hosts on suse 9.3 using apache 2? The apache2 docs says that when you want to add a virtual site to a single non-virtual site, one has to create an additional virtual entry for the previous site. Ie. two virtual entries are needed. http://httpd.apache.org/docs-2.0/vho...ml#page-header However, when I add a virtual site via Yast, I can see in /etc/apache2/vhosts.d/yast2_vhosts.conf: --------------------------------- <VirtualHost 192.168.0.13> # YaST auto define section <IfDefine SSL> SSLEngine off </IfDefine> DocumentRoot /srv/www/webs/ola ServerName webs-ola.localdomain ServerAdmin admin@localhost # YaST created entry <Directory "/srv/www/webs/ola"> Options None AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> -------------------- As you can see, there is no sign of a VirtualHost entry for the original server, just the new virtual host. I have 'grep'd' the /etc/apache2 directory and there is no <VirtualHost> entry in any other file. Using 'httpd2 -S' gives: ----------------------------- VirtualHost configuration: 192.168.0.13:* is a NameVirtualHost default server webs-ola.localdomain (/etc/apache2/vhosts.d/yast2_vhosts.conf:1) port * namevhost webs-ola.localdomain (/etc/apache2/vhosts.d/yast2_vhosts.conf:1) Syntax OK -------------------------- Again, no sign of the original server. Do I have to explicitly define a second VirtualHost entry corresponding to the 'original' server - this is what I would have attempted in the absence of yast, or is there some Yast trick I'm missing - which begs the question, 'what's the point of /etc/apache2/default-server.conf? I'm loath to give up on Yast just yet, as I will have to defend my config from it for ever more, but I seem to spend more persuading yast than anything else. Can anyone ? -- Cheers, Des |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Mon, 18 Jul 2005 17:21:50 +0100, Des <des@oregon.nOSPamPlz.org.uk> wrote:
> As a novice to Apache, I am trying to setup Virtual hosts on a 'fresh' > Suse 9.3 installation. The 9.3 is fully patched as of today. > > Short question: Has anybody successfully used Yast to setup virtual > hosts on suse 9.3 using apache 2? > > The apache2 docs says that when you want to add a virtual site to a > single non-virtual site, one has to create an additional virtual entry > for the previous site. Ie. two virtual entries are needed. > http://httpd.apache.org/docs-2.0/vho...ml#page-header > > However, when I add a virtual site via Yast, I can see in > /etc/apache2/vhosts.d/yast2_vhosts.conf: > --------------------------------- ><VirtualHost 192.168.0.13> > # YaST auto define section > <IfDefine SSL> > SSLEngine off > </IfDefine> > DocumentRoot /srv/www/webs/ola > ServerName webs-ola.localdomain > ServerAdmin admin@localhost > # YaST created entry > <Directory "/srv/www/webs/ola"> > Options None > AllowOverride None > Order allow,deny > Allow from all > </Directory> ></VirtualHost> > -------------------- > > As you can see, there is no sign of a VirtualHost entry for the > original server, just the new virtual host. I have 'grep'd' the > /etc/apache2 directory and there is no <VirtualHost> entry in any > other file. I have not used YaST to create vitual hosts. I just created a vhost.conf that was defined in /etc/sysconfig/apache as: HTTPD_CONF_INCLUDE_FILES="/etc/httpd/vhost.conf" And yes, for NameVirtualHost, you do need a VirtualHost entry for each virtual host, since there will be no main host in that case. You apparently read that you needed 2, but only added 1 so far. Note that when using NameVirtualHost, the first vhost listed will be the default if no other vhost is matched. So set up the first one in the list like your main host would be. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Mon, 18 Jul 2005 17:21:50 +0100, Des <des@oregon.nOSPamPlz.org.uk> wrote:
> As a novice to Apache, I am trying to setup Virtual hosts on a 'fresh' > Suse 9.3 installation. The 9.3 is fully patched as of today. > > Short question: Has anybody successfully used Yast to setup virtual > hosts on suse 9.3 using apache 2? > > The apache2 docs says that when you want to add a virtual site to a > single non-virtual site, one has to create an additional virtual entry > for the previous site. Ie. two virtual entries are needed. > http://httpd.apache.org/docs-2.0/vho...ml#page-header > > However, when I add a virtual site via Yast, I can see in > /etc/apache2/vhosts.d/yast2_vhosts.conf: > --------------------------------- ><VirtualHost 192.168.0.13> > # YaST auto define section > <IfDefine SSL> > SSLEngine off > </IfDefine> > DocumentRoot /srv/www/webs/ola > ServerName webs-ola.localdomain > ServerAdmin admin@localhost > # YaST created entry > <Directory "/srv/www/webs/ola"> > Options None > AllowOverride None > Order allow,deny > Allow from all > </Directory> ></VirtualHost> > -------------------- > > As you can see, there is no sign of a VirtualHost entry for the > original server, just the new virtual host. I have 'grep'd' the > /etc/apache2 directory and there is no <VirtualHost> entry in any > other file. I have not used YaST to create vitual hosts. I just created a vhost.conf that was defined in /etc/sysconfig/apache as: HTTPD_CONF_INCLUDE_FILES="/etc/httpd/vhost.conf" And yes, for NameVirtualHost, you do need a VirtualHost entry for each virtual host, since there will be no main host in that case. You apparently read that you needed 2, but only added 1 so far. Note that when using NameVirtualHost, the first vhost listed will be the default if no other vhost is matched. So set up the first one in the list like your main host would be. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Mon, 18 Jul 2005 23:35:24 +0000 (UTC), efflandt@xnet.com (David
Efflandt) wrote: >On Mon, 18 Jul 2005 17:21:50 +0100, Des <des@oregon.nOSPamPlz.org.uk> wrote: >> As a novice to Apache, I am trying to setup Virtual hosts on a 'fresh' >> Suse 9.3 installation. The 9.3 is fully patched as of today. >> >> Short question: Has anybody successfully used Yast to setup virtual >> hosts on suse 9.3 using apache 2? >> > >I have not used YaST to create vitual hosts. I just created a vhost.conf >that was defined in /etc/sysconfig/apache as: > >HTTPD_CONF_INCLUDE_FILES="/etc/httpd/vhost.conf" > >And yes, for NameVirtualHost, you do need a VirtualHost entry for each >virtual host, since there will be no main host in that case. You >apparently read that you needed 2, but only added 1 so far. > >Note that when using NameVirtualHost, the first vhost listed will be the >default if no other vhost is matched. So set up the first one in the list >like your main host would be. Thanks, I will have at look at that approach. In the end, I found it easier to use the vconf template files in the /etc/apache2/vhost directory. It appears that the standard httpd.conf files includes any *.conf it finds in the ./vhosts directory, so I just knocked up a couple of these for the two domains and everything started to behave. Although this skips the direct Yast configuration method, at least it is sympathetic to the approach used in SuSE. Hopefully, this should survive any future upgrade. Thanks for the reply. -- Cheers, Des |
|
![]() |
| Outils de la discussion | |
|
|