Service Management Commands
This page covers services installed by aaPanel. Same-named services installed with apt, yum, or dnf may conflict with them.
Run the commands as root. Check the service status and logs before restarting or changing configuration.
Quick diagnosis
| Symptom | Check first |
|---|---|
| Panel itself is unreachable | See Panel health check. |
| Service is not running | Run its status command, then read the error log. |
| A port is already in use | Find the process using the port before restarting. See Nginx port conflict. |
| A configuration change causes an error | Run the configuration test before reloading or restarting. |
| Service stops again after a restart | Read the error log, then check disk space, permissions, and the configuration file. |
Nginx Service
Nginx, OpenResty, and Tengine installed from aaPanel use the following paths and commands.
| Item | Path or command |
|---|---|
| Website configuration directory | /www/server/panel/vhost/nginx |
| Main configuration directory | /www/server/nginx/conf/ |
| Main configuration file | /www/server/nginx/conf/nginx.conf |
| Program directory | /www/server/nginx |
| Start command | /etc/init.d/nginx start |
| Stop command | /etc/init.d/nginx stop |
| Reload command | /etc/init.d/nginx reload |
| Restart command | /etc/init.d/nginx restart |
| Status command | /etc/init.d/nginx status |
| Configuration test | /etc/init.d/nginx configtest |
| Access log | /www/wwwlogs/access.log |
| Error log | /www/wwwlogs/nginx_error.log |
Nginx logs
tail -n 100 /www/wwwlogs/nginx_error.logNginx Problems and Solutions
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Log in over SSH as
rootand find the process using port 80:bashnetstat -tulnp | grep -w 80 ps aux | grep nginx
To inspect a specific process ID, run
ps aux | grep <PID>.Check the process path. The Nginx installed by aaPanel is
/www/server/nginx/sbin/nginx.If the path is
/usr/sbin/nginx, Nginx was installed as a system package:bashsystemctl stop nginx systemctl disable nginx

