Bobcares

Modify the Apache port in bitnami – How to do it

PDF Header PDF Footer

Wondering how to modify the Apache port in bitnami?We can help you.

As part of our Server Management Services, we assist our customers with several cPanel queries.

Today, let us see how our Support techs proceed to perform it.

How to modify the Apache port in bitnami?

Today, let us see the steps followed by our Support Techs to modify port depending on whether your Bitnami stack uses native Linux system packages, or if it is a self-contained installation.

To identify your Bitnami installation type and what approach to follow, run the command below:

test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."Copy Code

 

Approach A: Bitnami installations using system packages

HTTP port

Under the default configuration, Apache will listen for HTTP requests on port 80.

To change the port number, follow the steps below:

  • Edit the /opt/bitnami/apache2/conf/httpd.conf file and modify the value specified in the Port directive. For example:
Listen 8080Copy Code
ServerName localhost:8080Copy Code
  • Edit the /opt/bitnami/apache2/conf/bitnami/bitnami.conf file and modify the value specified in the VirtualHost directive. For example:
<VirtualHost _default_:8080>Copy Code
  • Edit all non-SSL virtual host files inside the /opt/bitnami/apache2/conf/vhosts/ directory and modify the value specified in the VirtualHost directive.

Please do not edit virtual host files containing the SSLEngine on directive.

<VirtualHost 127.0.0.1:8080 _default_:8080>Copy Code
  • Finally, restart the Apache server for changes to take effect:
sudo /opt/bitnami/ctlscript.sh restart apacheCopy Code

HTTPS port

Apache listens for HTTPS requests on port 443.

To change the port number, follow the steps below:

  • Edit the /opt/bitnami/apache2/conf/bitnami/bitnami-ssl.conf file and modify the value specified in the VirtualHost directive. For example:
<VirtualHost _default_:8443>Copy Code
  • Edit all SSL virtual host files inside the /opt/bitnami/apache2/conf/vhosts/ directory and modify the value specified in the VirtualHost directive. For example:

NOTE: Only edit virtual host files containing the SSLEngine on directive.

<VirtualHost 127.0.0.1:8443 _default_:8443>Copy Code
  • Finally, restart the Apache server for changes to take effect:

sudo /opt/bitnami/ctlscript.sh restart apache

Approach B: Self-contained Bitnami installations

HTTP port

Under the default configuration, Apache will listen for HTTP requests on port 80.

To change the port number, follow the steps below:

  • Edit the /opt/bitnami/apache2/conf/httpd.conf file and modify the value specified in the Port directive. For example:
Listen 8080Copy Code
ServerName localhost:8080Copy Code
  • Edit the /opt/bitnami/apache2/conf/bitnami/bitnami.conf file and modify the value specified in the VirtualHost directive. For example:
<VirtualHost _default_:8080>Copy Code
  • Then, restart the Apache server for changes to take effect:
sudo /opt/bitnami/ctlscript.sh restart apacheCopy Code

HTTPS port

Apache listens for HTTPS requests on port 443.

To change the port number, follow the steps below:

  • Firstly, edit the /opt/bitnami/apache2/conf/bitnami/bitnami.conf file and modify the value specified in the Port directive. For example:
Listen 8443Copy Code
<VirtualHost _default_:8443>Copy Code
  • Then, restart the Apache server for changes to take effect.
sudo /opt/bitnami/ctlscript.sh restart apacheCopy Code

[Stuck in between? We’d be glad to assist you]

Conclusion

In short, today we saw steps followed by our Support Techs to modify the Apache port in bitnami.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Get featured on the Bobcares blog and share your expertise with a global tech audience.

WRITE FOR US
server management

Spend time on your business, not on your servers.

TALK TO US

Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!