YaST creates only 1 file for many Virtual Hosts

When I converted to OpenSUSE 11.2, and went through YaST HTTP Server Configuration, creating my virtual hosts under the Hosts tab, YaST combined them all into one file, “/etc/apache2/vhosts.d/ip-based_vhosts.conf”.

I did google and read, “http://en.opensuse.org/Apache_Quickstart_HOWTO#Virtual_Hosts” for further assistance.

I’d like each virtual host to have its own file under vhosts.d, and wondering why YaST did not do that. The file /etc/apache2/httpd.conf laid out the file structure, and all vhosts.d/*.conf files are included. Is there a way to tell YaST to create separate files for each vhost, or does the user have to manually do it?

Thank you.

Are your vhosts name based or IP based? Sounds like the latter from the filename.

Named virtual hosts.

I tried:

In YaST, HTTP Server Configuration -> Main Host

Click Add: “Server Resolution”
Check: “Determine Request Server by HTTP Headers”

The above adds the directive “VirtualByName 1” to the bottom of default-server.conf.

In the vhosts.d directory, YaST is really nasty. It removes all individual .conf files and merges them into one file, ip-based_vhosts.conf. Ouch!

Also, VirtualByName breaks Apache. Apache2 will not start.

In some google searches, there seemed to be some reference that in SLE VirtualByName is used to created named virtual hosts (I can’t confirm this), but in openSUSE it appears to break apache configuration files (see above). I’m running openSUSE 11.2.

I can’t figure out YaST to configure named vhosts. I manually create and maintain them.

Is this the general consensus?

Thank you.

yast is a good way to get a starter configuration. if you’re doing anything very clever, especially with virtual hosts, then it seems to get confused very quickly.

yes it collected all my nicely organized vhosts.d/*.conf files and spat them back out as ip-based_vhosts.conf or a different name based on some of the configuration.

after using yast a few times and seeing where it liked to put some options - default-server.conf httpd.conf etc… was clear that it doesn’t have much value-add for many of the modules, just seemed simpler to maintain the files manually after getting multiple virtualhosts, ssl, ldap, etc…

Like chaosless, I’ve been doing vhosts the old fashioned way by creating one file per vhost in /etc/apache2/vhosts.d using a text editor. It is possible that YaST isn’t up to doing the kind of complexity you want yet, I don’t know.

Glad I came across this thread because I’ve been banging my head for an hour trying to figure out why yast wasn’t keeping my “Determine Request Server by HTTP Headers” selection for my virtual hosts.

Seems to be a bug in my opinion. I’ll just manually configure my virtual hosts as others’ have suggested.