Change Default Port of Apache On Redhat/Cent0s 7

0
55

Change Default Port of Apache On Redhat/Cent0s 7

If you want to change Port in Apache configuration file it’s very easy to do that you can run website on different port also rather than default port.

Let’s check which is listening to which service

nmap -sT -O localhost

Check whether Port 8000 is free or not

lsof -i:8000

No output means this port is free

Add this port to firewall

firewall-cmd –zone=public –permanent –add-port=8000/tcp

Reload the firewall to apply changes

Add this port in apache configuration file located at /etc/httpd/conf/httpd.conf

Restart the Apache Service

Systemctl restart httpd

Create a file at location /var/www/html/index.html

Now try to access the Website Page on browser with IP:8000

http://192.168.140.141:8000/

You’re done

Sponsored

LEAVE A REPLY

Please enter your comment!
Please enter your name here