Apache与tomcat的基于端口的多个虚拟主机设置
tomcat:
打开server.xml,添加一个service即可:
<!--virtrual host shawn01 --> <Service name="shawn01"> <Connector port="9081" /> <Engine name="Catalina.shanw01" defaultHost="localhost.shanw01"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <Host name="localhost.shanw01" appBase="E:\workspace_shawn\www"> </Host> </Engine> </Service> <!--注意:需要修改的包括多个 name、port、appBase 属性值,用以区分不同的服务。--> <!--测试时候,注释用中文会报错,不知为何。(tomcat7) -->
Apache:
打开httpd.conf,添加以下内容:
#添加侦听端口 Listen 1234 #添加一个虚拟主机目录 <VirtualHost shawn.tianya.cn:1234> DocumentRoot "E:\workspace_shawn\CMS" ServerName shawn1234 </VirtualHost> #添加目录访问的权限 <Directory "E:/workspace_shawn/CMS"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
相关推荐
Kafka 2020-09-18
Wepe0 2020-10-30
杜倩 2020-10-29
windle 2020-10-29
minerd 2020-10-28
mengzuchao 2020-10-22
Junzizhiai 2020-10-10
bxqybxqy 2020-09-30
风之沙城 2020-09-24
kingszelda 2020-09-22
大唐帝国前营 2020-08-18
yixu0 2020-08-17
TangCuYu 2020-08-15
xiaoboliu00 2020-08-15
songshijiazuaa 2020-08-15
xclxcl 2020-08-03
zmzmmf 2020-08-03
newfarhui 2020-08-03
likesyour 2020-08-01