How To Start, Stop, and Restart Apache and MySQL on Arch Linux
Most system admins keep servers pretty slim with no Graphical User Interface (GUI). We will stick with the basics and use a few commands to start, stop, and restart Apache as well as some related services on Arch Linux.
Arch uses a BSD-Sytle initialization program for starting and stopping daemons. So if you want restart a process the script is usually stored in /etc/rc.d/ directory.
Here you can see on an almost bare bones system some of the scripts. (Example: httpd, networking, sshd..etc)
You call the script as well as the action.
Note: You will need to have root privileges or being login with a user that has sudo access.
To Restart Apache in Arch Linux issue the following command:
You could also use
To Stop Apache
To Start Apache
Today a lot of sites use a MySQL database for the backend. There are time you may need to also start, stop, and restart MySQL. Once again this is a very simple task in Arch using a single command.
To Restart MySQL
To Stop MySQL
To Start MySQL
If you would like to have the services auto start when you start your server. Edit /etc/rc.conf
(Use a text editor your choice. Nano is a really easy one)
Scroll down to the bottom
Add mysqld and httpd in the daemon section.
Save your changes and reboot your system to test it out.
Hope you found this helpful!