Start the Nginx installed by aaPanel:
bash/etc/init.d/nginx start
/www/server/panel/webserver/sbin/webserverbelongs to aaPanel and is not a website Nginx process. Ignore it when troubleshooting port 80.
MySQL / MariaDB Service
| Item | Path or command |
|---|---|
| Data directory | /www/server/data |
| MySQL program directory | /www/server/mysql |
| Configuration file | /etc/my.cnf |
| Start command | /etc/init.d/mysqld start |
| Stop command | /etc/init.d/mysqld stop |
| Restart command | /etc/init.d/mysqld restart |
| Reload command | /etc/init.d/mysqld reload |
| Status command | /etc/init.d/mysqld status |
| Error log | /www/server/data/*.err |
Do not install MySQL or MariaDB with
apt,yum, ordnf. Use the version installed by aaPanel to avoid database and socket conflicts.
View MySQL error log
Open
Databases>MySQL, clickMySQL <version>at the top of the page, then selectError log.
Over SSH, view the latest errors:
bashgrep -i -C 10 error /www/server/data/*.err | tail -n 200
If you changed the MySQL data directory, replace /www/server/data with the actual path in both commands.
Use tail instead of cat for a log that is still being written.
Quick check
Run this command as root:
curl -k https://www.aapanel.com/script/mysql_check.sh | bashThe script checks the installation source, process state, version, data directory, and port. If MySQL is not running, it prints the error log. It does not repair MySQL or modify data.
Common MySQL issues
| Symptom | Check |
|---|---|
| MySQL does not start | Run /etc/init.d/mysqld status, read the error log, and check disk space, data-directory permissions, and /etc/my.cnf. See MySQL startup failure. |
2002 or 2003: Cannot connect | Confirm that MySQL is running, then check the socket, host, and port used by the site. See Cannot connect to MySQL. |
1049: Unknown database | Confirm the database name and letter case, then restore the database if it no longer exists. See Unknown database. |
| InnoDB storage engine damage | Stop database writes, take a snapshot or back up the data directory, then follow the InnoDB recovery guide. |
For other database issues, see Databases Related.
PHP
PHP versions use two digits in service names. PHP 8.2 is 82; replace it with the version used by your site.
| Item | Path or command |
|---|---|
| Main configuration directory | /www/server/php/82/etc/ |
| Program directory | /www/server/php/82/ |
| Start command | /etc/init.d/php-fpm-82 start |
| Stop command | /etc/init.d/php-fpm-82 stop |
| Reload command | /etc/init.d/php-fpm-82 reload |
| Restart command | /etc/init.d/php-fpm-82 restart |
| Status command | /etc/init.d/php-fpm-82 status |
| Configuration test | /etc/init.d/php-fpm-82 configtest |
| Error log | /www/server/php/82/var/log/php-fpm.log |
Do not install PHP with
apt,yum, ordnf. Use the PHP version installed by aaPanel.
PHP logs
tail -n 100 /www/server/php/82/var/log/php-fpm.logTo confirm which PHP version a site uses, open the site in aaPanel and check its PHP version setting.
PHP Problems and Solutions
PHP-FPM socket already in use
failed to activate: unable to bind listening socket for address '/tmp/php-cgi-84.sock': Address already in use (98)

- Open
Filesand go to/tmp/. - Find
php-cgi-84.sockand replace84with the PHP version in the error message. - Confirm that no healthy PHP-FPM process is using the socket, then delete it.
- Restart PHP-FPM for that version.

Install PHP extensions
Open
App Store>Installed>PHP <version>and install common extensions from the extension list.
If an extension is not listed, compile and install it.
ionCube example
Download the loader for your operating-system architecture from ionCube Loaders.
Extract the package and find the loader for your PHP version, for example
ioncube_loader_lin_8.3.so.Place it in
/usr/local/ioncube/.Add the loader to the PHP configuration file and restart PHP:
inizend_extension = /usr/local/ioncube/ioncube_loader_lin_8.3.so
tidy example
The following example installs the tidy extension for PHP 7.4. Replace php_version=74 with your PHP version.
Install the system libraries.
CentOS:
bashdnf install libtidy libtidy-develUbuntu or Debian:
bashapt install libtidy-devDownload and extract the extension source:
bashwget https://pecl.php.net/get/tidy-1.2.tgz tar xvf tidy-1.2.tgz cd tidy-1.2Compile and install it:
bashphp_version=74 /www/server/php/${php_version}/bin/phpize ./configure --with-php-config=/www/server/php/${php_version}/bin/php-config make make install extFile="tidy.so" echo "extension = ${extFile}" >> /www/server/php/${php_version}/etc/php.ini echo "extension = ${extFile}" >> /www/server/php/${php_version}/etc/php-cli.ini /etc/init.d/php-fpm-${php_version} reload
fileinfo
Install
fileinfofromApp Store>Installed>PHP <version>.
If the extension is installed but is still reported as missing, the PHP build may have been compiled with
--disable-fileinfoto reduce memory use.Take a snapshot first, then rebuild the PHP version with
fileinfoenabled. Replace8.2with the version used by the site:bashwget -O php.sh https://node.aapanel.com/install/0/php.sh sed -i 's/--disable-fileinfo/--enable-fileinfo/g' php.sh bash php.sh install 8.2
Enable shell_exec or putenv
These functions are disabled by default for security. Enable them only when the application requires them and you trust its code.
- Open
App Store>Installed>PHP <version>>Disabled functions. - Remove
shell_execorputenv, save the change, and restart PHP. - Alternatively, remove the function from
disable_functionsinphp.iniand restart PHP.
Redis
| Item | Path or command |
|---|---|
| Configuration file | /www/server/redis/redis.conf |
| Program directory | /www/server/redis |
| Start command | /etc/init.d/redis start |
| Stop command | /etc/init.d/redis stop |
| Reload command | /etc/init.d/redis reload |
| Restart command | /etc/init.d/redis restart |
| Status command | /etc/init.d/redis status |
| Log file | /www/server/redis/redis.log |
Redis logs
tail -n 100 /www/server/redis/redis.logApache
| Item | Path or command |
|---|---|
| Website configuration directory | /www/server/panel/vhost/apache |
| Main configuration directory | /www/server/apache/conf/ |
| Program directory | /www/server/apache |
| Start command | /etc/init.d/httpd start |
| Stop command | /etc/init.d/httpd stop |
| Reload command | /etc/init.d/httpd reload |
| Restart command | /etc/init.d/httpd restart |
| Status command | /etc/init.d/httpd status |
| Configuration test | /etc/init.d/httpd configtest |
| Access log | /www/wwwlogs/access_log |
| Error log | /www/wwwlogs/error_log |
Apache logs
tail -n 100 /www/wwwlogs/error_logOpenLiteSpeed
OpenLiteSpeed uses lsphp by default, not PHP-FPM.
| Item | Path or command |
|---|---|
| Website configuration directory | /www/server/panel/vhost/openlitespeed |
| Main configuration directory | /usr/local/lsws/conf/ |
| Program directory | /usr/local/lsws |
| Start command | /usr/local/lsws/bin/lswsctrl start |
| Stop command | /usr/local/lsws/bin/lswsctrl stop |
| Reload command | /usr/local/lsws/bin/lswsctrl reload |
| Restart command | /usr/local/lsws/bin/lswsctrl restart |
| Status command | /usr/local/lsws/bin/lswsctrl status |
| Access log | /usr/local/lsws/logs/access.log |
| Error log | /usr/local/lsws/logs/error.log |
OpenLiteSpeed logs
tail -n 100 /usr/local/lsws/logs/error.loglsphp
lsphp is the PHP package used by OpenLiteSpeed. It has no separate PHP-FPM service; OpenLiteSpeed starts its LSAPI workers.
The following example uses PHP 7.4. Replace 74 with 73, 80, 81, 82, and so on for other versions.
| Item | Path |
|---|---|
| Program directory | /usr/local/lsws/lsphp74/ |
| Main configuration directory | /usr/local/lsws/lsphp74/etc/ |
| PHP binary | /usr/local/lsws/lsphp74/bin/php |
To apply configuration changes, restart OpenLiteSpeed:
/usr/local/lsws/bin/lswsctrl restartCommon mistakes
| Mistake | Better approach |
|---|---|
Using cat to read a log that is still growing | Use tail -n 100 <log-file>. |
| Restarting repeatedly without checking the cause | Run the status command and read the error log first. |
| Mixing a system service with the aaPanel service | Stop the system service and install the aaPanel version. |
| Deleting data or log files while troubleshooting | Take a snapshot or back up the data first. Do not delete the MySQL data directory. |
Feedback or Suggestions
If you encounter problems or suggestions during use, please contact us through the following methods:
- (Please describe in
detailor providescreenshots)
Email: [email protected]
Discord: https://discord.gg/Tya5yceBpd
Telegram: https://aapanel.com/tg
GitHub: https://github.com/aapanel/aapanel
If you like aaPanel, please give it a Star