Skip to content

How to change Apache Httpd default port in Linux?

Find out how to change Apache Httpd default port in Linux from the default 80.

I was working with Apache server and I used it as a web server for Bugzilla. But I didn’t want it to use the default port 80. I wanted to assign a specific port for Bugzilla. Please follow these steps to change Apache Httpd default port in Linux from the default 80.

Open httpd.conf

sudo vi /etc/httpd/conf/httpd.conf

Add the port

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
Listen 8010 

Restart Apache web Server

Add your port after the line Listen 80. You also need to change the port number in <VirtualHost> tag in your application’s configuration too.

sudo systemctl start httpd.service

You’re done.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.