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

Multiple websites

It seems pretty clear in the Server app how to configure hosting multiple websites but it doesn't seem to work. No matter what I put in, requests just go to the default Mac OS X Server site. Anyone had luck with this?

Mac mini, Mac OS X (10.6.7), OS X Server

Posted on Jul 20, 2011 12:42 PM

Reply
66 replies

Aug 1, 2011 4:55 AM in response to SGlazier

I created the file as descriped in the post marked as a solution, and restarted the Web service using the Server App.


Then I tried to create a new web site, as follows:


User uploaded file

When I click "View Document Root Contents" I see the correct folder that has a complete web site's files stored there.


Then I go back to the main Web Server screen, select the new site, and click "View Server Web Site." I still get sent to the default site location as listed in the original web site listing (which I can not edit or delete).


User uploaded file


What else am I supposed to do in order to get custom web sites working on this thing? Ideally I would just like to be able to edit "node01.local" to point it to the files where I want them to be stored, but I don't uderstand why it won't let me edit it, and it seems I cannot even override it with my own settings.


Help?

Thanks in advance.

Aug 1, 2011 8:54 AM in response to Spinland

The View Server Website will never change. It is the default wiki site (and all other related services) set up by LS. You can tell apache where to search for your custom web site files by clicking the Store site files in: drop down and then navigate to your folder. Check to make sure they have been added to your site definition file by taking a peek at /etc/apache2/sites/0000 (your new site name here)80.conf.


There should be an entry in that file that points to your site files directory.


In your httpd.conf file place

NameVirtualHost *:80

NameVirtualHost *:443


in a common area.


Also, as a side note:


In your site definition files, adding the:


ServerAlias www.example.com (or whatever the name)


will help with the alias www because the server will only serve out http://test.local no matter how many CNAMEs you have in DNS for that site.


LS appears to have only been aimed at a one site, small services, basic configuration installation. If you want all the advanced services that were available in the GUI of SLS, you're going to either have to stay with SLS, or go to Apache's web site and do some detailed reading unfortunately.


I can't jynx myself, but after endless endless endless hours of installing, reinstalling, editing, resinstalling and much reading - I finally got LS to work for the most part. If it weren't for the push email to my employees iPhones/iPads - I would have gone back and stayed with SLS.


HTH

Scott

Aug 1, 2011 9:31 AM in response to sbkeith

Thanks. I actually don't want multiple sites, I only tried that because I can't seem to be able to change the default files location for the main one. That's all I want: one web site, but that points to the files where I want to place them. I don't have a host name dedicated to this site, I'm on a residential ISP with dynamic IP addresses but I have a dyndns entry configured so I can hit the web server from outside just fine.


It's just this pesky default location thing that's hanging me up. I have the Mini Server drives striped into a RAID and I do not want data stored on it, I have external data drives for that and I want the web server to use one of them.

Aug 1, 2011 10:48 AM in response to Spinland

@Spinland (and @sbkeith), I've also tried the "solution" to the original post with no luck. I want to continue to host the profile manager etc. But also add one (or more) custom sites. At DynDNS I've set my domain and one subdomain like so...

User uploaded file

Currently they both just resolve to the default web site. Say I want the server.mydomain.com to resolve to the default site and the base domain to resolve to a different custom site, what do I need to do?

Aug 1, 2011 6:15 PM in response to Brian S. Campbell

Brian,


You need to ignore the default web server that's listed in the Server App, and create two new entries representing the two subdomains you have. In the URL box for each enter the specific URL for that subdomain, and point the folder's location to the files you want served for that subdomain. You probably need to add that 00000_whatever file that's mentioned upstream in this thread so the different entries are honored. That worked for me, I registered two domains in the free dyndns service and have them pointed to different volumes in my Mini Server.


Hope that helps!

Mark

Aug 1, 2011 7:01 PM in response to Spinland

Hey Mark,

Thanks for the reply! So, here's what i've got set up. Given that my registered domain name is example.com...


At DynDNS i have an A record for example.com and a CNAME wildcard record that points to my fully qualified domain at example.com. <= trailing dot included


User uploaded file


Ignoring the default website, I've created two more sites:

cameras.example.com points to /Library/Server/Web/Data/Sites/cameras

test.example.com points to /Library/Server/Web/Data/Sites/CustomSitesDefault


User uploaded file


Following the directions above I've also added the 00000_MoreTestingRequired.conf to the /private/etc/apache2/sites directory with the following lines:

NameVirtualHost *:80

NameVirtualHost *:443


Just as an FYI, here's how my DNS looks currently...nothing custom here, this setup was automatic per my setup in Server.app


User uploaded file


