apache虚拟主机转向配置一例

发布时间:2020-09-23编辑:脚本学堂
apache虚拟主机配置一例,供大家参考。很多朋友,在配置apache虚拟主机时,容易忽略这行:NameVirtualHost *:80 这次记住了,这个不可缺少。

主ServerAdmin:
 

复制代码 代码如下:

NameVirtualHost *:80
<VirtualHost *:80>
ServerName jb200.com
ProxyPass / http://localhost:8088/
ProxyPassReverse / http://localhost:8088/
</VirtualHost>

#设置虚拟主机
<VirtualHost *:80>
ServerAdmin www.jb200.com
DocumentRoot E:/tomcat/webapps/ROOT
#站点所在路径,应与tomcat中的目录设置相同
ServerName www.jb200.com

alias /p "F:uploadFiles"
<Directory "F:uploadFiles">
Options -Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /jbxue "F:jbxue"
<Directory "F:jbxueabcc">
Options -Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

DirectoryIndex index.html index.htm index.jsp
ErrorLog logs/shsc-error_log.txt
CustomLog logs/shsc-access_log.txt common
Jklinuxjishu/9952.html target=_blank class=infotextkey>mount /servlet/* ajp13
#让apache支持对servlet传送,用以Tomcat解析
JkMount /*.jsp ajp13
#让Apache支持对jsp传送,用以Tomcat解析
JkMount /*.do ajp13
#让Apache支持对.do传送,用以Tomcat解析
</VirtualHost>