To restart common web services like Apache, Nginx, and MySQL, you typically use systemctl (on most modern Linux systems):
Apache (httpd on CentOS, apache2 on Ubuntu)
# Ubuntu/Debian
sudo systemctl restart apache2
# CentOS/RHEL
sudo systemctl restart httpd
Nginx
sudo systemctl restart nginx
MySQL (or MariaDB)
# MySQL
sudo systemctl restart mysql          # Ubuntu/Debian
sudo systemctl restart mysqld         # CentOS/RHEL
# MariaDB
sudo systemctl restart mariadb
Check status (optional but recommended)
sudo systemctl status apache2Â Â Â Â Â Â Â Â Â Â Â Â Â # Or httpd/nginx/mysql/mysqld/mariadb
