Migrating from oproxy to Nginx

From ISPWiki

Jump to: navigation, search


Customizing ISPmanager Cluster

Connect to the master node via SSH and enter the chroot environment.

Execute the command below to stop oproxy:

 # /usr/local/ispmgr/etc/cluster_roles/init.d/oproxy stop

Open the control panel configuration file to add the line

 DNS named

to enable the panel to use the updated modules to work with the WWW domains and name server.

Restart the panel to apply the changes.

Log in to the control panel -> "Server settings" section -> the Features module. Install Nginx and restart the panel.

Go to the "Tools" section -> the "Backends" module to add your HTTP-nodes and provide the node's internal IP-address and the cluster password.

Create a web-server for each newly created backend.

To distribute users' WWW domain among backends execute the command[1]:

 # /usr/local/ispmgr/sbin/sitectl distribute

Customizing cluster nodes

To make the services start automatically when restarting the nodes, place all the start commands from /usr/local/ispmgr/etc/cluster_nodes.conf into /etc/rc.local of the nodes' parent system.

For example:

The anynode role is specified for all the nodes in /usr/local/ispmgr/etc/cluster_nodes.conf. This role contains a list of services in the order they are started.

 Role anynode {
 	Description "Общая для всех узлов роль";
 	Start "/etc/init.d/openntpd start";
 	Start "/usr/local/ispmgr/etc/cluster_roles/init.d/ntpdate start";
 	Start "/etc/init.d/exim4 start";
 	Start "/etc/init.d/acct start";
 	Stop "/etc/init.d/acct stop";
 	Stop "/etc/init.d/exim4 stop";
 	Stop "/usr/local/ispmgr/etc/cluster_roles/init.d/ntpdate stop";
 	Stop "/etc/init.d/openntpd stop";

thus, the followings should be added into /etc/rc.local of the parent system

 /usr/sbin/chroot /storage /etc/init.d/openntpd start
 /usr/sbin/chroot /storage /usr/local/ispmgr/etc/cluster_roles/init.d/ntpdate start
 /usr/sbin/chroot /storage /etc/init.d/exim4 start
 /usr/sbin/chroot /storage /etc/init.d/acct start

repeat the same procedure or all the roles of the node.

Note, that the following components must run on all HTTP nodes (backends) :

  • ssh-server in the chroot-environment that will listen to port 22;
  • "/usr/local/ispmgr/sbin/sitectl start local" that will start all the node's web-servers.

Collecting statistics (accounting)

Add a cron job in the chroot environment of the master node:

 00	*	*	*	*	/usr/local/ispmgr/sbin/acctstat -x

Make sure that the configuration file contains

 path pacct /var/log/account/pacct

Collecting error-logs

Add a cron job in the chroot environment of the master node:

 */30	*	*	*	*	/usr/local/ispmgr/sbin/logfetch -t error


  1. To specify the number of web-server on which a WWW domain should be installed, specify the MinServersPerHost parameter of the configuration file.
Was this helpful? Yes | No
Personal tools