1

I have an EC2 instance running Apache Tomcat.

If I access IpAddress:8080 it's working.

I want to change it to IpAddress:80.

I've tried all the solutions given for this Question and nothing works for me.

Ports 8080, 80, 443 & 8443 are all allowed in security group inbound rules.

I'm using

  • ubuntu-bionic-18.04-amd64-server-20210415
  • apache-tomcat-9.0.54 installed via tar.gz
  1. changed port number in server.xml restarted the tomcat server, It didn't work.
sudo vi /var/lib/tomcat7/conf/server.xml

<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="443"/>
  1. Tried below steps It didn't work.
sudo apt-get install authbind 
sudo touch /etc/authbind/byport/80
sudo chmod 500 /etc/authbind/byport/80
sudo chown ubuntu /etc/authbind/byport/80

also I can't find #AUTHBIND=no anywhere in my machine. I am logging in as ubuntu user.

I've spent almost 2 days for this.

What is the issue?

JustAnotherDeveloper
  • 2,061
  • 2
  • 10
  • 24
Arun Kumar
  • 495
  • 9
  • 29
  • Is this an EC2 "VM"? – Ermiya Eskandary Oct 23 '21 at 09:09
  • Yes, @ErmiyaEskandary – Arun Kumar Oct 23 '21 at 09:10
  • from inside the EC2 does it work when you curl localhost:80 ? – Anis Smail Oct 23 '21 at 11:22
  • ```wget http://localhost``` response is ```failed : Connection refused``` and ```curl localhost:80``` response is ```curl: (7) Failed to connect to localhost port 80: Connection refused``` @AnisSmail – Arun Kumar Oct 23 '21 at 11:46
  • are you sure tomcat is running, can you check the logs ? – Anis Smail Oct 23 '21 at 12:24
  • 1
    I also found this answer, it seems that there're extra steps you're missing to properly configure authbind https://stackoverflow.com/questions/65043792/could-anyone-please-tell-me-where-is-autobind-in-server-xml-in-tomcat-9-as-menti – Anis Smail Oct 23 '21 at 12:27
  • I did follow the solution in that question.. its shows the below error ``` sudo systemctl status tomcat``` the command gives the output as ``` Oct 23 16:16:04 -101 systemd[1]: Starting Apache Tomcat Web Application Container... startup.sh[11789]: Existing PID file found during start. startup.sh[11789]: Removing/clearing stale PID file. startup.sh[11789]: Tomcat started. systemd[1]: Started Apache Tomcat Web Application Container. systemd[1]: /etc/systemd/system/tomcat.service:16: Executable path is not absolute: authbind --deep /home/ubuntu/tomcat/bin/startup.sh ``` – Arun Kumar Oct 23 '21 at 16:23

0 Answers0