deny Allow from all /Directory windows2008 apache2.4 tomcat-

时间:2022-04-01 02:51:12

=====================软件清单
Apache2.4.33
apache-tomcat-7.0.85
=====================


1.安置apache
    1.1下载apache
    1.2 下载Visual C++ 2015 x86 ,apache的根本环境 https://www.microsoft.com/en-us/download/details.aspx?id=49984
    1.3 cmd执行httpd.exe -k install安置apache处事
 
2.安置jre
    

3.安置tomcat 7.0.85
    

--------------------------
4.下载apache tomcat连接器mod_jk
    https://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/

  4.1拷贝mod_jk.so至modules目录中
  4.2改削apache httpd.conf

改削域名
ServerName javaidea.cn:80

改削默认目录
DocumentRoot "D:/tomcat7/webapps/ROOT"
<Directory "D:/tomcat7/webapps/ROOT">
    Options  FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

开启虚拟主机配置

找到#Include conf/extra/httpd-vhosts.conf这句,将之前的#号去失,开启虚拟主机配置。

最后增加
#apache+tomcat config start
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkMount /* worker1
JKUnmount /*.htm worker1
JKUnmount /*.html worker1
JKUnmount /*.css worker1
JkUnMount /*.gif worker1  
JkUnMount /*.swf worker1  
JkUnMount /*.bmp worker1  
JkUnMount /*.png worker1  
JkUnMount /*.jpg worker1
JkUnMount /*.js worker1
设置为除静态资源 全都转发给tomcat措置惩罚惩罚

4.3增加workers.properties

Apache2.4\conf下新建文件workers.properties并添加内容如下

# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009



4.4 apache虚拟主机配置
    Apache24\conf\extra的httpd-vhosts.conf


<VirtualHost _default_:80>
DocumentRoot "D:/tomcat7/webapps/ROOT"
#ServerName :80
ServerAlias
JkMountCopy On
</VirtualHost>
# Add any other Virtual Hosts below

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "D:/tomcat7/jzy123/ROOT"
    ServerName jzy123.com
    ServerAlias
    ErrorLog "logs/jzy123-error.log"
    CustomLog "logs/jzy123.log" common
    JkMountCopy On
    <Directory "D:/tomcat7/jzy123/ROOT">
        Options  FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>

5.tomcat多域名邦定

改削server.xml

      <Host  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Alias></Alias>
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="javaidea_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      </Host>



注:  Options Indexes FollowSymLinks改为Options FollowSymLinks 禁用列出目录

注: (可选)Apache配置虚拟目录,,httpd.conf中添加 

Alias /qrcodes "d:/Qrcodes"
<Directory "d:/Qrcodes">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /images "d:/WebImages"
<Directory "d:/WebImages">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /apks "d:/Apks"
<Directory "d:/Apks">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

windows2008 apache2.4 tomcat-7多域名绑定环境配置

标签:

原文地点:https://www.cnblogs.com/beenupper/p/8878618.html