Home / VPS & Dedicated / How to restart Apache in Mac OS X Server

How to restart Apache in Mac OS X Server

Apache Software Foundation LogoQuestion: How do I restart Apache HTTP Server on a Mac OS X server?

Answer: Linux other Unix-based servers, you can start and stop Apache from the command line. If you are familiar with Redhat-based systems, then you are used to logging in and then using “su” to become Root. Mac OS Xrelies on “sudo” like many Debian-based systems (such as Ubuntu).

The command for Apache in Mac OS X is “apachectl” (Apache control). To restart Apache, type the following:

$ sudo apachectl restart

To stop Apache, enter:

$ sudo apachectl -k stop

And to start Apache again, type:

$ sudo apachectl -k start

After entering a command with “sudo” you will be prompted for your password. Enter it and continue. You will still need to use “sudo” for each command run as Root, but it will not ask you for the password again until you have stopped using it for a period of time in that session.

Source: nixCraft

Check Also

servers

Importance of web hosting to business

The world of business is very ruthless and unfair in some cases. It is a …