Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

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

How to adapt Apache configuration to OS X Server?

I'm trying to get Server working on a Mac Pro that had been very happily running a number of websites with the built-in Apache installation all the way up to and including 10.8. Sigh. Server has been a complete nightmare in a bunch of areas, but especially with getting the websites working properly. Things are sorta kinda working, but I'm nowhere near where I was before. Maybe someone here can help...


Here's how things are set up:

  • My Apache config files are still in /etc/apache2 -- the main stuff is in httpd.conf, with a number of site definitions in /etc/apache2/other; these get loaded through an include statement in httpd.conf.
  • I've created entries in the Websites section of Server pointing to the sites. I've left the sites' files in /Library/WebServer/Documents where they used to be, and pointed the server entry to those files via the "Store Site Files In:" option. In the cases where the domain name is something like example.com, I've set up the "Domain Name" entry in Server as www.example.com. I've then added "example.com" as an "Additional Domain"


What's happening is that the "www." versions of the sites are getting found and presented, but the basic domain doesn't work -- visiting www.example.com works, but visiting example.com doesn't. In addition, some of the sites have nontrivial (and necessary) stuff in their config files -- redirection and the like -- and it's clear that the things specified there aren't happening.


So, as a first guess, it looks like the config files in /etc/apache2 aren't getting read, or interpreted, or whatever. If this is meant to be a real web server tool, surely there's a way to handle custom Apache configurations. Does this may sense to anyone? Are there any clues out there? To my eye, getting this stuff working should have been trivial, and it's been nothing but a nightmare.

Mac Pro, OS X Mountain Lion, plus Server

Posted on Oct 4, 2012 9:16 AM

Reply
4 replies

Oct 4, 2012 1:12 PM in response to Jim Miller2

A couple thoughts --


- You have the aliasing reversed. Put "domain.org" in the main configuration and "www.domain.org" in the alias.


- Test your DNS that there are forward and reverse working for doman.org and www.domain.org


- Are you sure that Apache is reading the extra configs? Note that the master config file used is not the one in /etc/apache2/.


- Is there a reason you are not entering the redirects in Server.app?

Oct 4, 2012 2:02 PM in response to JaimeMagiera

Hi -- thanks for pitching in!


* I tried reversing the naming as you suggested, and got a message saying "Use example.com for this website's domain name? If you use example.com, you may not be able to access this website. Try making changes to the Server Website instead." I forced it through with the "Use millerclan.com" button, and, sure enough, neither example.com nor www.example.com worked.


* I thought of the DNS matter, but it's OK.


* I just now found the ReadMe file in /Library/Server/Web/Config/apache2, which I guess is where the new config files lie. Arggh. So far, doing a link of one of my sites' config files is working; I'll explore that some more.


* I haven't explored Server's approach to redirects; my hope was that I'd be able to just have Server load my config files, and all would be well.


I dunno about this whole thing -- I had thought that Server would be the right thing for me (I'm mostly running a few personal and work-related websites and some mail accounts off the Mac Pro), but I'm reconsidering it. I may not have my head wrapped appropriately around this yet, but, as somebody who at least thinks he has a pretty good understanding of unix/linux sysadmin and server configuration, Server has given me nothing but headaches. So far, anyway.

Oct 4, 2012 2:21 PM in response to Jim Miller2

* That's interesting. Must be a recent thing to Server.app. In server admin, it was the way to go.

* And you have an A/Machine record for "millerclan.com"?

* I would compare the way the redirects getting written by Server.app and what you had previously to see what the difference is.


Well, I think the thing that changed in Server recently is that Apple is really trying to gear things towards people who don't have an IT department and want to set up a basic server. Lion Server was a big departure. ML Server, in particular 10.8.2, started to incorporate more nuanced configuration of services and migration to allow for more of what you were expecting.


I wouldn't give up. Just keep posting questions about the problems you run into.

Oct 4, 2012 4:21 PM in response to Jim Miller2

Hi Jim,

I've had similar problems with OS X server but have gradually overcome them all, through working out the 'intent' of the developers. My main reason for installing OS X server was to take things back in house after one of my commercial sites got hacked. With a very Apple-centric household, I thought it would make life easier with tools like Profile Manager.


If you we're to ask me my reasons now, I would probably say its that I refuse to be beaten as I have spent so much time getting it right.


The good news from your point of view is that there are loads of people like me within the forums who can help with whatever ails you!


My config is as follows:

OS X standard Apache and Postgres

PHP 5.4 with additional modules for imap integrated with OS X Apache but never to be clobbered by OS X upgrades.

MySQL via homebrew.


Running on OS X server.

Domain1.com - OS X wiki server

- Roundcube Webmail installed as a webapp with MD5 auth ( can be attached to any website domain this way)

- Webapp for Reverse proxy to an Ubuntu Server instance running under Parallels VM on same machine (different IP address) providing UPS monitoring and shutdown of all machines on network through NUT and SNMP monitoring via Cacti. My particular UPS's (Powerware 5110 x 2) USB driver not working under OS X power management nor NUT under OS X.

- 2 minecraft servers for my son and his mates!



Domain1.com.au - commercial site running Drupal CMS / Postgres

Crm.domain1.com.au - SugarCRM CE 6.5 / MySQL integrated with OS X mail and calendar server.

Web mail via webapp


Domain2.com.au - commercial site - HTML

Webmail via webapp


Why not list what you are trying to do and what's not working and we can try to sort it out.


Cheers

Gerry

How to adapt Apache configuration to OS X Server?

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