Apache in ispmanager
How Apache works
Apache can be either the only web server or work in conjunction with Nginx.
If Apache is the only web server, it processes both static and dynamic requests to sites. Dynamic content is generated by PHP in one of the modes:
Apache uses a multi-process request processing model, in which each client request is processed by a separate process. Processes are created when Apache starts and wait for incoming requests. In ispmanager, the multi-process modules MPM-Prefork and MPM-ITK are available for Apache.
Apache modes
MPM-Prefork
Requests to all sites are handled by processes running on behalf of the Apache user (apache or www-data by default), not on behalf of the site owner. In this mode, Apache works faster than MPM-ITK, as it does not have to switch processes between users. However, it requires more permissions to site files and is less secure, because one user has access to files of all sites.
MPM-ITK
Requests to sites are handled by processes running on behalf of the user whose site the request was made to (uid) and their group (gid). Due to this, it is more isolated than MPM-Prefork and allows avoiding issues with processes accessing the user's site files, but works slower, as it switches processes between users.
Changes after Apache installation
Switching web servers may cause website malfunctions.
- The standard Apache version from the OS repository is installed.
- Configuration files are prepared. A virtual host is created for each site on the server.
- If the Apache module was enabled during installation, the LSAPI and PHP-FPM modules are removed for all installed alternative PHP versions and the Apache module is installed instead.
- All existing users are granted permission to use PHP in CGI mode if they were previously allowed to use PHP in any mode. The default PHP mode is reset. User settings that require Nginx, LiteSpeed, or OpenLiteSpeed are reset.
- All existing sites are converted to work with Apache. For sites with a PHP handler in any mode, PHP in CGI mode is installed. For sites with Python or Node.js, the handler is reset. Site settings that require Nginx, LiteSpeed, or OpenLiteSpeed are reset.
Apache logging
Viewing logs is available to accounts with superuser rights.
Apache global logs
Debian-based operating systems | RHEL-based operating systems | |
---|---|---|
access log | /var/log/apache2/access.log | /var/log/httpd/access.log |
error log | /var/log/apache2/error.log | /var/log/httpd/error.log |
Site logs
Logs are available if they are enabled for the site.
/var/www/httpd-logs/DOMAIN.access.log
— access log/var/www/httpd-logs/DOMAIN.error.log
— error log
Viewing logs is also available in the WWW request logs section.