Apache 映射到 Tomcat
2015-12-16 15:21
477 查看
Apache 是centos 默认的http服务器
默认使用80端口 ,apache 使用量巨大。
Apache 管理命令
service httpd restart //重启
service httpd start //启动
service httpd stop //停止
配置文件目录
配置文件中增加一个虚拟机配置
配置 主机名
如果页面跳转迅速,但是提示临时维护
则查看 SELinux
关闭SELinux的方法:
修改/etc/selinux/config文件中的SELINUX=”” 为 disabled ,然后重启。
如果不想重启系统,使用命令setenforce 0
注:
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux
getenforce/setenforce查看和设置SELinux的当前工作模式
此配置需要tomcat与apach 在同一主机上方。
场景:公司、校园内网服务需要外网访问
另外配置文件中也支持301跳转
默认使用80端口 ,apache 使用量巨大。
Apache 管理命令
service httpd restart //重启
service httpd start //启动
service httpd stop //停止
配置文件目录
cd /etc/httpd/conf vi httpd.conf
配置文件中增加一个虚拟机配置
<VirtualHost *:80> # ServerAdmin webmaster@dummy-host.example.com # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common RewriteEngine On ServerName h.youyisky.com serverAlias www.h.youyisky.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> #ProxyPass /classifier/ http://172.16.129.22:8080/shiny/ #ProxyPassReverse /classifier/ http://172.16.129.22:8080/shiny/ #ProxyPass /pic_random/ http://172.16.129.121:8080/ #ProxyPassReverse /pic_random/ http://172.16.129.121:8080/ ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ #SetEnv force-proxy-request-1.0.1 #SetEnv proxy-nokeepalive 1 </VirtualHost>
配置 主机名
ServerName www.domain.com:80
如果页面跳转迅速,但是提示临时维护
则查看 SELinux
关闭SELinux的方法:
修改/etc/selinux/config文件中的SELINUX=”” 为 disabled ,然后重启。
如果不想重启系统,使用命令setenforce 0
注:
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux
getenforce/setenforce查看和设置SELinux的当前工作模式
/usr/sbin/setenforce 0
此配置需要tomcat与apach 在同一主机上方。
场景:公司、校园内网服务需要外网访问
另外配置文件中也支持301跳转
相关文章推荐
- Tomcat启动过程原理详解
- Deployment on Tomcat startup
- 搭建Tomcat服务器
- 启动tomcat的时候出现内存不足的错误
- TOMCAT线程池与SERVLET
- Tomcat报错,May be locked by another process.
- Multiple Contexts have a path of "/xxxx"问题解决
- linux下jdk_tomcat+mysql配置那点事
- tomcat与android应用端口交互问题
- 关于 tomcat 集群中 session 共享的三种方法
- Apache与Tomcat 区别联系
- 使用tomcat做图片服务器
- tomcat发布修改浏览器中的标志以及登录页面监听回车键登录
- TOMCat 解析shtml(配置tomcat让shtml嵌套文件显示)
- MAC OX 配置 Tomcat 说明
- Tomcat去除项目名称和端口号,直接使用ip地址访问项目的方法
- 解决 maven工程jar包不能同步到tomcat服务器
- JavaEE__将应用部署到Tomcat根目录的方法
- 应用服务器之tomcat
- tomcat 配置