Skip to content

Service Management Commands

aaPanel can only manage programs installed from aaPanel. If it is installed using apt or yum/dnf commands, it cannot be managed.

If you encounter a problem, Can first check the logs of the relevant programs, troubleshoot the problem based on the logs, or provide us with log feedback.

Nginx Service

Nginx, openresty, tengine

Website configuration directory :/www/server/panel/vhost/nginx

Main configuration directory :/www/server/nginx/conf/

Main configuration file : /www/server/nginx/conf/nginx.conf

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

View status command : /etc/init.d/nginx status

Configure test command : /etc/init.d/nginx configtest

Nginx program directory : /www/server/nginx

Log file : /www/wwwlogs/access.log

Error log file : /www/wwwlogs/nginx_error.log

  • Tip: If installed Nginx from apt or yum/dnf command, please stop it first systemctl stop nginx, and prohibit booting systemctl disable nginx, then use aaPanel to install

Nginx Problems and Solutions

  • nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

    alt text

Solution:

  1. Use a terminal or SSH tool to log in to the server and use root privileges.

  2. implement netstat -tulnp|grep -w 80 Command to view the program occupying the port. You can see that the process ID: 1085797 program name: nginx alt text

    The Nginx path installed by aaPanel is: /www/server/nginx/sbin/nginx

    Tip: /www/server/panel/webserver/sbin/webserver is a built-in nginx of the panel. Please ignore it.

  3. Check the specific path based on the process ID or program name you displayed. ps aux|grep nginx or ps aux|grep 1085797

  4. If the path shown in the figure below is: /usr/sbin/nginx, it means nginx is installed by apt or yum/dnf

  5. need to stop systemctl stop nginx, and prohibit booting systemctl disable nginxalt textalt text

  6. Finally start Nginx installed in aaPanel:/etc/init.d/nginx start

MySQL / MariaDB Service

Data storage 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

View status command : /etc/init.d/mysqld status

Log file : cat /www/server/data/*.err|grep -i -C 10 error

MySQL or MariaDB Problems and Solutions

Sorry, we are still working on it, please first refer to the FAQ Databases Related

PHP

Panel PHP is installed by default in/www/server/php/version

Here we take php8.2 as an example: Please replace 82 according to your version. Note that there is no .dot symbol in the middle.

Main configuration directory :/www/server/php/82/etc/

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

View status command : /etc/init.d/php-fpm-82 status

Configure test command : /etc/init.d/php-fpm-82 configtest

PHP program directory : /www/server/php/82/

Log file : /www/server/php/82/var/log/php-fpm.log

PHP Problems and Solutions

  • failed to activate: /tmp/php-cgi-84.sock': Address already in use alt text

    Solution:

    exist File Interface: Go to /tmp/ and find the php-cgi-84.sock file (replace it with your PHP version here), click Delete, and finally restart the PHP service.

    alt text


  • Install PHP extension

    1. Some common PHP extensions provided by aaPanel may be installed by: alt text
    2. If not found, try to compile and install using the command
    • Reference 1 : PHP8.3 installation of ionCube:

      1. Download the files related to your operating system architecture from the official website, https://www.ioncube.com/loaders.php

      2. Unzip the file and find the so file of the corresponding php version, such as: ioncube_loader_lin_8.3.so

      3. Place it in /usr/local/ioncube/ and then add the configuration content to the corresponding php version configuration file.

      4. Such as the so file of php8.3: /usr/local/ioncube/ioncube_loader_lin_8.3.so

      5. Add the configuration file, restart the PHP service, and check whether it is correct:

        zend_extension = /usr/local/ioncube/ioncube_loader_lin_8.3.so

        alt text

    • Reference 2 : Manually compile and install tidy extension for php7.4:

      1. Install dependencies first Centos: sudo dnf install libtidy libtidy-devel

        Ubuntu/Debian: sudo apt install libtidy-dev

      2. Download tidy expansion file

        https://pecl.php.net/get/tidy-1.2.tgz
        tar xvf tidy-1.2.tgz
        cd tidy-1.2
      3. Modify to the php version you need to install

        php_version=74
      4. Compile and install extension

        /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 -e "extension = " ${extFile} >> /www/server/php/${php_version}/etc/php.ini
        echo -e "extension = " ${extFile} >> /www/server/php/${php_version}/etc/php-cli.ini
        /etc/init.d/php-fpm-${php_version} reload
  • Install the extension fileinfo in App Store --> Installed --> PHP-Versionalt text

  • After installing fileinfo, it still prompts that the fileinfo extension does not exist.

To take care of the installation of machines with small memory, aapanel uses the disabled fileinfo parameter by default.

You can use the ssh tool to log in to the server, and use root permissions to execute the command to install PHP. PHP with fileinfo turned on by default

  1. Download the php compilation and installation script wget -O php.sh http://node.aapanel.com/install/0/php.sh

  2. Replace disabling the fileinfo parameter with enabling it
    sed -i "s/--disable-fileinfo/--enable--fileinfo/g" php.sh

  3. Install php-7.4, if it is not 7.4, please replace 7.4 with your php version
    bash php.sh install 7.4

shell_exec,putenv etc. PHP functions

Disabled by default to improve PHP security shell_exec``,putenv If you need to enable it, please go to App Store --> Installed --> PHP-Version --> Disabled functions to delete it, and restart php service.

Or add # comment in the configuration file disable_functions And restart PHP service

Redis

Configuration file : /www/server/redis/redis.conf

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

View status command : /etc/init.d/redis status

Redis program directory : /www/server/redis

Log file : /www/server/redis/redis.log

Apache

Website configuration directory : /www/server/panel/vhost/apache

Main configuration directory : /www/server/apache/conf/

Start command : /etc/init.d/httpd start

Stop command : /etc/init.d/httpd stop

Restart command : /etc/init.d/httpd restart

View status command : /etc/init.d/httpd status

Apache program directory : /www/server/apache

Log file : /www/wwwlogs/access_log

Error log file : /www/wwwlogs/error_log

openlitespeed

openlitespeed uses lsphp by default, not php

Website configuration directory : /www/server/panel/vhost/openlitespeed

Main configuration directory :/usr/local/lsws/conf/

Start command : /usr/local/lsws/bin/lswsctrl start

Stop command : /usr/local/lsws/bin/lswsctrl stop

Restart command : /usr/local/lsws/bin/lswsctrl restart

View status command : /usr/local/lsws/bin/lswsctrl status

openlitespeed program directory : /usr/local/lsws

lsphp

openlitespeed dedicated php

Here we take php7.4 as an example

lsphp74 program directory : /usr/local/lsws/lsphp74/

If it is 7.3, then lsphp73

Main configuration directory :/usr/local/lsws/lsphp74/etc

Feedback or Suggestions

If you encounter problems or suggestions during use, please contact us through the following methods:

  • (Please describe in detail or provide screenshots)
  1. Forum: https://www.aapanel.com/forum
  2. Email: [email protected]