Hi,
I'm building a test environment to learn more about linux. I'm trying to build a server with java+tomcat+mysql, and I'm getting some issues doing it.
My choosen distro is Ubuntu 7.04 Server, and installation went all nice and easy.
I'm running a virtual machine on vmware, with network bridged (connected directly to the physical network).
Some console copy-paste with comments:
Installed java 1.5.0 U12, downloaded from sun to be a purist and manually install everything on the linux
personal@ubuntu:~$ java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
Also installed Apache Tomcat 6.0.13, again downloaded from apache and manually installed
personal@ubuntu:~$ cd /opt/
apache-tomcat-6.0.13/ jdk1.5.0_12/
personal@ubuntu:~$ cd /opt/apache-tomcat-6.0.13/bin/
Before starting tomcat, i'll check any java processes running
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ps -ef | grep java
personal 4129 4125 0 11:04 pts/0 00:00:00 grep java
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ netstat -natp
(No info could be read for "-p": geteuid()=1000 but you should be root.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN -
tcp 0 232 172.18.8.78:23 172.18.5.66:1145 ESTABLISHED-
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$
Result: only my grep process was running, as for ports, there is my current telnet session working on port 23
Startup Tomcat
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ./startup.sh
Using CATALINA_BASE: /opt/apache-tomcat-6.0.13
Using CATALINA_HOME: /opt/apache-tomcat-6.0.13
Using CATALINA_TMPDIR: /opt/apache-tomcat-6.0.13/temp
Using JRE_HOME: /opt/jdk1.5.0_12
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ps -ef | grep java
personal 4151 1 36 10:41 pts/1 00:00:04 /opt/jdk1.5.0_12/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/apache-tomcat-6.0.13/conf/logging.properties -Djava.endorsed.dirs=/opt/apache-tomcat-6.0.13/endorsed -classpath :/opt/apache-tomcat-6.0.13/bin/bootstrap.jar:/opt/apache-tomcat-6.0.13/bin/commons-logging-api.jar -Dcatalina.base=/opt/apache-tomcat-6.0.13 -Dcatalina.home=/opt/apache-tomcat-6.0.13 -Djava.io.tmpdir=/opt/apache-tomcat-6.0.13/temp org.apache.catalina.startup.Bootstrap start
personal 4167 4130 0 10:42 pts/1 00:00:00 grep java
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ netstat -natp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN -
tcp 0 285 192.168.241.129:23 192.168.241.1:1117 ESTABLISHED-
tcp6 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 4151/java
tcp6 0 0 :::8009 :::* LISTEN 4151/java
tcp6 0 0 :::8080 :::* LISTEN 4151/java
tcp6 0 0 ::1:34864 ::1:34711 TIME_WAIT -
Result: Tomcat should be running now, the default http port is 8080, the process is running (pid=4151) and that same process is listening on port 8080
Some network/firewall info
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:9F:15:C8
inet addr:172.18.8.78 Bcast:172.18.255.255 Mask:255.255.0.0
inet6 addr: fe80::20c:29ff:fe9f:15c8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7057 errors:0 dropped:0 overruns:0 frame:0
TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:613817 (599.4 KiB) TX bytes:10236 (9.9 KiB)
Interrupt:16 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$
Now the problem: on my host machine, I can ping the linux server
C:\>ping 172.18.8.78
Pinging 172.18.8.78 with 32 bytes of data:
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Ping statistics for 172.18.8.78:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
But opening a browser at address http://172.18.8.78:8080 brings no page found ... it should bring the tomcat welcome page
Any help apprecciated ... thanks!
I'm building a test environment to learn more about linux. I'm trying to build a server with java+tomcat+mysql, and I'm getting some issues doing it.
My choosen distro is Ubuntu 7.04 Server, and installation went all nice and easy.
I'm running a virtual machine on vmware, with network bridged (connected directly to the physical network).
Some console copy-paste with comments:
Installed java 1.5.0 U12, downloaded from sun to be a purist and manually install everything on the linux
personal@ubuntu:~$ java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
Also installed Apache Tomcat 6.0.13, again downloaded from apache and manually installed
personal@ubuntu:~$ cd /opt/
apache-tomcat-6.0.13/ jdk1.5.0_12/
personal@ubuntu:~$ cd /opt/apache-tomcat-6.0.13/bin/
Before starting tomcat, i'll check any java processes running
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ps -ef | grep java
personal 4129 4125 0 11:04 pts/0 00:00:00 grep java
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ netstat -natp
(No info could be read for "-p": geteuid()=1000 but you should be root.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN -
tcp 0 232 172.18.8.78:23 172.18.5.66:1145 ESTABLISHED-
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$
Result: only my grep process was running, as for ports, there is my current telnet session working on port 23
Startup Tomcat
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ./startup.sh
Using CATALINA_BASE: /opt/apache-tomcat-6.0.13
Using CATALINA_HOME: /opt/apache-tomcat-6.0.13
Using CATALINA_TMPDIR: /opt/apache-tomcat-6.0.13/temp
Using JRE_HOME: /opt/jdk1.5.0_12
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ps -ef | grep java
personal 4151 1 36 10:41 pts/1 00:00:04 /opt/jdk1.5.0_12/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/apache-tomcat-6.0.13/conf/logging.properties -Djava.endorsed.dirs=/opt/apache-tomcat-6.0.13/endorsed -classpath :/opt/apache-tomcat-6.0.13/bin/bootstrap.jar:/opt/apache-tomcat-6.0.13/bin/commons-logging-api.jar -Dcatalina.base=/opt/apache-tomcat-6.0.13 -Dcatalina.home=/opt/apache-tomcat-6.0.13 -Djava.io.tmpdir=/opt/apache-tomcat-6.0.13/temp org.apache.catalina.startup.Bootstrap start
personal 4167 4130 0 10:42 pts/1 00:00:00 grep java
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ netstat -natp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN -
tcp 0 285 192.168.241.129:23 192.168.241.1:1117 ESTABLISHED-
tcp6 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 4151/java
tcp6 0 0 :::8009 :::* LISTEN 4151/java
tcp6 0 0 :::8080 :::* LISTEN 4151/java
tcp6 0 0 ::1:34864 ::1:34711 TIME_WAIT -
Result: Tomcat should be running now, the default http port is 8080, the process is running (pid=4151) and that same process is listening on port 8080
Some network/firewall info
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:9F:15:C8
inet addr:172.18.8.78 Bcast:172.18.255.255 Mask:255.255.0.0
inet6 addr: fe80::20c:29ff:fe9f:15c8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7057 errors:0 dropped:0 overruns:0 frame:0
TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:613817 (599.4 KiB) TX bytes:10236 (9.9 KiB)
Interrupt:16 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
personal@ubuntu:/opt/apache-tomcat-6.0.13/bin$
Now the problem: on my host machine, I can ping the linux server
C:\>ping 172.18.8.78
Pinging 172.18.8.78 with 32 bytes of data:
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Reply from 172.18.8.78: bytes=32 time<1ms TTL=64
Ping statistics for 172.18.8.78:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
But opening a browser at address http://172.18.8.78:8080 brings no page found ... it should bring the tomcat welcome page
Any help apprecciated ... thanks!
