/usr/local/apache-tomcat-7.0.55_8081/webapps --应用发布目录:
/usr/local/apache-tomcat-8.0.24/webapps/myhome
http://192.168.33.220:8080/
<html> 开始标签
</html> 结束标签
<html>
<head>
<title> 我的第一个HTML页面</title>
</head>
<body>
<center>
<h1>欢迎大家访问我的个人主页</h1>
</center>
</body>
</html>
标签成对出现:
访问:
http://192.168.33.220:8080/myhome/index.html
tomcat 应用的8080 端口改为80:
[tomcat@master conf]$ grep 8080 server.xml
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
<Connector port="8080" protocol="HTTP/1.1"
port="8080" protocol="HTTP/1.1"
[root@master logs]# netstat -nap | grep java
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 29524/java
tcp 0 0 :::8009 :::* LISTEN 29524/java
unix 2 [ ] STREAM CONNECTED 155724 29524/java
可以看到80端口没法启动,启动80需要使用root用户:
[root@master bin]# netstat -nap | grep java
tcp 0 0 :::80 :::* LISTEN 29588/java
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 29588/java
tcp 0 0 :::8009 :::* LISTEN 29588/java
unix 2 [ ] STREAM CONNECTED 158060 29588/java
[root@master bin]#
此时80端口打开,http://192.168.33.220/myhome/index.html 访问正常