apache tomcat 整合后虚拟主机开设

16 07月
作者:PK|分类:工作

apache 虚拟主机设置

编辑/etc/httpd/httpd.conf

最后一行加入


Include /etc/httpd/conf/vhost/*.conf

新建 /etc/httpd/conf/vhost/httpd-vhost.conf 内容如下

<VirtualHost *:80>
ServerAdmin test@laomm.com
DocumentRoot "/usr/local/apache/htdocs"
ServerName www.a.com 
ErrorLog "logs/a-error_log"
CustomLog "logs/a-access_log" common
DirectoryIndex index.html index.htm index.php index.phtml default.html
<Directory "/usr/local/apache/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
JkMount                /*.jsp                    worker1 
JkMount                /*.page                 worker1 
JkMount                /*.cic                    worker1 
JkMount                /*.do                     worker1 
JkMount                /*.action                worker1 
JkMount                /*                          worker1 
JkUnMount                /*.php                worker1 
 </VirtualHost>

tomcat里面加虚拟主机 编辑server.xml

查找 <Host name="locahost"  这段改成


<Host name="www.a.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="/usr/local/apache/htdocs" debug="0" reloadable="true" />


编辑/etc/httpd/extra/workers.erties

worker.worker1.host=localhost # 这个改成
worker.worker1.host=www.a.com,localhost

然后重启tomcat.httpd

浏览786 评论0
返回
目录
返回
首页
mysql 启动失败 ERROR! The server quit without updating PID file #2002 无法登录 MySQL 服务器

发表评论