Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8261411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:23:55+00:00 2026-06-08T03:23:55+00:00

I recently upgraded my Mac’s OS from Lion to Lion Server, which changes how

  • 0

I recently upgraded my Mac’s OS from Lion to Lion Server, which changes how the httpd.conf settings are read when Apache is started. In particular, environment variables like WEBSHARING_ON and MACOSXSERVER are set by the Server.app process, so that extra modules and files are read in when Apache is started.

So now, to restart the Apache server with all the proper settings and modules loaded, I have to use the command:-

sudo serveradmin stop web && sudo serveradmin start web

Previously, I would run:-

sudo apachectl -S
sudo apachectl graceful

I prefer the latter method by far. For one thing, the command returns much quicker, and I also imagine that the apache / httpd server process doesn’t completely terminate, just the settings are reloaded.

So, is there a way to gracefully restart Apache in Lion Server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:23:56+00:00Added an answer on June 8, 2026 at 3:23 am

    The quick answer is no.
    The ‘apachectl’ program is actually just a shell script, so (after realising this) it’s easy to see what it’s doing, and why it’s not doing what I expected.

    When restarting Apache (gracefully or otherwise) on a Mac, the relevant launchctl job is just unloaded and reloaded, which I imagine is not as per the official Apache description of a graceful restart:

    The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they’re not serving anything)

    The reason apachectl -S doesn’t show the configured virtual servers is because this command is not run by launchctl, and so the environment variables set in /System/Library/LaunchDaemons/org.apache.httpd.plist are not loaded.

    So, apachectl graceful, apachectl restart and others do load the proper variables, and therefore read the config files properly, but not all commands do by default.

    To overcome this, I’ve manually edited /usr/sbin/apachectl, as below. All I did was add “-D MACOSXSERVER -D WEBSERVICE_ON” where appropriate.

    case $ARGV in
    start)
        run_launchctl load -w $LAUNCHD_JOB
        ERROR=$?
        ;;
    stop|graceful-stop)
        run_launchctl unload -w $LAUNCHD_JOB
        ERROR=$?
        ;;
    restart|graceful)
        run_launchctl unload -w $LAUNCHD_JOB 2> /dev/null
        run_launchctl load -w $LAUNCHD_JOB
        ERROR=$?
        ;;
    startssl|sslstart|start-SSL)
        echo The startssl option is no longer supported.
        echo Please edit httpd.conf to include the SSL configuration settings
        echo and then use "apachectl start".
        ERROR=2
        ;;
    configtest)
        $HTTPD -t -D MACOSXSERVER -D WEBSERVICE_ON
        ERROR=$?
        ;;
    status|fullstatus)
        echo Go to $STATUSURL in the web browser of your choice.
        echo Note that mod_status must be enabled for this to work.
        ;;
    *)
        $HTTPD $ARGV -D MACOSXSERVER -D WEBSERVICE_ON
        ERROR=$?
    esac
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We recently upgraded a server from PHP4 to PHP5.4 There is an application running
I recently upgraded to eclipse indigo from galileo. There has been some changes in
I recently upgraded my server running CentOS 5.0 to a quad-core CPU from a
I recently upgraded to Mac OS X 10.7 from 10.6. I decided to use
I recently upgraded to Lion and I am trying to install Rails. I used
I recently upgraded from jQuery 1.2.6 to 1.3.2 Now on the page I'm using
I recently upgraded my machine from Leopard to Snow Leopard. Also I installed the
I recently upgraded my Google App Engine launcher on my Mac, running OSX 10.5.8,
I recently upgraded my SVN client from 1.6.9 to 1.7.2 and after converting to
I recently upgraded my project from Xcode 4.0.1 to Xcode 4.2 - and everything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.