8 Replies Latest reply: Sep 4, 2013 9:28 AM by AlanNYC
AlanNYC Level 4 Level 4 (1,575 points)

Hi!

 

I had been running Apache on my MBP with 10.8 sans OS X Server.

But I sprung the $20 for OS X Server 2.2.1 recently. I see that Server's Apache mostly lives in /Library/Server/Web/ , and is supposed to use Config/apache2/httpd_server_app.conf instead of the old /etc/apache2/httpd.conf .

 

Yet when I toggle apache in the OS X Server.app, it's reading config from that old httpd.conf .

 

What do I want to change to make sure Server.app is starting up its own version and configuration of httpd?

(I don't have any existing configuration that I need to migrate; I just want to start with a clean version of OS X Server. That will be a lot easier for me to handle across my multiple environments and (hopefully) a new CPU in the near future ;-)

 

 

(Looks like this post was curious about the same thing, but he got no love)


MacBook Pro, OS X Server, 10.8
  • 1. Re: OS X Server's Apache uses the old httpd.conf
    Linc Davis Level 10 Level 10 (117,920 points)

    Yet when I toggle apache in the OS X Server.app, it's reading config from that old httpd.conf .

     

    How do you know that?

  • 2. Re: OS X Server's Apache uses the old httpd.conf
    AlanNYC Level 4 Level 4 (1,575 points)

    That's a good question.

    I infer it by browsing to http://localhost/. The page that comes up is in the doc root specified in /etc/apache2/httpd.conf /Library/WebServer/Documents/index.html.en . (And similarly I can browse to other files I place in that directory). And then if I edit that conf file and restart Apache, the changes are apparent.

     

    Is there something in a log that would help me directly determine that? Where is Server.app configured?

  • 3. Re: OS X Server's Apache uses the old httpd.conf
    Linc Davis Level 10 Level 10 (117,920 points)

    What do you get from this:

    sudo launchctl list org.apache.httpd
    
  • 4. Re: OS X Server's Apache uses the old httpd.conf
    AlanNYC Level 4 Level 4 (1,575 points)

    What should I expect?

    {
         "Label" = "org.apache.httpd";
         "LimitLoadToSessionType" = "System";
         "OnDemand" = false;
         "LastExitStatus" = 0;
         "PID" = 54408;
         "TimeOut" = 30;
         "ProgramArguments" = (
              "/usr/sbin/httpd";
              "-D";
              "FOREGROUND";
              "-D";
              "WEBSERVICE_ON";
         );
    };
    
  • 5. Re: OS X Server's Apache uses the old httpd.conf
    Linc Davis Level 10 Level 10 (117,920 points)

    That's wrong. Did you start the web server from Server.app or in some other way?

  • 6. Re: OS X Server's Apache uses the old httpd.conf
    AlanNYC Level 4 Level 4 (1,575 points)

    Man, that was a helpful nudge; thanks Linc.

     

    At some point in the past I set up Apache to come up automatically. I was about to type "I can't remember which recipe I would have followed", but seems I did it this time by installing Web Sharing.prefPane .

     

    Now I've toggled Apache off (in both Server.app and that prefPane. I removed the prefPane.

    But I still get the same result from launchctl.

     

    What should I see in launchctl?

    Any thoughts on where I should look next?

  • 7. Re: OS X Server's Apache uses the old httpd.conf
    AlanNYC Level 4 Level 4 (1,575 points)

    I got it here: http://clickontyler.com/blog/2012/02/web-sharing-mountain-lion/

    There's an executable in the package, but I don't know how to figure out what it's doing. Nothing helpful in any of the other package contents that I can see. But that's just me.

  • 8. Re: OS X Server's Apache uses the old httpd.conf
    AlanNYC Level 4 Level 4 (1,575 points)

    This thread was helpful for prescribing a brute force method.

    With all Server's services stopped and  the app closed, I deleted /var/db/.ServerSetupDone and /Library/Preferences/com.apple.servermgr* .

     

    Server.app then launches into its guided setup mode, and that has Apache apparently back in its vanilla state and reading from confs at /Library/Server/Web/Config/apache2/ .

    In particular, launchctl returns:

    {
         "Label" = "org.apache.httpd";
         "LimitLoadToSessionType" = "System";
         "OnDemand" = false;
         "LastExitStatus" = 0;
         "PID" = 25;
         "TimeOut" = 30;
         "ProgramArguments" = (
              "/usr/sbin/httpd";
              "-D";
              "FOREGROUND";
              "-f";
              "/Library/Server/Web/Config/apache2/httpd_server_app.conf";
              "-D";
              "WEBSERVICE_ON";
         );
    };
    

    and browsing to localhost loads the expected content (i.e., the files I have at /Library/Server/Web/Data/Sites/Default).

     

    So that was brute force, and I'd like to know how to manipulate Server.app a little more precisely, but it's mostly academic.