I've also started/stopped the web service in the Server app and run sudo apachectl restart from the command line.


After all this...nothing works. Not even the default site comes up. If I kill the two new sites, the default site suddenly works again...any thoughts?

Aug 2, 2011 3:54 AM in response to Brian S. Campbell

I'm not sure what your problems might be, but I can point out a couple of things that are different than mine in hopes one of them is a clue. In the 00000_MoreTestingRequired.conf file I only have:


NameVirtualHost *:80


At dyndns I have two domains registered using the free service, so no wildcards (and I'm not sure what the trailing dot is for). In my router I have the server's internal IP set static and all port 80 stuff forwarded to that IP.


I don't have Lion Server doing anything with DNS, that service is entirely disabled. Only dyndns does my lookups and the Lion Server just points each given incoming URL to the appropriate directory.


I'm mostly stumbling through this process by trial and error; I wish I had more clueful insights to offer but that's how I managed to get it working.


HTH!

Aug 2, 2011 8:06 AM in response to Spinland

Thanks Mark,


I've tried with just NameVirtualHost *:80 and NameVirtualHost *:443 alone. Neither of those seemed to change anything for me. The trailing dot entered in DynDNS is just to indicate a "Fully Qualified Domain Name" or FQDN.


When I originally set up the server, I chose the "Host name for Internet" option. It seems you may have picked either the "Host name for local network" or "Host name for private network". I suppose that might be causing the difference. However, I'm trying to host Address Book and Calender services for MacOS and iOS devices so I figured it made sense. Like you, i'm fumbling my way through this. I went through a similar process setting of SL server. DNS especially can make your life miserable.


Anyway, I may try to start a new thread. This one seems to be loosing traction and I think my setup might be slightly different than others that have posted here.


Thanks for your time!

Aug 2, 2011 9:11 AM in response to Brian S. Campbell

It's not that it's losing traction, just most of us SysAdmins run our own static DNS servers and don't have a lot of experience with DynDNS.


Looking at your DNS config I see a few things that you should change.


Your primary zone should be:


example.com


That's it. Everything after that is just aliases (CNAMES) or extensions of your zone.


You should not have a primary zone of: server.example.com Even though this was setup by LS, delete it.


Server is an alias of your zone.


Under the primary zone of example.com add a CNAME of "server." Also your machine names should all resolve to your primary zone if you're only using one machine, such as an A record for server.example.com pointing to example.com, etc...


Also, in your site setup area, you have two sites setup as test.* and cameras.* of your primary zone. Neither one of those aliases are even listed in your DNS. If a site can't be resolved in your DNS, it will never work. A wildcard (although I have never used DynDNS and I may be wrong here) is not used in DNS.


So just like above, make sure you have two CNAME entries in your DNS under your primary zone of example.com for test and cameras (or whatever they are under the red line).


DNS is a beeyatch.


Also, I am assuming you have a dynamic IP address on your router as this is the reason why you are using DynDNS. For this to even work, your DynDNS settings should point to your router and then your router needs to use NAT and port forwarding for the external services to find your internal server.


And this is another can of worms all in itself. I would check with your service provider and see if they can offer you a static IP address - the extra $ will be worth it in the long run.


Anyone with DynDNS experience that can help Brian out?

Aug 2, 2011 11:21 AM in response to sbkeith

Thanks @sbkeith, your post is very helpful. My router (AEBS) is NATing, has a fixed internal IP (192.168.0.1), and is port forwarding the necessary services (in my case iCal, Web (HTTP/S), Address Book) to my server's fixed internal IP (192.168.0.2). I would definitely prefer to use a static external IP, but it's prohibitively expensive with my ISP 😟


Based on my understanding of your feedback, here are my settings. At DynDNS i have two CNAME aliases pointed to my primary domain...


User uploaded file


Same in DNS settings

User uploaded file


And I added a website for one of the subdomains in Server.app

User uploaded file

Unfortunately, I'm still seeing the same problem. If I only have the default web site, it works great. Any added website kills everything. sudo apachectl -t returns Syntax OK and sudo changeip -checkhostname returns success


If anyone else has any suggestions I'd love to hear them!

Aug 2, 2011 2:51 PM in response to Brian S. Campbell

UPDATE: it seems my main problem was my self-signed certificate. I killed it and disabled everything that would require it and now it seems my sites are working (HTTP only of course). I know almost nothing about certificates so I'm sure I set up some parameters incorrectly when I created it. I should have thought to look at that sooner. Apologize for wasting your time! If anyone has any pointers on getting a certificate set up for web/ical/address book services I'd appreciate it...sorry for leading folks down a rabbit hole 😟

Multiple websites

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