Virtual host config issues in osx 10.7 server app

I have two mac mini lion servers setup to run as production and staging machines. My sysadmin decided on these machines over the previous CentOS we had because it had an “interface” to be able to manage it, rather than just the terminal. To be honest, I prefer the terminal.

My problem is, the mac osx 10.7 server.app seems to be having issues with the creation of virtual hosts in the ‘Web’ section. It seems VERY touchy. For example, I cannot create a http virtual host first. I have to create a https host first with a unique dns name 9e..g vuly6), then create the http host with a different dns name to the first (e.g. www), or it appears to override it the first one, even though one is ssl and one is non-ssl.

Further, it seems to override perfectly good configurations at random. For example, the default sites directory is usually /Users/default/Sites/Customsites or something, but sometimes when I load the server.app it changes to /var/empty. Also, if I change or add extra virtual hosts after the first one or two, it starts to mess up and the first two virtual hosts start having issues.

Has anyone had any experience with setting up virtual hosts via this app? Am I able to manually create these virtual hosts, without using the app, and without the app overriding my settings when I restart apache?

Answer

In answer to my own question,

Yes, you can create your own virtual hosts manually using extra/httpd-vhosts.conf. I read through the entire ruby script that server app uses to generate virtual hosts.

To create your own manually, you need to uncomment the Include in httpd.conf and httpd.conf.default. When the Server.app has a hissy fit and decides to reset all your configuration, it will reset the httpd.conf file to the default file as well.

Then just modify httpd-vhosts.conf and you’ll be sweet.

Attribution
Source : Link , Question Author : Benno , Answer Author : Benno

Leave a Comment