Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

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

Lion Server and Virtual Hosts

I think most people are aware that with 10.7 Apple inexplicably killed Web Service administration within Server Admin, and put it into the new Server application. That would be great if they didn't severely cripple the formerly-available features, and also make it a roll of the dice whether command-line changes are recognized/preserved.


WIth 10.7.2 they improved the virtual host problem, but there are still problems. I had an issue adding port 443 (https) web sites. They would simply not work. However, if you re-selected the certificate, the server script would apply it through all the 443 sites, which would then work. However, I found that the script also switched ALL my sites to port 443. I had to go through and change them all with the Server app. The good news is they all worked then.


Even after the 10.7.2 update, I still had some difficulty getting the sites to work. I decided to set the web service back to default using the following command which will restore the factory defaults:


sudo /System/Library/PrivateFrameworks/ServerFoundation.framework/Resources/xswebcon fig restorefactorysettings


I would recomend if you are having problems getting your virtual hosts working, try the following sequence:


- Add all your port 443 sites.

- Re-select the certificate.

- Add all your port 80 sites.

- Make any changes, such as logfile destinations, in /etc/apache2/sites/<0000...your site.conf>

- Stop and start the web service from the Server app.

Posted on Oct 16, 2011 1:14 PM

Reply
5 replies

Oct 19, 2011 10:25 PM in response to joyacv2

Hi,


I found a very simple solution without modifying httpd.conf.


The only file that you have to modify is hosts in the etc folder (/privacy/etc)


Add the following in a new line


127.0.0.1 www.yoursite.com


Then goto web in the server app, add the a new website with the + sign. Write www.yoursite.com, any in the ip and select a folder, for me only worked with a folder inside library/server/web/data/sites/yourfolder


inside of "yourfolder" put a file default.html


It's really works! Try it!


No other problem occur, no "error reading settings"


You can add many site repeating this procedure!

Aug 19, 2013 10:27 AM in response to Jyri Palm

I just had the same thing happen on 10.8.4.


Server App overwrote all of my virtual port 80 domains with 443 versions.


I had several clients call me to tell me their sites were down and after hupping the daemon and rebooting I realized that the server wasn't responding on port 80 for any of our sites because they were all overwritten with 443 versions. No changes have been made to the server in months.


My situation:

OS 10.8.4

server mac mini server 8GB RAM, 2ghz intel core i7


1. My self assigned certificates are or were expiring.

Hard to tell since I renewed it a month or so ago, but still receive daily errors from the machine saying they need to be renewed.


2. I was looking at server app to see if i had any other certificates expiring. I DID NOT make any changes to certificates, or server app, or apache, I did not renew any certificates


I'd like to note, if any Apple folks see this, that in addition to overwriting all of my port 80 sites to 443 there are several other issues with the apache portion of server app:


1. you can not correctly write custom errors to the .conf file. It only writes for 403, you have to manually add 404 and 500


2. you cannot use any redirect to a php file or perl file for example for error handling, it only let's you type .html files into the server app interface


3. if you manually enter your conf files, which i do because the server app is broken and I need custom error handling, then when you save ANY site, all virtual sites get redundant error lines written over and over, sometimes hundreds or even thousands of times. I've seen apache conf files grow to be several megs with the redundant lines.


4. I've also noticed that the http daemon has stuck process extremely frequently. I've never seen this in any verson of OS X server since 10.1, I've used them all. But in 10.8 I see runaway apache processes every day that take up 100% of cpu and run forever until you manuall kill -9 them.


Thankfully I had backed up the "sites" directory previously and was able to recover fairly quickly and gracefully.

Aug 19, 2013 2:57 PM in response to Jyri Palm

I've done further confirmation through researching various log files and I find in WebConfig.log where it takes all of the 0000_any_80_ files and rewrites them all to 0000_any_443_ files.


Clearly I couldn't have done this because the server app only allows you to edit one site at a time but I see in this log where it rewrites them all to 443.


So they question is how do we track how and why this happened, but there is also no indication in the log of what user or what command executed to make this happen.

Lion Server and Virtual Hosts

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