Web server configuration
This article describes the settings for the Apache and Nginx web servers. All changes are made to the configuration file /usr/local/mgr5/etc/ispmgr.conf.
- The information about the website settings is kept in the ispmanager internal base. Manual changes made to the configuration files will be lost when modifying parameters from the control panel if the settings that you have made manually conflict with those configured in the control panel. Those changes will be saved when editing a domain, if possible.
- Settings of every website are kept in a separate file. The files are located in directories based on the domain owner name.
- Access to directories (diraccess) is specified in the web server configuration file in the file with the settings of the corresponding website (.htaccess was used in the previous version)
- PHP can work through both Apache and Nginx (php-fpm is used). As now you can use PHP without Apache, using Apache and Nginx may not start the Apache server, if the request can be processed by Nginx.
- You can use multiple IP addresses for website.
- Activating SSL in the Nginx settings will create a separate "server" section
- logrotate is used for rotating logs and errors.
ForwardedSecret
If you redirect requests from Nginx into the panel, we define a reverse address by the X-Forwarded-For HTTP header. Fraudulent will be able to change a reverse address using that header enabling him to use COOKIE for sending requests as if it is another user. The panel will ignore X-Forwarded-For, if the request does not contain X-Forwarded-Secret with the same value as specified in the configuration file.
Web server restart
The web server is restarted in 2 seconds after the last change of the settings. If during that time more changes are made, the server will be restarted in 2 seconds. You can also specify the WebRestartDelay parameter that specifies the minimum period between web server reboot.
If the changes are not applied to the list of IP addresses/ports, a soft reboot of the web server will be made. Otherwise, the whole server will reboot.
Re-configuring web server
Sometimes, when working with the web server and control panel you may need to reconfigure the web server. Configuration files of all the websites that were created in the control panel, will be re-created.
Performing this operation will delete all the manual changes made to the configuration file!
Execute the following functions sequentially:
webreconfigure.initialize with parameter shutdown=on
webreconfigure.restoreCommand examples using mgrctl:
/usr/local/mgr5/sbin/mgrctl -m ispmgr webreconfigure.initialize shutdown=on
/usr/local/mgr5/sbin/mgrctl -m ispmgr webreconfigure.restoreTo reconfigure only configuration files of websites without reconfiguring the global configuration file of the web server, run the second command with the finalize=on parameter:
/usr/local/mgr5/sbin/mgrctl -m ispmgr webreconfigure.restore finalize=on