apache2 and tomcat config

apache2 and tomcat config

1.install apache2
2.instal apache2 jk

3.vim /etc/apache2/mods-available/jk.conf
     # Where to find workers.properties
  # Update this path to match your conf directory location (put workers.properties next to httpd.conf)
  JkWorkersFile /etc/apache2/workers.properties
  # Where to put jk shared memory
  # Update this path to match your local state directory or logs directory
  JkShmFile     /var/log/apache2/mod_jk.shm
  # Where to put jk logs
  # Update this path to match your logs directory location (put mod_jk.log next to access_log)
  JkLogFile     /var/log/apache2/mod_jk.log
  # Set the jk log level [debug/error/info]
  JkLogLevel    debug
  JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
  # Select the timestamp log format
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  # Send everything for context /examples to worker named worker1 (ajp13)
  #JkMount /* webstore
4.vim /etc/apache2/mods-available/jk.load
    LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
5.vim /etc/apache2/workers.properties
  # Define 1 real worker using ajp13
  worker.list=webstore,sandbox
  # Set properties for webstore (ajp13)
  worker.webstore.type=ajp13
  worker.webstore.host=localhost
  worker.webstore.port=8009
  worker.webstore.lbfactor=50
  worker.webstore.socket_timeout=300
  worker.webstore.socket_keepalive=1
  worker.webstore.connection_pool_size=20
  worker.webstore.connection_pool_minsize=10
  worker.webstore.connection_pool_timeout=600

  worker.sandbox.type=ajp13
  worker.sandbox.host=localhost
  worker.sandbox.port=8010
  worker.sandbox.lbfactor=50
  worker.sandbox.socket_timeout=300
  worker.sandbox.socket_keepalive=1
  worker.sandbox.connection_pool_size=20
  worker.sandbox.connection_pool_minsize=10
  worker.sandbox.connection_pool_timeout=600

6.sudo ln -s /etc/apache2/mods-available/jk.conf /etc/apache2/mods-enabled/jk.conf
7.sudo ln -s /etc/apache2/mods-available/jk.conf /etc/apache2/mods-enabled/jk.conf
8.add a line to /etc/apache2/sites-available/default

      JkMount /* webstore
9.vim /etc/apache2/sites-available/static
   <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName      static.mycompany.com

        DocumentRoot /var/www/static
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/static/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        <Directory /var/www/static/picture/product/medium>
                ErrorDocument 404 /picture/product/nopic-medium.jpg
        </Directory>

        <Directory /var/www/static/picture/product/large>
                ErrorDocument 404 /picture/product/nopic-large.jpg
        </Directory>
        <Directory /var/www/static/picture/product/small>
                ErrorDocument 404 /picture/product/nopic-small.jpg
        </Directory>
        SetEnvIf Request_URI "/*" no-jk

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

   </VirtualHost>
10.mkdir /var/www/static/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值