Benches macOS

9

apachectl stop not working

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I tried to type in command "sudo apachectl stop" , but when I go to localhost, it still shows "It works!". How do I stop it?

I am running macOS Mojave 10.14

9 replies

Sign in or join Beachball Help to reply.

  1. 0

    Luis Sequeira1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I just tried it here, and it is working as expected:

    After

    sudo apachectl stop

    I cannot reach the server at localhost.

    I then do

    sudo apachectl start

    and it shows "It Works!"

    Did you get any error message after doing the sudo apachectl stop ?

  2. 0

    Villyam

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    No nothing. The thing is I started getting this problem after following an article on installing php. It told me to type in

    ”sudo su -” for root provileges or somwthing . Then I did apachectl start. Since I was new to root and all, I closed the terminal window without doing apachectl stop. Does this have anything to do with my problem ?

    Note : I did try to do sudo su - again and then stop, but it did not work

  3. 0

    Luis Sequeira1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    "No nothing. The thing is I started getting this problem after following an article on installing php. It told me to type in

    ”sudo su -” for root provileges or somwthing . Then I did apachectl start. Since I was new to root and all, I closed the terminal window without doing apachectl stop. Does this have anything to do with my problem ?"

    I don't think so, but if you haven't already, try restarting your mac, then see if the commands work.

  4. 0

    Saintsb

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Did you try to refresh your computer?

    Can you disclose the article on installing php?

  5. 0

    Villyam

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I did not try refreshing my computer but I did restart it. I even updated it, thinking it might be a software problem. Here is the article.

    install-apache-php-mysql-mac-os-x-mojave

    Here I did all he asked me to do until I reached vi http.conf. I did not know how to exit the vi command as I am not familiar with it and I use nano command for editing texts via terminal. So I just terminated the process by quitting terminal.

    What did you mean by refreshing my computer?

  6. 0

    Luis Sequeira1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    "What did you mean by refreshing my computer?"

    Restart?

  7. 0

    Villyam

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Yes I did.

  8. 0

    Luis Sequeira1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    "Here I did all he asked me to do until I reached vi http.conf. I did not know how to exit the vi command as I am not familiar with it and I use nano command for editing texts via terminal. So I just terminated the process by quitting terminal."

    Did you save the file? Did you actually confirm that php is running?

    There is a chance that you did something wrong when editing the httpd.conf file.

    The fact that you are unfamiliar with vi suggests to me that is a strong possibility.

    If you are familiar with nano, you can use that instead. The instructions do not depend on the editor.

    "Uncomment this line" just means removing the # character, and that can be done with any ASCII editor.

    So here is what I suggest:

    1) Restore the original httpd.conf file, which was set aside if you followed the instructions in the article, with the name

    httpd.conf.mojave (if you used a different name, substitute it below as appropriate)

    cd /etc/apache2

    sudo rm httpd.conf

    sudo mv httpd.conf.mojave httpd.conf

    2) Restart your mac, and then confirm that

    sudo apachectl stop

    works

    3) Redo the changes in the article carefully. Use nano since you are familiar with it.

  9. 0

    Villyam

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Apparently it was something in the file causing the problems. Thank you!!