Ubuntu 14.04 Web 程序开发(5)Ubuntu为Tomcat启用80端口
来源:互联网 发布:淘宝运营托管 编辑:程序博客网 时间:2024/06/05 15:47
Ubuntu为Tomcat启用80端口
一、tomcat部署调试
Update the package repository
sudo apt-get update sudo apt-get upgrade --show-upgrades
Install the authbind package
sudo apt-get install authbind
This package allows non-root users to bind to ports below 1024. Install the tomcat7 package
sudo apt-get install tomcat7
The tomcat7-docs, tomcat7-examples,and tomcat7-admin packages aren’t required to deploy and maintain a web application. These packages can be skipped unless they are truly needed.
A new user “tomcat7” with primary group “tomcat7” will be created.
Enable authbind
Open a text editor like vim and load the default tomcat configuration file
vi /etc/default/tomcat7
Remove the comment hash “#” in front of the authbind property and set the value to “yes”
AUTHBIND=yes
Create authbind bind permission files for ports 80 and 443. Authbind will loop through the directory structure and try to find a byPort file referencing the port number attempting to be bound. Authorization will be granted if the user attempting to bind has execute permission.
touch /etc/authbind/byport/80 touch /etc/authbind/byport/443 chmod 0755 /etc/authbind/byport/80 chmod 0755 /etc/authbind/byport/443 chown tomcat7:tomcat7 /etc/authbind/byport/80 chown tomcat7:tomcat7 /etc/authbind/byport/443
Change the Tomcat Port from 8080/8443 to 80/443
Open a text editor like vim and load the server configuration file
vi /etc/tomcat7/server.xml
Find the connector for port 8080 to port 80 and the redirect port from 8443 to 443:
<Connector port="80" protocol="HTTP/1.1" connectiontimeout="20000" uriencoding="UTF-8" redirectport="443"> </Connector>
Restart the Tomcat service
sudo service tomcat7 restart
View the catalina.out log after restart and look for any errors. If you see permission denied errors, then you may have missed a step like:
Forgetting to uncomment the AuthBind setting and putting it to “yes”
Forgetting to restart the tomcat7 service as sudo
便捷方法:
什么配置文件不改,运行如下命令
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
因为linux限制了1-1024端口的使用权限,只有root用户才可以访问1024以下的端口号,所以不能用上面的方法实现,可以使用防火墙映射tomcat监听的端口到80端口。
来自:http://blog.chinaunix.net/uid-29206862-id-4755868.html
- Ubuntu 14.04 Web 程序开发(5)Ubuntu为Tomcat启用80端口
- Ubuntu为Tomcat启用80端口
- Ubuntu为Tomcat启用80端口
- Ubuntu为Tomcat启用80端口
- ubuntu tomcat启用80和443端口
- ubuntu中tomcat更改80端口(tomcat修改port 为 80 后 无法访问)
- ubuntu 14.04 启用nfs连接开发板
- ubuntu 14.04 启用nfs连接开发板
- ubuntu 14.04 启用nfs连接开发板
- ubuntu 14.04 启用nfs连接开发板 .
- ubuntu 14.04 启用nfs连接开发板
- Ubuntu下Tomcat绑定80端口
- Ubuntu下Tomcat绑定80端口
- Ubuntu中将tomcat改为80端口
- Ubuntu 14.04 Web 程序开发(4)基于JQuery+Ajax+Json+Servlet实现PUT GET
- Ubuntu 14.04 Web服务器Tomcat安装测试
- ubutu tomcat 启用80端口步骤
- 搞定ubuntu(11.04~11.10) tomcat绑定80端口
- Android 事件分发
- Android hdpi ldpi mdpi xhdpi xxhdpi适配详解
- 深度?|?如何在TensorFlow?中用深度学习修复图像?(附论文)
- mysql异常CommunicationsException: Communications link failure的解决方案
- gdb调试代码
- Ubuntu 14.04 Web 程序开发(5)Ubuntu为Tomcat启用80端口
- 用Python搭建匿名代理池
- 新闻客户端
- 指针
- 删除List中的非数字元素
- 深度学习笔记
- Get 传递百分号
- MySq体系结构
- 并查集