【cenos】apache安装及配置(同一端口分静态html和动态tomcat页面)

1、软硬件环境:
     cenos 环境、httpd 2.2.3、tomcat 7、jdk 1.7、mysql 5.5
    注:jdk、tomcat安装不再描述
2、安装apache httpd
    查看是否有安装httpd :rpm -qa httpd
    安装httpd : yum install httpd
    卸载httpd : yum remove httpd
3、默认安装路径:/etc/httpd
    启动httpd: cd /etc/init.d/   ./httpd start
    停止httpd: cd /etc/init.d/   ./httpd stop
4、修改/etc/httpd/conf/httpd.conf
     #同一端口,不同域名配置必须下一行
     NameVirtualHost *:80
    <VirtualHost *:80>
        ServerName XX.XXX.com
        DocumentRoot "/env/www/html"
        ErrorLog logs/XX.XXX.com-error_log
        CustomLog logs/XX.XXX.com-access_log common
    </VirtualHost>
    <VirtualHost *:80>
ServerName YY.YYY.com
        ProxyPass / http://YY.YYY.com:8080/
        ProxyPassReverse / http://YY.YYY.com:8080/
        ErrorLog logs/hbseed.accedeal.com-error_log
        CustomLog logs/hbseed.accedeal.com-access_log common
    </VirtualHost>
5、在浏览器中分别输入XX.XXX.com和YY.YYY.com分别访问了html和tomcat的jsp项目

你可能感兴趣的:(【cenos】apache安装及配置(同一端口分静态html和动态tomcat页面))