1. Home
  2. Docs
  3. Knowledgebase and Tutorials
  4. ClusterControl
  5. Tips & Tricks
  6. How To Change the Default HTTP Port (80) For ClusterControl

How To Change the Default HTTP Port (80) For ClusterControl

Apache 2.4 Changes

RedHat/CentOSDebian/Ubuntu

Edit the /etc/httpd/conf/httpd.conf file and change

Listen 80

To

Listen <your new port>

Edit the /etc/apache2/ports.conf file and change

Listen 80
To Listen <your new port> 

ClusterControl Changes

RedHat/CentOSDebian/Ubuntu

1. Edit the /etc/httpd/conf.d/s9s.conf file and change

<VirtualHost *:80>

To

<VirtualHost *:your new port>

NOTE: /etc/httpd/conf.d/s9s.conf is only available when the Apache version used is 2.4.x.

1. Edit the /etc/apache2/sites-available/s9s.conf file and change

<VirtualHost *:80>

To

<VirtualHost *:your new port>

2. Add the new HTTP port to the /var/www/html/clustercontrol/bootstrap.php file. Change

define('APP_HOST', '127.0.0.1');

To

define('APP_HOST', '127.0.0.1:8080');

3. Update the dcps.apis table and change the API URL to use the new HTTP port.

mysql> select id, url from dcps.apis;
+----+--------------------------+
| id | url |
+----+--------------------------+
| 1 | http://127.0.0.1/cmonapi |
+----+--------------------------+

Add the new HTTP port, in this example the port is 8080

mysql> UPDATE dcps.apis SET url='http://127.0.0.1:8080/cmonapi' WHERE id = 1;
mysql> select id, url from dcps.apis;
+----+-------------------------------+
| id | url |
+----+-------------------------------+
| 1 | http://127.0.0.1:8080/cmonapi |
+----+-------------------------------+

Restart the Apache server and login to the web application using the URL http://<your ClusterControl controller IP>:8080/clustercontrol (8080 used in the example).

# Redhat/Centos
service httpd restart

# Ubuntu/Debian
service apache2 restart
Was this article helpful to you? Yes No