I’m trying to add another port to apache2 to listen to. I did all the steps in the following link, but still can’t get my page to load on another port number (tried 81, 8444, 8090).
https://www.ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-1/
Currently apache2 is listening to port 8090, as shown by “sudo netstat -tulpn | grep :8090”.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @taimaz,
As explained in the article, you’ll need to edit the port in the Apache’s configuration file :
Listen 80
To
Listen 81
Having said that, once you do, you’ll need to restart apache and actually enable traffic on that port. To allow all incoming connections on port 81 run these commands:
sudo iptables -A INPUT -p tcp --dport 81 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT.
sudo iptables -A OUTPUT -p tcp --sport 81 -m conntrack --ctstate ESTABLISHED -j ACCEPT.
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.