When using MODx CMS on servers with the ISPmanager control panel installed, there are conflicts with access to the MODx website administration panel, because they use the same /manager/ link. We will consider several methods of resolving the conflict, by changing the ISPmanager link

Option one

Change the panel address using internal panel settings. Select "Panel Address" in the "Settings" section of the ISPmanager panel. In the window that appears, change the "Control Panel" field to the link you want.

file

The window may look different in new versions of the panel

file

The panel will independently edit the necessary files and restart the web server. Immediately after the changes take effect, a "Not Found" message will appear because the panel is already at the new address.

With newer versions of the panel it may be necessary to change the redirection directives in the nginx setup or remove them. The panel does not change them automatically. How to do this will be written at the end of the article

Option two

Prescribe in apache settings, section VirtualHost of your project on MODx, alias

Alias /manager/ /home/user/data/www/SITE/manager/

where /home/user/data/www/SITE/manager/ is the full address to the manager directory of your site on MODx. If you can't find the directory of your site, you can also specify its location in the VirtualHost section. The full path to your site directory will be indicated by the DocumentRoot directive.

After changing settings restart Apache

In newer versions of the panel it might be necessary to change or remove redirection directives in the nginx setup. The panel does not change them automatically. How to do this will be described at the end of the article

Option three

Change file /usr/local/ispmgr/etc/ispmgr.inc which connects to main Apache configuration file. The same as the first option, but the changes are made manually. It contains an alias Alias, which makes the web-server by /manager/ refer to the ISPmanager panel. Copy the file:

cp /usr/local/ispmgr/etc/ispmgr.inc /usr/local/ispmgr/etc/myispmgr.inc

In the new file /usr/local/ispmgr/etc/myispmgr.inc you must change the line:

Alias /manager /usr/local/ispmgr/bin/

specifying a new reference to the panel. For example:

Alias /ispmanager /usr/local/ispmgr/bin/

You will have to change the address of the file in the Apache configurations, because it does not yet know anything about the new configuration file /usr/local/ispmgr/etc/myispmgr.inc Open the Apache configuration file with a text editor (e.g. nano, joe, vi, vim)

nano /etc/apache2/apache2.conf

and change the address on the line

Include /usr/local/ispmgr/etc/ispmgr.inc

to

Include /usr/local/ispmgr/etc/myispmgr.inc

I use sed to replace the address automatically:

sed -i "s/usr\/local\/ispmgr\/etc\/ispmgr.inc/usr\/local\/ispmgr\/etc\/myispmgr.inc/g" /etc/apache2/apache2.conf

After changing these settings, you need to restart Apache

You might also need to restart the panel itself:

rm -rf /usr/local/ispmgr/var/.xmlcache ; killall -9 ispmgr

nginx

New versions of the panel add the configuration file

/usr/local/ispmgr/etc/nginx.inc

as well as redirection for each virtual server location host in the configuration file /etc/nginx/nginx.conf

rewrite ^(/manager/.*)$ https://$host$1 permanent;

Note that the redirect is created for a link with an ending slash.

For the file /usr/local/ispmgr/etc/nginx.inc you need to change the location

location ^~~ /manager

specifying the link you need

To remove nginx redirection from /manager/ link, you can comment out the line rewrite ^(/manager/.*)$ https://$host$1 permanent; in your virtual host configuration file /etc/nginx/nginx.conf, or change the redirection directive link to the new panel link. You can do this automatically as follows:

sed -i "s/\^(\/manager\/\.\*)/\^(\/ispmanager\/\.\*)/g" /etc/nginx/nginx.conf

After that, restart nginx

/etc/init.d/nginx restart

You might need to restart your browser

Note

The address of the Apache web server configuration file depends on your GNU/Linux distribution.

For Debian, Ubuntu

/etc/apache2/apache2.conf

For CentOS

/etc/httpd/conf/httpd.conf

You can restart apache with the command:

apachectl restart

Or, depending on the distribution, with the command:

For Debian, Ubuntu

/etc/init.d/apache2 restart

For CentOS

/etc/init.d/httpd restart
Updated Nov. 10, 2024