How do I start or stop Apache/Apache 2 web server using a shell prompt option under Apple OS X (macos) UNIX operating systems?
The apachectl command act as Apache HTTP Server control interface. When you edit the Apache config file /etc/apache2/httpd.conf, you need to reload or restart the web server. Open the terminal application and type the following commands:
To stop Apache web server, enter:
sudo apachectl stop
ORsudo apachectl -k stop
To start Apache web server again, enter:
sudo apachectl start
ORsudo apachectl -k start
To restart apache web server, enter:
sudo apachectl restart
ORsudo apachectl -k restart
To run a configuration file syntax test
sudo apachectl configtest
To reload apache web server after editing the config file
First edit the config file, run:$ sudo vi /etc/apache2/httpd.conf
Make changes as per your needs. Close and save the file. To reload new changes, run:sudo apachectl graceful
ORsudo apachectl -k graceful
You can displays a brief status report by visiting the url http://localhost:80/server-status in the web browser of your choice.
Comments
Post a Comment