Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Multiple web sites, 1 domain, OS X Lion server

Hey guys,


So I am running Mac OS X Lion Server on my Mac Mini. I have 2 domains pointed to my server. What I am wondering is if anyone has found a way to tell the built in web server running on Lion a way to handle the incoming web requests for these 2 different domains?


Specifically--


I have a web site called www.themoondeck.com and that points to the default web folder for web services in Lion.

I also have a web site called www.tejavapowered.com which points to a different directory in the same web services folder.


When i go to either themoondeck.com OR tejavapowered.com i get the documents for the default site, which in this case was themoondeck.com.


It seems like there should be a way for Lion to detect the web address being requested and then have it dynamically point to the right folder.


Any ideas?


Thank you!

William

Mac mini, Mac OS X (10.7)

Posted on Jul 23, 2011 7:03 PM

Reply
Question marked as Best reply

Posted on Jul 23, 2011 8:44 PM

I believe what you require is virtual hosting. It is broken in Lion Server, though some have had success editing apache configuration files in the Terminal to get it to work.

12 replies

Jul 24, 2011 9:55 PM in response to willarizona

I too just bumped into this. I haven't tried the NameVirtualHost *:80 thing yet.

This is another disappointment so far with Lion Server. In general Lion rocks, but the server has taken a step or two backwards even if I like what they've done with simplifying things in general. I really hope what I'm seeing is a temporary small step backwards that will be rectified again soon with the Server app growing the ability to manage somewhat more sophisticated setups... even if this is hidden with 'progressive disclosure' of the complexities.


A range of things, gateway setup in particular, seem to only be doable practically with the separately downloaded Server Admin Tools. However, much to my surprise (and shock!) the Server Admin Tool is completely missing the Web service now.

Jul 26, 2011 3:22 AM in response to willarizona

I noticed the same problem, and I coldn't fix it by editing apache either. I'm rolling back to Snow Leopard Server, until they fix it.

Also, I'm a little annoyed about how they have removed so many of the settings and options for the services. I understand they are trying to make this the "Server For Everyone", but come on!

If 10.7 doesn't improve, I'm sure that I'll switch to Ubuntu for all of my service needs.

Jul 26, 2011 10:57 AM in response to Flashwalker

OK, I tried NameVirtualHost *:80 in the httpd.conf file.


Indeed this works... in a sense.

Having made this change, if I create a new site with the "+" button in the Web Server settings of the Server.app utility, the item will disappear when I click "Done", leaving only the default site visible in the list. However, apache is working correctly and the browser displays the expected page from the virtual web host.


Not having the extra site displayed is annoying of course. Moreover, the default site in the list now seems to be confused as it shows the site files location as "/var/empty" when I have the NameVirtualHost *:80 set in the conf file. If I excise this line from the file and restart the Server.app 'sufficiently', then the site files path returns to the expected "/Library/Server/Web/Data/Sites/..." location.


So unless there's something else preventing the Server.app tool from working correctly in my case (I do have a migrated server from Snow Leopard), then I guess Server.app was not meant to be used with virtual web hosting turned on directly in the apache configuration.

Jul 26, 2011 11:06 AM in response to willarizona

I got this to work a day or so ago, meant to come back and report on it but forgot 😟


Anyway, i had to do a combination of things.


First, there is this ridiculous thing you need to add to your /etc/apache2/sites directory


It is a file called 00000_MoreTestingRequired.conf


Make sure this is in that file.


NameVirtualHost *:80


Now, i have NO IDEA why i'd need a file like this, but, i read it on some other site and i added it and it did indeed work. Blows my mind, but oh well.


That will enable the virtual hosting. I ran into an issue where by default OS X Lion Server's Apache implementation doesn't come with Mod_Rewrite turned on by default, but that isn't the purpose of thise post so i will skip that 😉


Anyway, i have my Virtual Servers working fine now with that change. Again.. Why it needs to be named that? No idea! Probably some type of joke or some such.

Sep 15, 2011 12:15 AM in response to willarizona

It worked for me too, finally!!! Thank you very much!

The concept of a mac server is still very far from a real professional use.

The worse part is that it is very far from a personal use too: can't win versus wordpress and facebook and a real wiki, just introducing its wiki and blog.

So, what really is a lion server, if we need to make our hands dirty with terminal, editing files like in linux?

So, just hope in 10.7.2 to have all this little issues fixed ....

Multiple web sites, 1 domain, OS X Lion server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.