How to change the port number of Apache Web Server?

Default port to access the Apache is 80. Secure port for communicating with world for Apache is 443. Very frequently, we need to update the Apache port. Here is procedure to update the Apache port number on Linux server.

Steps -

1. SSH to your server. Please make sure, you have root access to server. Without root access, you can not proceed with it. 

2. Now, you will need to update the Apache configuration file. Apache configuration file is present at this location -
/etc/httpd/conf/httpd.conf

You can use any file editor with which you are comfortable to update the file  -
vi /etc/httpd/conf/httpd.conf

3. Search for the listen value in Apache configuration file. You can use blow command to find it -
grep Listen /etc/httpd/conf/httpd.conf

Output will be as follow -
Listen 0.0.0.0:80  ---------------> This for non SSL port
Listen [::]:80

Listen 0.0.0.0:443----------------> This is for SSL port
Listen [::]:443

You can update the Listen value to the port number which you would like to update. 

4. Restart the Apache Service after updating the port number. You can use any of the below command to restart the service -
service httpd restart

OR
/etc/init.d/httpd restart

That's it!Smile Your website is ready to use using updated port number. 
  • 5 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix Amazon S3-RequestTimeTooSkewed?

If you have configured a Amazon S3 backup server under cPanl backup configuration to upload...

How to install FFMPEG CentOS?

ffmpeg is the most popular opensource video streaming software and its being used on many...

[/url]memcached.so missing - Memcached installation error

While Memcached installation on Centos server, I was getting the error as '[/url]memcached.so...

How to install Memcached on CentOS?

Memcached is very fast caching system for MySQL. It is a distributed, high-performance, in-memory...

How to update MySQL password?

Steps to update the MySQL Password - 1. First stop MySQL service by following command....

Powered by WHMCompleteSolution