can't access tomcat homepage

I just installed tomcat7 from repository following this guide.

Then i changed the listening port to 8081 because port 8080 have been used by apache2.

/var/lib/tomcat7/conf$ sudo vi server.xml

I changed to port 8081

Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />

When i try to open in browser http://(my_ip_address):8081 i got warning this site can't be reached.

I check in terminal

sudo systemctl status apache2

● tomcat7.service - LSB: Start Tomcat.
Loaded: loaded (/etc/init.d/tomcat7; bad; vendor preset: enabled)
Active: active (exited) since Fri 2020-01-24 18:35:54 HKT; 1h 0min ago
Docs: man:systemd-sysv-generator(8)
Process: 2419 ExecStop=/etc/init.d/tomcat7 stop (code=exited, status=0/SUCCESS)
Process: 2430 ExecStart=/etc/init.d/tomcat7 start (code=exited, status=0/SUCCESS)

Jan 24 18:35:49 localhost systemd[1]: Stopped LSB: Start Tomcat..
Jan 24 18:35:49 localhost systemd[1]: Starting LSB: Start Tomcat….
Jan 24 18:35:49 localhost tomcat7[2430]: * Starting Tomcat servlet >engine tomcat7
Jan 24 18:35:54 localhost tomcat7[2430]: …done.
Jan 24 18:35:54 localhost systemd[1]: Started LSB: Start Tomcat..
Jan 24 18:36:01 localhost systemd[1]: Started LSB: Start Tomcat..
Jan 24 18:43:10 localhost systemd[1]: Started LSB: Start Tomcat..

everything is ok. But when i checked port 8081

sudo netstat -plnt | grep ':8081'

i don't have anything.

Then i checked all listening port

sudo netstat -tulpn
Then this is all i got
Proto Recv-Q Send-Q Local Address Foreign Address >State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* >LISTEN 1612/sshd
tcp 0 0 0.0.0.0:5432 0.0.0.0:* >LISTEN 1696/postgres
tcp6 0 0 :::3306 :::* >LISTEN 1679/mysqld
tcp6 0 0 :::80 :::* >LISTEN 4526/apache2
tcp6 0 0 :::22 :::* >LISTEN 1612/sshd
tcp6 0 0 :::5432 :::* >LISTEN 1696/postgres
tcp6 0 0 127.0.0.1:8005 :::* >LISTEN 2555/java

What did i do wrong ?

1 Reply

Did you open port 8081 in your firewall?

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct