[{"title": "NGINX\u540e\u7aef\u83b7\u53d6\u4e0d\u5230header\u643a\u5e26\u7684\u53c2\u6570", "desc": "\u7f51\u7ad9\u91c7\u7528restful api\u98ce\u683c\u67b6\u6784\uff0c\u767b\u5f55\u540e\u53d1\u73b0\u7559\u8a00\u548c\u4fdd\u5b58\u7528\u4e86\u7ecf\u67e5\u770b\u540e\u53f0 request.headers.get \u6ca1\u6709\u83b7\u53d6\u5230token\u4fe1\u606f\u3002\u540e\u6765\u67e5\u770b nginx\u6587\u6863\u53d1\u73b0\u9ed8\u8ba4\u4e0d\u652f\u6301\u5e26\u4e0b\u5212\u7ebf\u7684 header \u53c2\u6570\u3002\u9700\u8981\u52a0 underscores_in_headers \u914d\u7f6e\u9879\u624d\u884c\u3002", "content": "

\u7ed9\u51fanginx\u7684server \u914d\u7f6e\u5b9e\u4f8b\uff1a

[root@Docker ~]# more /data/nginx/conf.d/https.conf 

server {

    listen       443 ssl;

    server_name  zhoudl.jschrj.com;

    ssl_certificate zhoudl.jschrj.com.crt;

    ssl_certificate_key zhoudl.jschrj.com.key;

    underscores_in_headers on;

    charset utf-8;

    access_log  /etc/nginx/logs/ssl.access.log  main;


    location / {

        proxy_pass         http://192.168.1.216:1002/; 

        proxy_redirect     off;

        proxy_set_header   Host             $http_host;

        proxy_set_header   X-Real-IP        $remote_addr;

        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

    }


    #error_page  404              /404.html;


    # redirect server error pages to the static page /50x.html

    #

    error_page   500 502 503 504  /50x.html;

    location = /50x.html {

        root   /usr/share/nginx/html;

    }


    # proxy the PHP scripts to Apache listening on 127.0.0.1:80

    #

    #location ~ \\.php$ {

    #    proxy_pass   http://127.0.0.1;

    #}


    # deny access to .htaccess files, if Apache's document root

    # concurs with nginx's one

    #

    #location ~ /\\.ht {

    #    deny  all;

}   


"}, {"title": "squid\u5bfc\u81f4\u7684cpu\u5360\u7528100%", "desc": "\u6700\u8fd1squid\u8fdb\u7a0b\u7aef\u53e3\u90fd\u5728\uff0c\u4e1a\u52a1\u8bbf\u95ee\u4e0d\u4e86\uff0c\u4e91\u76d1\u63a7\u5e73\u53f0\u4e5f\u63d0\u9192\u4e1a\u52a1\u5b95\u673a\u4e86\uff0c\u8bb0\u5f55\u4e00\u4e0b\u6700\u8fd1\u7684\u5904\u7406\u65b9\u6848\u4ee5\u4f9b\u65e5\u540e\u53c2\u8003\u3002", "content": "

\u4e00\u3001\u7531\u4e8esquid\u65b0\u7248\u672c\u652f\u6301\u7684\u591aCPU\uff0c\u6211\u7684 exsi \u865a\u62df\u673a 12\u6838\u5fc3\u7684\uff0c\u5148\u4fee\u6539\u4e0bsquid \u7684\u914d\u7f6e\uff0c\u4fdd\u4e1a\u52a1\u5728\u8bf4\uff0c\u76f8\u5173\u914d\u7f6e

#\u914d\u7f6ecpu

workers 12

cpu_affinity_map process_numbers=1,2,3,4,5,6,7,8,9,10,11,12 cores=1,2,3,4,5,6,7,8,9,10,11,12

#\u67e5\u770bsquid\u8fdb\u7a0b\u542f\u52a8

[root@Docker squid]# ps -ef |grep squid

root       384     1  0 Nov10 ?        00:00:00 squid -f /etc/squid/squid.conf

squid      386   384  0 Nov10 ?        00:00:04 (squid-coord-13) -f /etc/squid/squid.conf

squid      387   384  0 Nov10 ?        00:00:03 (squid-12) -f /etc/squid/squid.conf

squid      388   384  0 Nov10 ?        00:00:04 (squid-11) -f /etc/squid/squid.conf

squid      389   384  0 Nov10 ?        00:00:04 (squid-10) -f /etc/squid/squid.conf

squid      393   384  0 Nov10 ?        00:00:04 (squid-6) -f /etc/squid/squid.conf

squid      399   386  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      402   393  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      405   389  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      406   393  0 Nov10 ?        00:00:00 (unlinkd)

squid      407   387  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      409   389  0 Nov10 ?        00:00:00 (unlinkd)

squid      410   388  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      414   387  0 Nov10 ?        00:00:00 (unlinkd)

squid      418   388  0 Nov10 ?        00:00:00 (unlinkd)

squid      426   384  0 Nov10 ?        00:00:04 (squid-8) -f /etc/squid/squid.conf

squid      427   426  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      428   426  0 Nov10 ?        00:00:00 (unlinkd)

squid      433   384  0 Nov10 ?        00:00:05 (squid-4) -f /etc/squid/squid.conf

squid      437   433  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      445   433  0 Nov10 ?        00:00:00 (unlinkd)

squid      452   384  0 Nov10 ?        00:00:04 (squid-7) -f /etc/squid/squid.conf

squid      453   452  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      456   452  0 Nov10 ?        00:00:00 (unlinkd)

squid      459   384  0 Nov10 ?        00:00:05 (squid-5) -f /etc/squid/squid.conf

squid      464   459  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      471   459  0 Nov10 ?        00:00:00 (unlinkd)

squid      476   384  0 Nov10 ?        00:00:06 (squid-2) -f /etc/squid/squid.conf

squid      478   476  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      493   476  0 Nov10 ?        00:00:00 (unlinkd)

squid      498   384  0 Nov10 ?        00:00:05 (squid-3) -f /etc/squid/squid.conf

squid      499   498  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      501   498  0 Nov10 ?        00:00:00 (unlinkd)

squid      504   384 85 Nov10 ?        15:57:57 (squid-1) -f /etc/squid/squid.conf

squid      505   504  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      506   504  0 Nov10 ?        00:00:00 (unlinkd)

squid      508   384 98 Nov10 ?        18:20:53 (squid-9) -f /etc/squid/squid.conf

squid      509   508  0 Nov10 ?        00:00:00 (logfile-daemon) /var/log/squid/access.log

squid      510   508  0 Nov10 ?        00:00:00 (unlinkd)

root      3925  3440  0 10:09 pts/2    00:00:00 grep --color=auto squid

\u4e8c\u3001\u4fee\u6539\u7f13\u5b58\u5927\u5c0f\uff0c\u56e0\u4e3a\u6211\u540e\u9762\u6302\u4e86\u4e2anginx \u91cc\u9762\u653e\u7684\u662f\u90e8\u7f72\u9879\u76ee\u7528\u5230\u7684\uff0c\u914d\u7f6e\u6587\u4ef6\u548c\u5b89\u88c5\u5305\uff0c\u8c03\u5c0f\u4e0b\u7f13\u5b58\u3002\u9632\u6b62\u7f13\u5b58\u592a\u5927\u592a\u591a\u5bfc\u81f4cpu\u5360\u7528\u8fc7\u9ad8\u3002

##\u7f13\u5b58\u914d\u7f6e

cache_mem 128 MB

maximum_object_size 4 MB

minimum_object_size 0 KB [root@Docker squid]# more test 

maximum_object_size_in_memory 4096 KB 

cache_dir ufs /var/spool/squid 100 16 256

##\u5185\u5b58\u7f13\u5b58128M.\u5927\u4e8e4M\u4e0d\u4f7f\u7528\u7f13\u5b58\uff0c\u4e00\u7ea7\u7f13\u5b5816\u4e2a\u6587\u4ef6\uff0c\u4e8c\u7ea7\u7f13\u5b58256\u4e2a\u6587\u4ef6

\u4e09\u3001\u67e5\u770b\u8bbf\u95ee\u65e5\u5fd7\uff0c\u53d1\u73b0\u597d\u591a\u662f\u534a\u591c\u8bbf\u95ee\uff0c\u8fd8\u6709\u662f\u56fd\u5916\u7684IP\uff0c\u5730\u5740\u4f7f\u7528Linux\u9632\u706b\u5899\u963b\u6b62\u53ef\u7591IP\u5730\u5740

1.\u683c\u5f0f\u5316squid\u65e5\u5fd7\uff0c\u628a\u65f6\u95f4\u6233\u8f6c\u5316\u4e3a\u53ef\u8bfb\u7684\u65f6\u95f4\uff0c\u76f8\u5173python \u4ee3\u7801

#!/usr/bin/env python

#2014-6-5 pdd


import re

import time

import sys


with open(\"access.log\",'r') as f:

        log = re.findall(r'\\S+',f.readline())

        while log:

                print \"[%s] %s\" % (time.strftime(\"%T %D\",time.localtime(float(log[0]))),' '.join(log[1:]))

                with open(\"resault\",\"a\") as r:

                        r.write(\"{}\\n\".format(\"[%s] %s\" % (time.strftime(\"%T %D\",time.localtime(float(log[0]))),' '.join(log[1:]))))

                log = re.findall(r'\\S+',f.readline())


##\u9700\u8981\u653e\u5728\u65e5\u5fd7\u76ee\u5f55\u91cc\u6267\u884c

2.\u7528\u9632\u706b\u5899\u7981\u6b62\u6076\u610fIP\u8bbf\u95ee\uff0c\u8bb0\u5f97\u91cd\u65b0\u52a0\u8f7d\u9632\u706b\u5899\u914d\u7f6e\u3002

[root@Docker ~]# firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=\"91.241.19.84\" drop'              

success

[root@Docker ~]# firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=\"185.144.80.58\" drop' 

success

[root@Docker ~]# firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=\"101.89.45.22\" drop'             

success

[root@Docker ~]# firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=\"220.181.108.121\" drop'            

success

[root@Docker ~]# firewall-cmd --reload

success

"}, {"title": "No valid signing SSL certificate configured for HTTPS_port [::]:443", "desc": "Centos7\u4f7f\u7528#systemctl start squid \u62a5\u4e0b\u9762\u7684\u9519\u8bef\uff0c\u4f46\u662f\u4f7f\u7528 #/usr/sbin/squid -f /etc/squid/squid.conf \u624b\u52a8\u542f\u52a8\u5c31\u6210\u529f\u8bf4\u660esquid.conf \u6ca1\u95ee\u9898\uff0c\u5f88\u5947\u602a\u3002", "content": "

\u62a5\u9519\u4fe1\u606f

[root@Docker system]# systemctl restart squid

Job for squid.service failed because the control process exited with error code. See \"systemctl status squid.service\" and \"journalctl -xe\" for details.

[root@Docker system]# systemctl start squid  

Job for squid.service failed because the control process exited with error code. See \"systemctl status squid.service\" and \"journalctl -xe\" for details.

[root@Docker system]# /usr/sbin/squid -f /etc/squid/squid.conf

\\[root@Docker system]# systemctl status squid.service

\u25cf squid.service - Squid caching proxy

   Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled; vendor preset: disabled)

   Active: failed (Result: exit-code) since Fri 2020-10-09 10:33:27 CST; 42s ago

  Process: 3852 ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF (code=exited, status=1/FAILURE)

  Process: 3845 ExecStartPre=/usr/libexec/squid/cache_swap.sh (code=exited, status=0/SUCCESS)

 Main PID: 2924 (code=killed, signal=TERM)


Oct 09 10:33:27 Docker squid[3852]: No valid signing SSL certificate configured for HTTPS_port [::]:443

Oct 09 10:33:27 Docker squid[3852]: FATAL: No valid signing SSL certificate configured for HTTPS_port [::]:443

Oct 09 10:33:27 Docker squid[3852]: Squid Cache (Version 3.5.20): Terminated abnormally.

Oct 09 10:33:27 Docker squid[3852]: CPU Usage: 0.026 seconds = 0.018 user + 0.008 sys

Oct 09 10:33:27 Docker squid[3852]: Maximum Resident Size: 33696 KB

Oct 09 10:33:27 Docker squid[3852]: Page faults with physical i/o: 0

Oct 09 10:33:27 Docker systemd[1]: squid.service: control process exited, code=exited status=1

Oct 09 10:33:27 Docker systemd[1]: Failed to start Squid caching proxy.

Oct 09 10:33:27 Docker systemd[1]: Unit squid.service entered failed state.

Oct 09 10:33:27 Docker systemd[1]: squid.service failed.


###squid.service

[root@Docker system]# more squid.service 

[Unit]

Description=Squid caching proxy

After=syslog.target network.target nss-lookup.target


[Service]

Type=forking

LimitNOFILE=16384

EnvironmentFile=/etc/sysconfig/squid

ExecStartPre=/usr/libexec/squid/cache_swap.sh

ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF

ExecReload=/usr/sbin/squid $SQUID_OPTS -k reconfigure -f $SQUID_CONF

ExecStop=/usr/sbin/squid -k shutdown -f $SQUID_CONF

TimeoutSec=0


[Install]

WantedBy=multi-user.target


###[root@Docker system]# more squid.service 

[Unit]

Description=Squid caching proxy

After=syslog.target network.target nss-lookup.target


[Service]

Type=forking

LimitNOFILE=16384

EnvironmentFile=/etc/sysconfig/squid

ExecStartPre=/usr/libexec/squid/cache_swap.sh

ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF

ExecReload=/usr/sbin/squid $SQUID_OPTS -k reconfigure -f $SQUID_CONF

ExecStop=/usr/sbin/squid -k shutdown -f $SQUID_CONF

TimeoutSec=0


[Install]

WantedBy=multi-user.target

[root@Docker system]# more /etc/sysconfig/squid

# default squid options

SQUID_OPTS=\"\"


# Time to wait for Squid to shut down when asked. Should not be necessary

# most of the time.

SQUID_SHUTDOWN_TIMEOUT=100


# default squid conf file

SQUID_CONF=\"/etc/squid/squid.conf\"


##\u6ca1\u529e\u6cd5\u53ea\u80fd\u624b\u52a8\u542f\u4e86\uff0c\u5e0c\u671b\u6709\u5927\u795e\u5e2e\u5fd9\u770b\u770b

#/usr/sbin/squid -f /etc/squid/squid.conf 

"}, {"title": "Docker\u5b89\u88c5\u914d\u7f6eNGINX", "desc": "\u5b9e\u73b0NGINX\u914d\u7f6e\u4fdd\u5b58\u81f3DOCKER\u6bcd\u673a\uff0c\u9ed8\u8ba4\u7aef\u53e380\u6620\u5c04\u81f38888\u7aef\u53e3\u3002", "content": "

1.\u4e0b\u8f7dDOCKER\u955c\u50cf

\n

[root@localhost ~]# docker pull docker.io/nginx
\n\tUsing default tag: latest
\n\tTrying to pull repository docker.io/library/nginx ...
\n\tlatest: Pulling from docker.io/library/nginx
\n\t1ab2bdfe9778: Pull complete
\n\ta17e64cfe253: Pull complete
\n\te1288088c7a8: Pull complete
\n\tDigest: sha256:53ddb41e46de3d63376579acf46f9a41a8d7de33645db47a486de9769201fec9
\n\tStatus: Downloaded newer image for docker.io/nginx:latest

\n

2.\u65b0\u5efa\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55

\n

[root@localhost ~]#mkdir /data/nginx

\n

3.\u590d\u5236\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6

\n

[root@localhost ~]# docker run --name tmp-nginx-container -d nginx
\n\t00a9d08742a19039f04f77decf294844b7e00f53255bd573cc6900aa698a9d49

\n

[root@localhost data]# docker cp tmp-nginx-container:/etc/nginx/nginx.conf /data/nginx/nginx.conf

\n

[root@localhost nginx]# docker rm -f tmp-nginx-container
\n\ttmp-nginx-container

\n

\u9ed8\u8ba4\u7684 NGINX \u914d\u7f6e\u6587\u4ef6\u5e94\u8be5\u5df2\u7ecf\u88ab\u590d\u5236\u5230 /data/nginx/nginx.conf

\n

[root@localhost ~]# cat /data/nginx/nginx.conf
\n\t
\n\tuser  nginx;
\n\tworker_processes  1;
\n\t
\n\terror_log  /var/log/nginx/error.log warn;
\n\tpid        /var/run/nginx.pid;
\n\t
\n\t
\n\tevents {
\n\t    worker_connections  1024;
\n\t}
\n\t
\n\t
\n\thttp {
\n\t    include       /etc/nginx/mime.types;
\n\t    default_type  application/octet-stream;
\n\t
\n\t    log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '
\n\t                      '$status $body_bytes_sent \"$http_referer\" '
\n\t                      '\"$http_user_agent\" \"$http_x_forwarded_for\"';
\n\t
\n\t    access_log  /var/log/nginx/access.log  main;
\n\t
\n\t    sendfile        on;
\n\t    #tcp_nopush     on;
\n\t
\n\t    keepalive_timeout  65;
\n\t
\n\t    #gzip  on;
\n\t
\n\t    include /etc/nginx/conf.d/*.conf;
\n\t}

\n

----------------------------------\u534e\u4e3d\u5206\u9694\u7b26---------\u914d\u7f6e\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\u5b8c\u5728\u542f\u52a8\u5bb9\u5668----------------------

\n

4.\u5f00\u542f\u5bb9\u5668

\n

[root@localhost ~]# docker run -itd -p 8888:80 -v /data/nginx/nginx.conf:/etc/nginx/nginx.conf:ro  --restart always  --privileged=true --name nginx docker.io/nginx
\n\t8bfcf5f720850f52fea48ab73b5e1759b28359930af24b0abc27a00c26099814

\n

5.\u5f00\u542f\u9632\u706b\u5899\u7aef\u53e3

\n

[root@localhost ~]# firewall-cmd --zone=public --add-port=8888/tcp --permanent
\n\tWarning: ALREADY_ENABLED: 8888:tcp
\n\tsuccess
\n\t[root@localhost ~]# firewall-cmd --reload
\n\tsuccess

\n

 

\n"}, {"title": "Jenkins\u4ecesvn\u4e0b\u8f7dmaven\u9879\u76ee\u81ea\u52a8\u90e8\u7f72\u8bb0\u5f55", "desc": "\u6700\u8fd1\u9879\u76ee\u9891\u7e41\u9700\u8981\u91cd\u65b0\u90e8\u7f72\uff0c\u4fee\u6539\u6bcf\u6b21\u9700\u8981\u66ff\u6362\u6587\u4ef6\u4fee\u6539\u914d\u7f6e\u91cd\u65b0\u90e8\u7f72\u5f88\u8d39\u4e8b\u7814\u7a76\u4e86\u4e0bjenkins\u90e8\u7f72\uff0c\u603b\u4f53\u611f\u89c9\u529f\u80fd\u5f88\u5f3a\u5927\uff0c\u53ea\u662f\u4e0d\u591f\u50bb\u74dc\u5f0f\uff0c\u9700\u8981\u61c2\u5f97\u77e5\u8bc6\u9762\u5f88\u5e7f\u3002", "content": "

\u53d1\u4e0b\u6210\u529f\u65e5\u5fd7

\r\n
\r\n
\r\n
\r\n[JENKINS] Archiving /root/.jenkins/workspace/java/v8/base-v8/pom.xml to com.jschrj/base-v8/7.1/base-v8-7.1.pom [JENKINS] Archiving /root/.jenkins/workspace/java/v8/base-v8/target/base-v8-7.1.jar to com.jschrj/base-v8/7.1/base-v8-7.1.jar [java] $ /bin/sh -xe /tmp/jenkins1799568369565993586.sh channel stopped + /bin/sh -x /scripts/auto_push.sh + /opt/apache-tomcat-7.0.91/bin/shutdown.sh Using CATALINA_BASE: /opt/apache-tomcat-7.0.91 Using CATALINA_HOME: /opt/apache-tomcat-7.0.91 Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.91/temp Using JRE_HOME: /usr/java/jdk1.8.0_192-amd64/ Using CLASSPATH: /opt/apache-tomcat-7.0.91/bin/bootstrap.jar:/opt/apache-tomcat-7.0.91/bin/tomcat-juli.jar ++ ps -ef ++ grep tomcat ++ grep -v grep ++ awk '{print $2}' + TPID=11062 ++ date +%F + TIME=2019-07-08 + INSTALLDIR=/opt/apache-tomcat-7.0.91/webapps/ + '[' 11062 == ']' /scripts/auto_push.sh: line 24: [: 11062: unary operator expected + kill -9 11062 + cd /opt/apache-tomcat-7.0.91/webapps/ + cp -ar /root/.jenkins/workspace/java/v7/web-v7/target/web-v7.war /opt/apache-tomcat-7.0.91/webapps/ + /opt/apache-tomcat-7.0.91/bin/startup.sh Using CATALINA_BASE: /opt/apache-tomcat-7.0.91 Using CATALINA_HOME: /opt/apache-tomcat-7.0.91 Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.91/temp Using JRE_HOME: /usr/java/jdk1.8.0_192-amd64/ Using CLASSPATH: /opt/apache-tomcat-7.0.91/bin/bootstrap.jar:/opt/apache-tomcat-7.0.91/bin/tomcat-juli.jar Tomcat started. ++ netstat -lntup ++ grep 8081 ++ wc -l + RESULT=0 + '[' 0 -eq 1 ']' + /opt/apache-tomcat-7.0.91/bin/startup.sh 
\r\n
\r\nUsing CATALINA_BASE:   /opt/apache-tomcat-7.0.91\r\nUsing CATALINA_HOME:   /opt/apache-tomcat-7.0.91\r\nUsing CATALINA_TMPDIR: /opt/apache-tomcat-7.0.91/temp\r\nUsing JRE_HOME:        /usr/java/jdk1.8.0_192-amd64/\r\nUsing CLASSPATH:       /opt/apache-tomcat-7.0.91/bin/bootstrap.jar:/opt/apache-tomcat-7.0.91/bin/tomcat-juli.jar\r\nTomcat started.\r\n
\r\n
\r\nFinished: SUCCESS
\r\n

\u9047\u5230\u7684\u51e0\u4e2a\u5751

\r\n

\u7b2c\u4e00\u5751

\r\n
\r\n4.7.2.jar,/root/.m2/repository/com/oracle/ojdbc14/10.2.0.4.0/ojdbc14-10.2.0.4.0.jar,/root/.m2/repository/com/zhuozhengsoft/pageoffice/4.3.0.2/pageoffice-4.3.0.2.jar,.]\r\n\u81f4\u547d\u9519\u8bef: \u5728\u7c7b\u8def\u5f84\u6216\u5f15\u5bfc\u7c7b\u8def\u5f84\u4e2d\u627e\u4e0d\u5230\u7a0b\u5e8f\u5305 java.lang\r\n[INFO] -------------------------------------------------------------\r\n[ERROR] COMPILATION ERROR : \r\n[INFO] -------------------------------------------------------------\r\n[ERROR] An unknown compilation problem occurred\r\n[INFO] 1 error\r\n[INFO] -------------------------------------------------------------\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Reactor Summary:\r\n[INFO] \r\n[INFO] ygxf ............................................... SUCCESS [  2.680 s]\r\n[INFO] common ............................................. FAILURE [ 20.796 s]\r\n[INFO] model .............................................. SKIPPED\r\n[INFO] v7 ................................................. SKIPPED\r\n[INFO] server-v7 .......................................... SKIPPED\r\n[INFO] web-v7 ............................................. SKIPPED\r\n[INFO] v8 ................................................. SKIPPED\r\n[INFO] api-v8 ............................................. SKIPPED\r\n[INFO] server-v8 .......................................... SKIPPED\r\n[INFO] web-v8 ............................................. SKIPPED\r\n[INFO] base-v8 ............................................ SKIPPED\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD FAILURE\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 25.735 s\r\n[INFO] Finished at: 2019-07-07T16:04:12+08:00\r\n[INFO] Final Memory: 33M/245M\r\n[INFO] ------------------------------------------------------------------------\r\nWaiting for Jenkins to finish collecting data\r\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project common: Compilation failure\r\n[ERROR] An unknown compilation problem occurred\r\n[ERROR] -> [Help 1]\r\n[ERROR] \r\n[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.\r\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.\r\n[ERROR] \r\n[ERROR] For more information about the errors and possible solutions, please read the following articles:\r\n[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException\r\n[ERROR] \r\n[ERROR] After correcting the problems, you can resume the build with the command\r\n[ERROR]   mvn <goals> -rf :common
\r\n

\u8fd9\u4e2a\u9519\u6709\u4eba\u8bf4\u662fJDK\u7684\u95ee\u9898\uff0c\u4e5f\u53ef\u80fd\u662f\u4e2a\u4eba\u9879\u76ee pom.xml \u914d\u7f6e\u6587\u4ef6\u7684\u95ee\u9898\u3002\u6211\u4eec\u8fd9\u4e2a\u9879\u76ee\u914d\u7f6e\u95ee\u9898\u3002

\r\n
\r\n<plugins>\r\n    <plugin>\r\n        <groupId>org.apache.maven.plugins</groupId>\r\n        <artifactId>maven-compiler-plugin</artifactId>\r\n        <version>3.8.0</version>\r\n        <configuration>\r\n            <source>1.8</source>\r\n            <target>1.8</target>\r\n            <compilerArguments>\r\n                <verbose />\r\n                <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>\r\n            </compilerArguments>\r\n        </configuration>\r\n    </plugin>\r\n</plugins>
\r\n

\u89e3\u51b3\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5220\u9664/\u6ce8\u89e3<bootclasspath>\u8fd9\u4e00\u884c\uff0c\u6211\u7684\u89e3\u51b3\u65b9\u6cd5\u662f\u4ecejre\u76ee\u5f55\u628a\u8fd9\u4e24\u4e2a\u6587\u4ef6\u590d\u5236\u5230JAVA_HOME\u4e0b\uff0c\u6ce8\u610f\u4e2d\u95f4\u7684 : \u53f7\u3002\u516c\u53f8\u5f00\u53d1\u7528\u7684\u662fWindows\u7cfb\u7edf \u7528 ; \u53f7\uff0cjenkins\u90e8\u7f72\u5728linux\u4e0b\u9700\u8981\u4fee\u6539\u4e3a : \u53f7\u3002

\r\n

 

\r\n"}, {"title": "\u591aJDK\u73af\u5883\u4e0b\u8bbe\u7f6eTOMCAT\u4f7f\u7528\u7684JDK\u7248\u672c", "desc": "\u7531\u4e8e\u8001\u9879\u76ee\u548c\u65b0\u9879\u76ee\u90e8\u7f72\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\uff0c\u8001\u9879\u76ee\u4f7f\u7528\u7684\u662fTOMCAT 6\u30017\uff0cJDK\u7248\u672c\u4e3a1.7\u3002\u65b0\u9879\u76ee\u5fc5\u987b\u4f7f\u7528JDK1.8\uff0c\u6240\u4ee5TOMCAT\u7248\u672c\u5fc5\u987b\u4e3a8\u6216\u80059\uff0c\u6ce8\u610fTOMCAT9\u4e0d\u652f\u6301JDK1.7\u3002", "content": "

\u8bbe\u7f6e\u65b9\u6cd5\uff1a

\r\n

1.\u7f16\u8f91  apache-tomcat-8.5.40\\bin \u76ee\u5f55\u4e0b setclasspath.bat \uff0c\u8bbe\u7f6eJAVA_HOME \u548c JRE_HOME\u3002\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9

\r\n

set JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_181
\r\n\tset JRE_HOME=C:\\Program Files\\Java\\jre1.8.0_181

\r\n

2.\u7f16\u8f91  apache-tomcat-8.5.40\\bin \u76ee\u5f55\u4e0b startup.bat ,\u8bbe\u7f6eCATALINA_HOME \u3002\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9

\r\n

SET CATALINA_HOME=D:\\application9001\\apache-tomcat-8.5.20

\r\n

\u8fd9\u6837\u5c31\u53ef\u4ee5\u8ba9 TOMCAT 8 \u5c31\u4e0d\u7528\u8c03\u7528\u7cfb\u7edf\u8bbe\u7f6e\u7684JAVA \u53d8\u91cf\u5bfc\u81f4\u542f\u52a8\u4e0d\u8d77\u6765\u4e86\uff08\u75c7\u72b6\u5c31\u662f\u65e0\u4efb\u4f55\u53cd\u5e94\u4e00\u95ea\u5c31\u6ca1\u4e86\uff0c\u53ef\u4ee5\u5728cmd\u91cc\u9762\u8fd0\u884c startup.cmd \u6392\u67e5\u95ee\u9898\uff09

\r\n"}, {"title": "Stack trace: ExitCodeException exitCode=13: ", "desc": "Spark yarn\u96c6\u7fa4\u62a5\u9519\uff0c", "content": "

\u63d0\u4ea4\u811a\u672c\uff1a

\n

[root@sxfj-ysfwq-10-4-22-16 jxDsjPro]# more testshell.sh
\n\t/usr/local/spark-2.1.0/bin/spark-submit \\
\n\t--class com.jschrj.jxdsjProject.test.SparkTest \\
\n\t--master yarn \\
\n\t--deploy-mode cluster \\
\n\t--executor-memory 7G \\
\n\t--num-executors 50 \\
\n\t/usr/local/jxDsjPro/haDsj_wxmjcxx-jar-with-dependencies.jar \\

\n

\u62a5\u9519\u90e8\u5206\u8be6\u60c5\uff1a

\n

 ACCEPTED)
\n\t19/05/07 10:27:06 INFO yarn.Client: Application report for application_1557195712596_0001 (state: ACCEPTED)
\n\t19/05/07 10:27:07 INFO yarn.Client: Application report for application_1557195712596_0001 (state: ACCEPTED)
\n\t19/05/07 10:27:08 INFO yarn.Client: Application report for application_1557195712596_0001 (state: ACCEPTED)
\n\t19/05/07 10:27:09 INFO yarn.Client: Application report for application_1557195712596_0001 (state: ACCEPTED)
\n\t19/05/07 10:27:10 INFO yarn.Client: Application report for application_1557195712596_0001 (state: ACCEPTED)
\n\t19/05/07 10:27:11 INFO yarn.Client: Application report for application_1557195712596_0001 (state: ACCEPTED)
\n\t19/05/07 10:27:12 INFO yarn.Client: Application report for application_1557195712596_0001 (state: ACCEPTED)
\n\t19/05/07 10:27:13 INFO yarn.Client: Application report for application_1557195712596_0001 (state: FAILED)
\n\t19/05/07 10:27:13 INFO yarn.Client:
\n\t         client token: N/A
\n\t         diagnostics: Application application_1557195712596_0001 failed 2 times due to AM Container for appattempt_1557195712596_0001_000002 exited with  exitCode: 13
\n\tFor more detailed output, check application tracking page:http://Master:8088/cluster/app/application_1557195712596_0001Then, click on links to logs of each attempt.
\n\tDiagnostics: Exception from container-launch.
\n\tContainer id: container_1557195712596_0001_02_000001
\n\tExit code: 13
\n\tStack trace: ExitCodeException exitCode=13:
\n\t        at org.apache.hadoop.util.Shell.runCommand(Shell.java:585)
\n\t        at org.apache.hadoop.util.Shell.run(Shell.java:482)
\n\t        at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:776)
\n\t        at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:212)
\n\t        at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
\n\t        at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
\n\t        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
\n\t        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
\n\t        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
\n\t        at java.lang.Thread.run(Thread.java:748)
\n\t
\n\t
\n\tContainer exited with a non-zero exit code 13
\n\tFailing this attempt. Failing the application.
\n\t         ApplicationMaster host: N/A
\n\t         ApplicationMaster RPC port: -1
\n\t         queue: default
\n\t         start time: 1557195809037
\n\t         final status: FAILED
\n\t         tracking URL: http://Master:8088/cluster/app/application_1557195712596_0001
\n\t         user: root
\n\tException in thread \"main\" org.apache.spark.SparkException: Application application_1557195712596_0001 finished with failed status
\n\t        at org.apache.spark.deploy.yarn.Client.run(Client.scala:1167)
\n\t        at org.apache.spark.deploy.yarn.Client$.main(Client.scala:1213)
\n\t        at org.apache.spark.deploy.yarn.Client.main(Client.scala)
\n\t        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\n\t        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
\n\t        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
\n\t        at java.lang.reflect.Method.invoke(Method.java:498)
\n\t        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:738)
\n\t        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:187)
\n\t        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:212)
\n\t        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:126)
\n\t        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
\n\t19/05/07 10:27:13 INFO util.ShutdownHookManager: Shutdown hook called
\n\t19/05/07 10:27:13 INFO util.ShutdownHookManager: Deleting directory /tmp/spark-c9ad4e51-01b9-4712-b0f7-2cfac53e348f

\n

\u62a5\u9519\u539f\u56e0\uff1aexitCode=13\u662f\u7531\u4e8e\u96c6\u7fa4\u6a21\u5f0f\u51b2\u7a81

\n

\u89e3\u51b3\u65b9\u6cd5\uff1a

\n

\u53bb\u6389\u7a0b\u5e8f\u4e2d\u7684\u6307\u5b9amaster\u7684\u4ee3\u7801\u4e2d\u7684.master(MASTER)

\n

SparkSession.builder().appName(APP_NAME).master(MASTER)

\n

 

\n"}, {"title": "Tomcat9.0\u5b89\u88c5 Apache Tomcat Native Library\u62a5\u9519", "desc": "Tomcat\u652f\u6301HTTP/2.0\u5fc5\u987b\u8981\u5b89\u88c5bin/tomcat-native-1.2.10-src/native\u4f9d\u8d56\u3002", "content": "

\u5b89\u88c5Apache Tomcat Native Library\u62a5\u9519\u90e8\u5206\u4fe1\u606f

\r\n

l.lo src/proc.lo src/shm.lo src/ssl.lo src/sslcontext.lo src/sslinfo.lo src/sslnetwork.lo src/sslutils.lo src/stdlib.lo src/thread.lo src/user.lo os/unix/system.lo os/unix/uxpipe.lo -L/usr/local/openssl1.0.2/lib -Wl,-rpath,/usr/local/openssl1.0.2/lib -lssl -lcrypto  /usr/local/apr1.7/lib/libapr-1.la -lrt -lcrypt  -lpthread
\r\n\t/usr/bin/ld: /usr/local/openssl1.0.2/lib/libssl.a(s3_meth.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
\r\n\t/usr/local/openssl1.0.2/lib/libssl.a: could not read symbols: Bad value
\r\n\tcollect2: ld returned 1 exit status
\r\n\tmake[1]: *** [libtcnative-1.la] Error 1
\r\n\tmake[1]: Leaving directory `/opt/tomcat9/bin/tomcat-native-1.2.10-src/native'
\r\n\tmake: *** [all-recursive] Error 1

\r\n

\u5f88\u660e\u663e\u662fssllib\u62a5\u9519\uff0c\u8fd9\u91cc\u9700\u8981\u5c06openssl\u5220\u9664\u91cd\u65b0\u4f7f\u7528 tar -xf \u89e3\u538b\u3002\u914d\u7f6e\u7684\u65f6\u5019\u9700\u8981\u52a0 -fPIC \u53c2\u6570

\r\n

[root@iZ35fysdmc9Z openssl-1.0.2r]# ./config --prefix=/usr/local/openssl1.0.2/ -fPIC

\r\n

\u91cd\u65b0make make install

\r\n

\u518d\u6b21\u5b89\u88c5apr\u5c31\u6b63\u5e38\u4e86

\r\n

[root@iZ35fysdmc9Z native]# make install
\r\n\tlibtool: install: (cd /usr/local/apr/lib && { ln -s -f libtcnative-1.so.0.2.10 libtcnative-1.so || { rm -f libtcnative-1.so && ln -s libtcnative-1.so.0.2.10 libtcnative-1.so; }; })
\r\n\tlibtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.lai /usr/local/apr/lib/libtcnative-1.la
\r\n\tlibtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.a /usr/local/apr/lib/libtcnative-1.a
\r\n\tlibtool: install: chmod 644 /usr/local/apr/lib/libtcnative-1.a
\r\n\tlibtool: install: ranlib /usr/local/apr/lib/libtcnative-1.a
\r\n\tlibtool: finish: PATH="/usr/java/jdk1.8.0_60/bin:/usr/java/jdk1.8.0_60/jre/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/apr/lib
\r\n\t----------------------------------------------------------------------
\r\n\tLibraries have been installed in:
\r\n\t   /usr/local/apr/lib
\r\n\t
\r\n\tIf you ever happen to want to link against installed libraries
\r\n\tin a given directory, LIBDIR, you must either use libtool, and
\r\n\tspecify the full pathname of the library, or use the '-LLIBDIR'
\r\n\tflag during linking and do at least one of the following:
\r\n\t   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
\r\n\t     during execution
\r\n\t   - add LIBDIR to the 'LD_RUN_PATH' environment variable
\r\n\t     during linking
\r\n\t   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
\r\n\t   - have your system administrator add LIBDIR to '/etc/ld.so.conf'
\r\n\t
\r\n\tSee any operating system documentation about shared libraries for
\r\n\tmore information, such as the ld(1) and ld.so(8) manual pages.

\r\n

\u6ce8\u610f\u963f\u91cc\u4e91 CENTOS 6\u81ea\u5e26\u7248\u672c\u4e3a

\r\n

[root@iZ35fysdmc9Z openssl1.0.2]# rpm -qa openssl
\r\n\topenssl-1.0.1e-57.el6.x86_64

\r\n

\u5b89\u88c5Apache Tomcat Native Library\u9700\u8981\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5 openssl1.0.2 \u4ee5\u4e0a\u7248\u672c\u3002

\r\n

./configure --with-apr=/usr/local/apr1.7 --with-ssl=/usr/local/openssl1.0.2

\r\n

 

\r\n

 

\r\n"}, {"title": "Squid\u4ee3\u7406HTTPS", "desc": "\u624b\u75d2\u5c06\u5185\u90e8\u9875\u9762\u670d\u52a1\u5668\u7684TOMCAT\u505a\u4e86HTTPS\u5e76\u652f\u6301HTTP/2.0\uff0c\u7531\u4e8e\u6211\u7684SQUID\u8fd8\u6709\u5176\u5b83\u4e1a\u52a1\u7f16\u8bd1\u5b89\u88c5\u7684\u65f6\u5019\u6ca1\u6709\u652f\u6301SSL\u3002\u53ea\u80fdSQUID\u53ea\u80fd\u4f7f\u7528HTTP\u8bbf\u95ee\uff0cTOMCAT\u7684HTTPS.", "content": "

\u76f4\u63a5\u7ed9\u51fa\u90e8\u5206\u914d\u7f6e\u4fe1\u606f

\r\n

 

\r\n

visible_hostname iZ35qa0aahiZ
\r\n\t
\r\n\thttp_port 80 vhost vport
\r\n\t
\r\n\tcache_peer 172.16.151.61 parent 443 0 no-query originserver ssl sslflags=DONT_VERIFY_PEER name=zhoudl
\r\n\t cache_peer_domain zhoudl zhoudl.com www.zhoudl.com www.chaxiaoguai.com chaxiaoguai.com zhoudl.jschrj.com

\r\n

\u4e3b\u8981\u662f\u591a\u4e86\u4e24\u4e2a\u53c2\u6570  ssl sslflags=DONT_VERIFY_PEE

\r\n

sslflags\u6211\u9009\u62e9\u7684 DONT_VERIFY_PEE \u5373\u4f7f\u8bc1\u4e66\u5931\u8d25\uff0c\u4e5f\u8981\u63a5\u53d7\u8bc1\u4e66\u9a8c\u8bc1\u3002\u4e0d\u7136\u4f1a\u62a5\u8bc1\u4e66\u5bf9\u7b49\u9519\u8bef\u3002

\r\n

  NONE/400 4023 NONE error:invalid-request - NONE/- text/html

\r\n

\u6ca1\u529e\u6cd5\u5c1d\u8bd5\u914d\u7f6e SQUID\u4f7f\u7528https\u8bbf\u95ee\u5f88\u53ef\u60dc\u3002

\r\n

TOMCAT\u540e\u53f0\u8bbf\u95ee\u65e5\u5fd7\u8868\u793a\u652f\u6301HTTP/2.0\u6ca1\u95ee\u9898\u3002

\r\n

172.16.150.128 - - [26/Apr/2019:10:20:24 +0800] "GET /admin/index.do HTTP/1.1" 302 -
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:24 +0800] "GET /admin/index.do HTTP/2.0" 302 -
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:24 +0800] "GET /admin/index.do HTTP/1.1" 302 -
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:24 +0800] "GET /admin/index.do HTTP/2.0" 302 -
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /admin/login.do HTTP/2.0" 200 4037
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /admin/login.do HTTP/2.0" 200 4037
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/jeecms/js/admin.js HTTP/2.0" 200 1453
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /thirdparty/My97DatePicker/WdatePicker.js HTTP/2.0" 200 7589
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/js/jeecms.js HTTP/2.0" 200 5359
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/js/jquery.ext.js HTTP/2.0" 200 4759
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/js/jquery.js HTTP/2.0" 200 132514
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/jeecms/css/admin.css HTTP/2.0" 200 4979
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/css/jquery.treeview.css HTTP/2.0" 200 2721
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/css/theme.css HTTP/2.0" 200 18286
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/css/jquery.ui.css HTTP/2.0" 200 28873
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/css/jquery.validate.css HTTP/2.0" 200 85
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/jeecms/img/login/ltop.jpg HTTP/2.0" 200 2770
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/jeecms/img/login/llogo.jpg HTTP/2.0" 200 9713
\r\n\t172.16.150.128 - - [26/Apr/2019:10:20:25 +0800] "GET /res/common/js/jquery-ui.js HTTP/2.0" 200 131509

\r\n"}, {"title": "Tomcat9\u901a\u8fc7APR\u5b9e\u73b0HTTP/2.0\u548cSSL", "desc": "HTTP/2.0\u53ea\u6709tomcat8.5\u4ee5\u4e0a\u7248\u672c\u624d\u80fd\u5b9e\u73b0\u53ef\u4ee5\u770b\u5b98\u65b9\u6587\u6863Connectors\u7684HTTP/2\u90e8\u5206\u6587\u6863\u5730\u5740https://tomcat.apache.org/tomcat-9.0-doc/config/index.html\r\n\u4f4e\u7248\u672c\u542f\u7528\u53ef\u53c2\u8003Apache Portable Runtime (APR) based Native library for Tomcat\u7ae0\u8282https://tomcat.apache.org/tomcat-9.0-doc/apr.html", "content": "

Tomcat\u652f\u6301\u4e09\u79cd\u63a5\u6536\u8bf7\u6c42\u7684\u5904\u7406\u65b9\u5f0f\uff1aBIO\u3001NIO\u3001APR

\n

1>\u3001BIO\u6a21\u5f0f\uff1a\u963b\u585e\u5f0fI/O\u64cd\u4f5c\uff0c\u8868\u793aTomcat\u4f7f\u7528\u7684\u662f\u4f20\u7edfJava I/O\u64cd\u4f5c(\u5373java.io\u5305\u53ca\u5176\u5b50\u5305)\u3002Tomcat7\u4ee5\u4e0b\u7248\u672c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u4ee5bio\u6a21\u5f0f\u8fd0\u884c\u7684\uff0c\u7531\u4e8e\u6bcf\u4e2a\u8bf7\u6c42\u90fd\u8981\u521b\u5efa\u4e00\u4e2a\u7ebf\u7a0b\u6765\u5904\u7406\uff0c\u7ebf\u7a0b\u5f00\u9500\u8f83\u5927\uff0c\u4e0d\u80fd\u5904\u7406\u9ad8\u5e76\u53d1\u7684\u573a\u666f\uff0c\u5728\u4e09\u79cd\u6a21\u5f0f\u4e2d\u6027\u80fd\u4e5f\u6700\u4f4e\u3002\u542f\u52a8tomcat\u770b\u5230\u5982\u4e0b\u65e5\u5fd7\uff0c\u8868\u793a\u4f7f\u7528\u7684\u662fBIO\u6a21\u5f0f\uff1a
\n\t2>\u3001NIO\u6a21\u5f0f\uff1a\u662fJava SE 1.4\u53ca\u540e\u7eed\u7248\u672c\u63d0\u4f9b\u7684\u4e00\u79cd\u65b0\u7684I/O\u64cd\u4f5c\u65b9\u5f0f(\u5373java.nio\u5305\u53ca\u5176\u5b50\u5305)\u3002\u662f\u4e00\u4e2a\u57fa\u4e8e\u7f13\u51b2\u533a\u3001\u5e76\u80fd\u63d0\u4f9b\u975e\u963b\u585eI/O\u64cd\u4f5c\u7684Java API\uff0c\u5b83\u62e5\u6709\u6bd4\u4f20\u7edfI/O\u64cd\u4f5c(bio)\u66f4\u597d\u7684\u5e76\u53d1\u8fd0\u884c\u6027\u80fd\u3002\u8981\u8ba9Tomcat\u4ee5nio\u6a21\u5f0f\u6765\u8fd0\u884c\u6bd4\u8f83\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728Tomcat\u5b89\u88c5\u76ee\u5f55/conf/server.xml\u6587\u4ef6\u4e2d\u5c06\u5982\u4e0b\u914d\u7f6e\uff1a
\n\t\u6ce8\u610f\uff1aTomcat8\u4ee5\u4e0a\u7248\u672c\uff0c\u9ed8\u8ba4\u4f7f\u7528\u7684\u5c31\u662fNIO\u6a21\u5f0f\uff0c\u4e0d\u9700\u8981\u989d\u5916\u4fee\u6539

\n

3>\u3001apr\u6a21\u5f0f\uff1a\u7b80\u5355\u7406\u89e3\uff0c\u5c31\u662f\u4ece\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u522b\u89e3\u51b3\u5f02\u6b65IO\u95ee\u9898\uff0c\u5927\u5e45\u5ea6\u7684\u63d0\u9ad8\u670d\u52a1\u5668\u7684\u5904\u7406\u548c\u54cd\u5e94\u6027\u80fd\uff0c \u4e5f\u662fTomcat\u8fd0\u884c\u9ad8\u5e76\u53d1\u5e94\u7528\u7684\u9996\u9009\u6a21\u5f0f\u3002

\n

\u4e0b\u9762\u4e3b\u8bb2Tomcat9\u901a\u8fc7APR\u5b9e\u73b0HTTP/2.0\u548cSSL \uff08TOMCAT\u7248\u672c9.0.17\uff0c\u64cd\u4f5c\u7cfb\u7edfCentos7,JDK\u7248\u672c8u192.\u5b89\u88c5\u6b65\u9aa4\u548c\u8bbe\u7f6e\u7701\u7565\uff0c\u8bf7\u770b\u5176\u4ed6\u6587\u7ae0\uff09

\n

#yum install autoconf libtool openssl openssl-devel \u5b89\u88c5\u4f9d\u8d56

\n

1.\u5b89\u88c5APR  \u4e0b\u8f7d\u5730\u5740 http://apr.apache.org/download.cgi
\n\t\u89e3\u538b\u8fd0\u884c
\n\t./configure --prefix=/usr/local/apr1.7 //\u5b89\u88c5\u5230\u6307\u5b9a\u7684\u76ee\u5f55\u4e0b,\u53ef\u4ee5\u4e0d\u6307\u5b9a,\u9ed8\u8ba4\u76ee\u5f55\u5728/usr/local
\n\tmake
\n\tmake install

\n

2.\u751f\u6210\u8bc1\u4e66

\n

\u770b\u5b98\u65b9\u539f\u6587\u6863

\n

Tomcat currently operates only on JKS, PKCS11 or PKCS12 format keystores. The JKS format is Java's standard \"Java KeyStore\" format, and is the format created by the keytool command-line utility. This tool is included in the JDK. The PKCS12 format is an internet standard, and can be manipulated via (among other things) OpenSSL and Microsoft's Key-Manager.

\n

\u5927\u6982\u610f\u601d\u662ftomcat\u53ea\u652f\u6301JKS,PKCS11\u6216\u8005PKCS12\u4e09\u79cd\u52a0\u5bc6\u65b9\u5f0f\uff0cJKS\u53ef\u4ee5\u4f7f\u7528 JDK\u81ea\u5e26\u7684 keytool \u5de5\u5177\u751f\u6210\u3002\u5269\u4e0b\u7684\u4e24\u79cd\u52a0\u5bc6\u65b9\u5f0f\u53ef\u4ee5\u4f7f\u7528 OpenSSL \u6216\u8005 Microsoft's Key-Manager \u751f\u6210\u3002\u6ce8\u610f \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0copenssl \u8f93\u51fa\u683c\u5f0f\u4e3a PKCS#1-PEM\u3002

\n

\u5b98\u65b9\u7ed9\u51fa\u7684 openssl \u547d\u4ee4\u811a\u672c

\n
openssl pkcs12 -export -in mycert.crt -inkey mykey.key\n                       -out mycert.p12 -name tomcat -CAfile myCA.crt\n                       -caname root -chain
\n

\u6211\u8fd9\u91cc\u4f7f\u7528\u7684\u662f JKS \uff0c\u4f7f\u7528 JDK \u81ea\u5e26\u7684 keytool \u751f\u6210\uff0c\u8bbe\u7f6e\u7684\u65f6\u5019\u8f93\u5165\u5bc6\u7801\u4e3a123456 \u914d\u7f6e\u4e2d\u9700\u8981\u505a\u76f8\u5e94\u66f4\u6539\u3002
\n\t$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore /root/.keystore

\n

3.\u5b9e\u73b0Apr\u8bbf\u95ee\uff1a\u4fee\u6539tomcat\u7684server.xml\u914d\u7f6e
\n\t\u901a\u8fc7APR\u5b9e\u73b0,\u4e3b\u8981\u4ee3\u7801\u3002
\n\t     <Connector port=\"443\" protocol=\"org.apache.coyote.http11.Http11AprProtocol\"
\n\t               maxThreads=\"150\" SSLEnabled=\"true\">
\n\t        <UpgradeProtocol className=\"org.apache.coyote.http2.Http2Protocol\" />
\n\t        <SSLHostConfig>
\n\t            <Certificate certificatekeystoreFile=\"/root/.keystore\"
\n\t             certificateKeystorePassword=\"123456\"
\n\t                         type=\"RSA\" />
\n\t        </SSLHostConfig>
\n\t    </Connector>

\n

4.\u8bbe\u7f6ehttp\u81ea\u52a8\u8df3\u8f6c\u4e3ahttps
\n\t\u914d\u7f6econf\u76ee\u5f55\u4e0bweb.xml\u6587\u4ef6\uff0c\u5728\u8be5\u6587\u4ef6\u540e\u9762\u52a0\u4e0a\u8fd9\u6837\u4e00\u6bb5\uff1a
\n\t  
\n\t     
\n\t<login-config>  
\n\t    <!-- Authorization setting for SSL -->  
\n\t    <auth-method>CLIENT-CERT</auth-method>  
\n\t    <realm-name>Client Cert Users-only Area</realm-name>  
\n\t</login-config>  
\n\t<security-constraint>  
\n\t    <!-- Authorization setting for SSL -->  
\n\t    <web-resource-collection >  
\n\t        <web-resource-name >SSL</web-resource-name>  
\n\t        <url-pattern>/*</url-pattern>  
\n\t    </web-resource-collection>  
\n\t    <user-data-constraint>  
\n\t        <transport-guarantee>CONFIDENTIAL</transport-guarantee>  
\n\t    </user-data-constraint>  
\n\t</security-constraint>

\n\t

\n

5.\u91cd\u65b0\u542f\u52a8Tomcat

\n

6.\u68c0\u67e5\u662f\u5426\u6210\u529f\uff0c\u67e5\u770blogs\u76ee\u5f55\u4e0blocalhost_access_log.2019-04-12.txt\u6587\u4ef6\u7c7b\u5bb9\u786e\u8ba4\u662f\u5426\u652f\u6301HTTP/2\u534f\u8bae

\n

192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET / HTTP/1.1\" 302 -
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET / HTTP/2.0\" 200 11266
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET /tomcat.css HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET /tomcat.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET /bg-nav.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET /asf-logo-wide.svg HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET /bg-middle.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET /bg-upper.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:07:46 +0800] \"GET /bg-button.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:22 +0800] \"-\" 400 2244
\n\t192.168.1.168 - - [12/Apr/2019:18:14:25 +0800] \"GET / HTTP/1.1\" 302 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:25 +0800] \"GET / HTTP/2.0\" 200 11266
\n\t192.168.1.168 - - [12/Apr/2019:18:14:26 +0800] \"GET /tomcat.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:26 +0800] \"GET /tomcat.css HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:26 +0800] \"GET /bg-nav.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:26 +0800] \"GET /bg-upper.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:26 +0800] \"GET /bg-middle.png HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:26 +0800] \"GET /asf-logo-wide.svg HTTP/2.0\" 304 -
\n\t192.168.1.168 - - [12/Apr/2019:18:14:26 +0800] \"GET /bg-button.png HTTP/2.0\" 304 -

\n

 

\n

\u53d1\u73b0\u95ee\u9898\u4f7f\u7528IE\u6d4f\u89c8\u5668\u8bbf\u95ee\u662f\u7528\u7684 HTTP/1.1 \u706b\u72d0\u6d4f\u89c8\u5668\u8bbf\u95ee HTTP/2.0 \u4ee5\u540e\u5728\u627e\u539f\u56e0\u4e86\uff0c\u8fd8\u6ca1\u6d4b\u8bd5\u5927\u5e76\u53d1\u6027\u80fd\u662f\u5426\u6709\u6240\u63d0\u5347\u3002

\n"}, {"title": "\u5e94\u7528\u7a0b\u5e8f\u6c60\u201cDefaultAppPool\u201d\u5c06\u88ab\u81ea\u52a8\u7981\u7528,\u539f\u56e0\u662f\u4e3a\u6b64\u5e94\u7528\u7a0b\u5e8f\u6c60\u63d0\u4f9b\u670d\u52a1\u7684\u8fdb\u7a0b", "desc": "\u8fd9\u4e2a\u9519\u8bef\u4e3b\u8981\u662f\u8868\u73b0\u5728WINDOWS2008R2 \u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b89\u88c5IIS\u7684\u65f6\u5019\u5b89\u88c5\u9519\u8bef\u5bfc\u81f4\u7684\u3002", "content": "

\u5e94\u7528\u7a0b\u5e8f\u6c60“DefaultAppPool”\u5c06\u88ab\u81ea\u52a8\u7981\u7528,\u539f\u56e0\u662f\u4e3a\u6b64\u5e94\u7528\u7a0b\u5e8f\u6c60\u63d0\u4f9b\u670d\u52a1\u7684\u8fdb\u7a0b\u200b,\u4e8b\u4ef6ID 5002.

\r\n

\u7f51\u4e0a\u597d\u591a\u6559\u7a0b\u90fd\u662f\u4ece\u670d\u52a1\u5668\u7ba1\u7406\u5668\u91cc\u9762--\u6dfb\u52a0\u529f\u80fd--\u9009\u62e9\u5230 \u8fdc\u7a0b\u670d\u52a1\u5668\u7ba1\u7406\u5de5\u5177---\u89d2\u8272\u7ba1\u7406\u5de5\u5177--- Web \u670d\u52a1\u5668\uff08IIS\uff09\u5de5\u5177\u6765\u5b89\u88c5\u7684\u3002

\r\n

\u7528\u8fd9\u79cd\u65b9\u6cd5\u5b89\u88c5\u5bfc\u5165\u5171\u4eab\u914d\u7f6e\u4ee5\u540e\u4f1a\u51fa\u73b0 \u9875\u9762\u6d4f\u89c8\u62a5 503 \u9519\u8bef\uff0c\u540e\u53f0\u65e5\u5fd7\u62a5\u4e8b\u4ef6ID 5002.

\r\n

\u65e5\u5fd7\u540d\u79f0:          System
\r\n\t\u6765\u6e90:            Microsoft-Windows-WAS
\r\n\t\u65e5\u671f:            2018/1/24 21:48:57
\r\n\t\u4e8b\u4ef6 ID:         5002
\r\n\t\u4efb\u52a1\u7c7b\u522b:          \u65e0
\r\n\t\u7ea7\u522b:            \u9519\u8bef
\r\n\t\u5173\u952e\u5b57:           \u7ecf\u5178
\r\n\t\u7528\u6237:            \u6682\u7f3a
\r\n\t\u8ba1\u7b97\u673a:           WIN-7BPO7SH1PG7
\r\n\t\u63cf\u8ff0:
\r\n\t\u5e94\u7528\u7a0b\u5e8f\u6c60“Classic .NET AppPool”\u5c06\u88ab\u81ea\u52a8\u7981\u7528\uff0c\u539f\u56e0\u662f\u4e3a\u6b64\u5e94\u7528\u7a0b\u5e8f\u6c60\u63d0\u4f9b\u670d\u52a1\u7684\u8fdb\u7a0b\u4e2d\u51fa\u73b0\u4e00\u7cfb\u5217\u9519\u8bef\u3002\u4e8b\u4ef6ID 5002 \u6765\u6e90WAS

\r\n

\u4e8b\u4ef6 Xml:
\r\n\t<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
\r\n\t  <System>
\r\n\t    <Provider Name="Microsoft-Windows-WAS" Guid="{524B5D04-133C-4A62-8362-64E8EDB9CE40}" EventSourceName="WAS" />
\r\n\t    <EventID Qualifiers="49152">5002</EventID>
\r\n\t    <Version>0</Version>
\r\n\t    <Level>2</Level>
\r\n\t    <Task>0</Task>
\r\n\t    <Opcode>0</Opcode>
\r\n\t    <Keywords>0x80000000000000</Keywords>
\r\n\t    <TimeCreated SystemTime="2018-01-24T13:48:57.000000000Z" />
\r\n\t    <EventRecordID>26978</EventRecordID>
\r\n\t    <Correlation />
\r\n\t    <Execution ProcessID="0" ThreadID="0" />
\r\n\t    <Channel>System</Channel>
\r\n\t    <Computer>WIN-7BPO7SH1PG7</Computer>
\r\n\t    <Security />
\r\n\t  </System>
\r\n\t  <EventData>
\r\n\t    <Data Name="AppPoolID">Classic .NET AppPool</Data>
\r\n\t    <Binary>
\r\n\t    </Binary>
\r\n\t  </EventData>
\r\n\t</Event>

\r\n

\u8fd8\u6709\u5982\u4e0b\u8b66\u544a\uff1a

\r\n

\u5728\u4e3a\u5e94\u7528\u7a0b\u5e8f\u6c60“Classic .NET AppPool”\u63d0\u4f9b\u670d\u52a1\u7684\u5de5\u4f5c\u8fdb\u7a0b“5916”\u4e2d\uff0c\u534f\u8bae“http”\u7684\u4fa6\u542c\u5668\u901a\u9053\u62a5\u544a\u4e86\u4fa6\u542c\u5668\u901a\u9053\u9519\u8bef\u3002\u6570\u636e\u5b57\u6bb5\u5305\u542b\u9519\u8bef\u53f7\u3002

\r\n

\u65e5\u5fd7\u540d\u79f0:          System
\r\n\t\u6765\u6e90:            Microsoft-Windows-WAS
\r\n\t\u65e5\u671f:            2018/1/24 21:48:57
\r\n\t\u4e8b\u4ef6 ID:         5139
\r\n\t\u4efb\u52a1\u7c7b\u522b:          \u65e0
\r\n\t\u7ea7\u522b:            \u8b66\u544a
\r\n\t\u5173\u952e\u5b57:           \u7ecf\u5178
\r\n\t\u7528\u6237:            \u6682\u7f3a
\r\n\t\u8ba1\u7b97\u673a:           WIN-7BPO7SH1PG7
\r\n\t\u63cf\u8ff0:
\r\n\t\u5728\u4e3a\u5e94\u7528\u7a0b\u5e8f\u6c60“Classic .NET AppPool”\u63d0\u4f9b\u670d\u52a1\u7684\u5de5\u4f5c\u8fdb\u7a0b“5916”\u4e2d\uff0c\u534f\u8bae“http”\u7684\u4fa6\u542c\u5668\u901a\u9053\u62a5\u544a\u4e86\u4fa6\u542c\u5668\u901a\u9053\u9519\u8bef\u3002\u6570\u636e\u5b57\u6bb5\u5305\u542b\u9519\u8bef\u53f7\u3002
\r\n\t\u4e8b\u4ef6 Xml:
\r\n\t<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
\r\n\t  <System>
\r\n\t    <Provider Name="Microsoft-Windows-WAS" Guid="{524B5D04-133C-4A62-8362-64E8EDB9CE40}" EventSourceName="WAS" />
\r\n\t    <EventID Qualifiers="32768">5139</EventID>
\r\n\t    <Version>0</Version>
\r\n\t    <Level>3</Level>
\r\n\t    <Task>0</Task>
\r\n\t    <Opcode>0</Opcode>
\r\n\t    <Keywords>0x80000000000000</Keywords>
\r\n\t    <TimeCreated SystemTime="2018-01-24T13:48:57.000000000Z" />
\r\n\t    <EventRecordID>26977</EventRecordID>
\r\n\t    <Correlation />
\r\n\t    <Execution ProcessID="0" ThreadID="0" />
\r\n\t    <Channel>System</Channel>
\r\n\t    <Computer>WIN-7BPO7SH1PG7</Computer>
\r\n\t    <Security />
\r\n\t  </System>
\r\n\t  <EventData>
\r\n\t    <Data Name="AppPoolID">Classic .NET AppPool</Data>
\r\n\t    <Data Name="ProcessID">5916</Data>
\r\n\t    <Data Name="param3">0</Data>
\r\n\t    <Data Name="ProtocolID">http</Data>
\r\n\t    <Binary>C1000780</Binary>
\r\n\t  </EventData>
\r\n\t</Event>

\r\n

\u7f51\u4e0a\u641c\u7d22\u4e86\u597d\u591a\u65b9\u6cd5\u90fd\u4e0d\u7ba1\uff0c\u6700\u540e\u5c06\u89d2\u8272\u548c\u529f\u80fd\u5168\u90e8\u5220\u9664\u91cd\u65b0 \u53ea\u6dfb\u52a0 WinRM IIS \u6269\u5c55 \u5176\u4ed6\u6240\u9700\u89d2\u8272\u7cfb\u7edf\u4f1a\u81ea\u52a8\u52fe\u9009\uff0c\u8fd9\u6837\u5c31\u4e0d\u5bb9\u6613\u51fa\u9519\u4e86\u3002

\r\n

 

\r\n"}, {"title": " mybatis-generator\u9006\u5411\u5de5\u7a0b\u751f\u6210mapper.xml\u5185\u5bb9\u91cd\u590d", "desc": " mybatis-generator\u9006\u5411\u5de5\u7a0b\u751f\u6210mapper.xml\u5185\u5bb9\u91cd\u590d\u5bfc\u81f4\u4e0b\u9762\u7684\u62a5\u9519\u3002\u91cd\u590d\u7684\u4e3b\u8981\u539f\u56e0\u662f\u6267\u884c\u65f6\u5019 -overwrite \u52a0\u4e86\u8fd9\u4e2a\u53c2\u6570\u3002", "content": "

\u62a5\u9519\u4fe1\u606f

\r\n

2018-11-30 16:38:19,543 [RMI TCP Connection(5)-127.0.0.1] ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
\r\n\torg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/mybatis-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\\apache-tomcat-7.0.70\\webapps\\WEB-INF\\classes\\com\\jschrj\\admin\\mapping\\SysJsMapper.xml]'; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.jschrj.admin.dao.SysJsMapper.BaseResultMap
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

\r\n

\u5982\u679c\u52a0 -overwrite \u8fd9\u4e2a\u53c2\u6570\uff0c\u4e4b\u524d\u5982\u679c\u751f\u6210\u8fc7\u9700\u8981\u628a\u539f\u6765\u751f\u6210\u7684\u6587\u4ef6\u5220\u9664\uff0c\u4e0d\u7136\u4f1a\u751f\u6210\u91cd\u590d\u5185\u5bb9, ID \u91cd\u590d\u5bfc\u81f4\u62a5\u9519\u3002

\r\n"}, {"title": "mybatis-generator\u9006\u5411\u5de5\u7a0b\u751f\u6210\u4ee3\u7801\u95ee\u9898\u603b\u7ed3", "desc": "\u6b64\u6b21\u751f\u6210\u7684\u5b9e\u4f53\u7c7b\u5b57\u6bb5\u548c\u63d0\u4f9b\u7684\u6570\u636e\u5e93\u8d26\u53f7\u91cc\u9762\u8868\u7684\u5b57\u6bb5\u4e0d\u4e00\u81f4\uff0c\u4e0d\u662f\u7f51\u4e0a\u8bf4\u7684\u90a3\u4e2a\u79cd\u6ca1\u6709\u4e0b\u5212\u7ebf\uff0c\u5927\u5c0f\u5199\u4e4b\u7c7b\u7684\u3002\u800c\u662f\u751f\u6210\u7684\u5b9e\u4f53\u7c7b\u7684\u5b57\u6bb5\u6bd4\u8868\u91cc\u9762\u591a\uff0c\u5f88\u591a\u662f\u8868\u91cc\u9762\u6ca1\u6709\u7684\u5b57\u6bb5\u3002", "content": "

\u4f7f\u7528 generatorConfig.xml \u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u7684\u914d\u7f6e\u767b\u9646\u6570\u636e\u5e93\u67e5\u770b\u8868\u91cc\u9762\u6ca1\u6709\u7684\u5b57\u6bb5\u4e3a\u4f55 Model \u91cc\u9762\u4f1a\u751f\u6210\u5f88\u5947\u602a\u3002

\r\n

\u540e\u6765\u67e5\u770b\u8868\u91cc\u9762\u6240\u6709\u5bf9\u8c61\u624d\u53d1\u73b0\u5176\u4ed6\u8d26\u53f7\u4e0b\u9762\u6709\u540c\u540d\u7684\u8868\uff0c\u751f\u6210\u7684\u5b9e\u4f53\u7c7b\u662f\u53e6\u5916\u4e00\u4e2a\u7528\u6237\u4e0b\u9762\u8868\u7684\u5b9e\u4f53\u3002

\r\n

\u4ea7\u751f\u6b64\u95ee\u9898\u7684\u4e3b\u8981\u539f\u56e0\u662f\u56e0\u4e3a\u6570\u636e\u5e93\u91cc\u591a\u4e2a\u8d26\u53f7\u90fd\u5177\u5907DBA\u6743\u9650\uff0c\u8d26\u53f7\u4e0b\u6709\u540c\u540d\u7684\u8868\u5bfc\u81f4\u3002

\r\n

\u89e3\u51b3\u65b9\u6848\u662f\u5728\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u6dfb\u52a0 schema \u5c5e\u6027\uff1a

\r\n

<table tableName="SYS_YH" schema="zhoudl" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />

\r\n

\u7ea2\u8272\u7684\u90e8\u5206\u6307\u5b9a\u751f\u6210\u54ea\u4e2a\u7528\u6237\u4e0b\u7684\u8868\uff0c\u4ee5\u524d\u5bf9 ORACLE \u6570\u636e\u5e93\u4e0d\u592a\u4e86\u89e3\u5927\u5bb6\u5728\u5efa\u8d26\u53f7\u7684\u65f6\u5019\u90fd\u4ed8\u4e50DBA \u6743\u9650\uff0c\u6570\u636e\u5e93\u516c\u7528\u624d\u4f1a\u6709\u8fd9\u4e2a\u60c5\u51b5\u53d1\u751f\uff0c\u6211\u4e5f\u662f\u767e\u5ea6\u4e86\u597d\u4e45\u6ca1\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u770b\u4e86 generatorConfig \u7684\u914d\u7f6e\u9879\u624d\u53d1\u73b0\u8fd9\u4e48\u6539\uff0c\u4e0b\u9762\u7ed9\u51fa\u6211\u7684\u914d\u7f6e\u4fe1\u606f\u4f9b\u53c2\u8003\u3002

\r\n

 

\r\n
<?xml version="1.0" encoding="UTF-8"?>
\r\n\t<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
\r\n\t<generatorConfiguration>
\r\n\t <!-- \u6570\u636e\u5e93\u9a71\u52a8\u5305\u4f4d\u7f6e -->
\r\n\t <classPathEntry location="F:\\Java\\mybatis-generator-1.3.7\\ojdbc14.jar" />
\r\n\t <!-- <classPathEntry location="F:\\Java\\mybatis-generator-1.3.7\\mysql-connector-java-5.1.38-bin.jar" /> --> 
\r\n
 <context id="DB2Tables" defaultModelType="flat" targetRuntime="MyBatis3">
\r\n\t  <plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin> 
\r\n\t <!-- \u751f\u6210\u6ce8\u91ca\u914d\u7f6e -->  
\r\n\t <commentGenerator type="">   
\r\n\t <!-- \u662f\u5426\u53d6\u6d88\u6ce8\u91ca -->   
\r\n\t  <property name="suppressAllComments" value="true" />
\r\n\t <!-- \u6570\u636e\u5e93\u6ce8\u91ca\u652f\u6301 -->
\r\n\t  <property name="addRemarkComments" value="true"/>
\r\n\t <!-- \u65f6\u95f4\u683c\u5f0f\u8bbe\u7f6e -->
\r\n\t  <property name="dateFormat" value="yyyy-MM-dd HH:mm:ss"/>
\r\n\t </commentGenerator>
\r\n\t  <!-- \u6570\u636e\u5e93\u94fe\u63a5URL\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801 -->
\r\n\t <!--<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/jeecmsv6" userId="root" password="123456">-->
\r\n\t  <jdbcConnection
\r\n\t   driverClass="oracle.jdbc.driver.OracleDriver"
\r\n\t   connectionURL="jdbc:oracle:thin:@21x.64.xx.xx:1521:orcl"
\r\n\t   userId="zhoudl"
\r\n\t   password="xxxxxxx">
\r\n\t  </jdbcConnection>
\r\n\t  <!-- \u6570\u503c\u7c7b\u578b\u6570\u636e\u662f\u5426\u5168\u90e8\u4f7f\u7528BigDecimal\u7c7b\u578b -->
\r\n\t  <javaTypeResolver>
\r\n\t   <property name="forceBigDecimals" value="false" />
\r\n\t  </javaTypeResolver>
\r\n\t  <!-- \u751f\u6210\u6a21\u578b\u7684\u5305\u540d\u548c\u4f4d\u7f6e -->
\r\n\t  <javaModelGenerator targetPackage="com.jschrj.model" targetProject="F:\\Java\\mybatis-generator-1.3.7\\src">
\r\n\t   <property name="enableSubPackages" value="false" />
\r\n\t   <property name="trimStrings" value="true" />
\r\n\t  </javaModelGenerator>
\r\n\t  <!-- \u751f\u6210\u7684\u6620\u5c04\u6587\u4ef6\u5305\u540d\u548c\u4f4d\u7f6e -->
\r\n\t  <sqlMapGenerator targetPackage="com.jschrj.mapping" targetProject="F:\\Java\\mybatis-generator-1.3.7\\src">
\r\n\t   <property name="enableSubPackages" value="false" />
\r\n\t   <property name="trimStrings" value="flase" />
\r\n\t  </sqlMapGenerator>
\r\n\t  <!-- \u751f\u6210DAO\u7684\u5305\u540d\u548c\u4f4d\u7f6e -->
\r\n\t  <javaClientGenerator type="XMLMAPPER" targetPackage="com.jschrj.dao" targetProject="F:\\Java\\mybatis-generator-1.3.7\\src">
\r\n\t   <property name="enableSubPackages" value="false" />
\r\n\t  </javaClientGenerator>
\r\n\t  <!-- \u8981\u751f\u6210\u90a3\u4e9b\u8868(\u66f4\u6539tableName\u548cdomainObjectName\u5c31\u53ef\u4ee5) -->
\r\n\t  <table tableName="SYS_YH" schema="zhoudl" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />
\r\n
 </context>
\r\n\t</generatorConfiguration>
\r\n

 

\r\n"}, {"title": "SpringBOOT \u62a5Consider defining a bean of type", "desc": "Consider defining a bean of type 'com.jschrj.dao.XfjExtMapper' in your configuration.", "content": "

\u62a5\u9519\u4fe1\u606f

\r\n
2018-11-08 17:51:34.266 ERROR 5220 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :
\r\n
***************************
\r\n\tAPPLICATION FAILED TO START
\r\n\t***************************
\r\n
Description:
\r\n
Field xfjDao in com.jschrj.service.ExtService required a bean of type 'com.jschrj.dao.XfjExtMapper' that could not be found.
\r\n

\r\n\tAction:
\r\n
Consider defining a bean of type 'com.jschrj.dao.XfjExtMapper' in your configuration.
\r\n
 
\r\n
\u89e3\u51b3\u529e\u6cd5\uff1a\u5728DAO\u7684\u63a5\u53e3\u6587\u4ef6\u4e0a\u9762\u52a0 @Mapper  \u6ce8\u89e3\uff0c\u5982\u679c\u4e0d\u80fd\u52a0\u6ce8\u89e3\u662f\u56e0\u4e3a\u4e0b\u9762\u7684\u4f9d\u8d56\u9519\u4e86\u3002
\r\n

spring \u96c6\u6210 mybatis \u7684\u4f9d\u8d56\u53d8\u4e86

\r\n

\u539f\u6765\u662f

\r\n
\r\n
\r\n
\r\n<dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.2</version> </dependency>
\r\n

spring boot \u8981\u6362\u6210

\r\n
\r\n        <dependency>\r\n            <groupId>org.mybatis.spring.boot</groupId>\r\n            <artifactId>mybatis-spring-boot-starter</artifactId>\r\n            <version>1.3.0</version>\r\n        </dependency>
\r\n

 

\r\n

 

\r\n

 

\r\n"}, {"title": "Mybatis\u62a5\u9519Invalid bound statement (not found)", "desc": "\u9519\u8bef\u63d0\u793aInvalid bound statement (not found): com.jschrj.dao.XfjExtMapper.countAll\u597d\u50cf\u662f\u3002countAll\u8fd9\u4e2a\u67e5\u8be2\u62a5\u7684\u9519\uff0c\u5176\u5b9e\u4e0d\u662f", "content": "

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jschrj.dao.XfjExtMapper.countAll
\n\t at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:178)
\n\t at org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:38)
\n\t at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)
\n\t at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)
\n\t at com.sun.proxy.$Proxy14.countAll(Unknown Source)
\n\t 

\n
<select id=\"selectAll\" resultMap=\"com.jschrj.model.XfjExt\" parameterType=\"com.jschrj.model.XfjExt\">
\n

\u8981\u6ce8\u610f \u8f93\u51fa\u7ed3\u679c\u5982\u679c\u4f7f\u7528\u7c7b\u8868\u793a\u5e94\u8be5\u7528 

\n
resultType=\"com.jschrj.model.XfjExt\"
\n

\u4e0d\u7136\u5c31\u4f1a\u62a5\u4e0a\u9762\u7684\u9519\u8bef\uff0c\u6709\u65f6\u5019\u4e0d\u80fd\u6b7b\u8111\u7b4b\u7ecf\u9a8c\u5f88\u91cd\u8981\u3002\u8fd8\u6709\u4e0b\u9762\u51e0\u79cd\u60c5\u51b5\u4e5f\u4f1a\u62a5  Invalid bound statement (not found): \u9519\u8bef

\n

1.namespace\u914d\u7f6e\u7684\u5b9e\u4f53\u7c7b\u627e\u4e0d\u5230

\n

\u200b2.DAO\u91cc\u9762\u7684\u65b9\u6cd5\u5728  .xml\u6587\u4ef6\u91cc\u9762\u627e\u4e0d\u5230\u5bf9\u5e94\u7684SQL\u8bed\u53e5ID

\n

3.\u5b9e\u4f53\u7c7b\u91cc\u9762\u7684\u6570\u636e\u7c7b\u578b\u548c\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0c\u4e5f\u4f1a\u5bfc\u81f4\uff08\u5e38\u7528\u573a\u666f\uff1a\u5982\u5b9e\u4f53\u7c7b\u4e2d\u65f6\u95f4\u5f80\u5f80\u4f7f\u7528\u7684\u662fstring,\u6570\u636e\u5e93\u4e2d\u65f6\u95f4\u4f7f\u7528\u7684\u662fDATA\uff09\u200b

\n
<if test=\"xfjDjsj != null\" >\n    to_date(substr(#{xfjDjsj,jdbcType=DATE},1,19),'yyyy-mm-dd hh24:mi:ss'),\n</if>
\n

\u200b\u5728\u63d2\u5165\u6216\u8005\u4fee\u6539\u7684\u65f6\u5019\u8981\u505a\u8f6c\u6362\u3002


\n"}, {"title": "SSM\u6846\u67b6\u4f7f\u7528\u603b\u7ed3", "desc": "spring\uff0cspringMVC\uff0cMybatis\u4f7f\u7528\u4e2d\u9047\u5230\u7684\u5751\u603b\u7ed3\u4e0b\u3002", "content": "

\u573a\u666f\u4e00\uff1a\u5728CLASS\u91cc\u5355\u72ec\u5199\u65b9\u6cd5\u901a\u8fc7 main(String[] args) \u76f4\u63a5\u6267\u884c\u3002

\r\n

\u90e8\u5206\u4ee3\u7801\uff1a

\r\n

 

\r\n
\r\npublic class PostJson {\r\n    ApplicationContext context = new ClassPathXmlApplicationContext("classpath:/config/spring-common.xml");\r\n    private JsXfjService JsXfjService=(JsXfjService)context.getBean("JsXfjService");\r\n    private ExtService ExtService=(ExtService)context.getBean("ExtService");\r\n    private XfjExt xfjExt=new XfjExt();\r\n    public void RunTool() throws Exception {\r\n        List<YwXfjJs> list = JsXfjService.getXfjList();\r\n        String url = "http://103.3.152.xxx:8081/getXfgjzByNr";\r\n//        System.out.print(list.get(5).getGkxx());\r\n        for (int i = 0; i < list.size(); i++) {\r\n            String params = "{\\"xfnr\\":\\"" + list.get(i).getGkxx() + "\\"}";\r\n            String xfjZdflmc = postNrfl(url, params);\r\n            xfjExt.setXfjGkxx(list.get(i).getGkxx());\r\n            xfjExt.setXfjBh(list.get(i).getXfjbh());\r\n            xfjExt.setXfjDjsj(list.get(i).getDjsj());\r\n            xfjExt.setXfjNrflmc(list.get(i).getNrflmc());\r\n            xfjExt.setXfjZdflmc(xfjZdflmc);\r\n            xfjExt.setXfjPd("\u7a7a");\r\n            int record = ExtService.insert(xfjExt);\r\n        }\r\n    }\r\n\r\n    public static void main(String[] args) throws Exception {\r\n        PostJson PostJson =new PostJson();\r\n        PostJson.RunTool();\r\n\r\n    }\r\n}
\r\n

\u6211\u5728service \u5c42\u7684class\u6807\u8bb0\u4e86 @service(name="JsXfjService") \u547d\u540d\u4e86Bean \u7684ID\uff0c\u4e0d\u7136\u53ef\u80fd\u4f1a\u83b7\u53d6\u4e0d\u5230 Bean

\r\n

\u573a\u666f\u4e8c\uff1a

\r\n

\u4f7f\u7528 layui \u6216\u8005 kgrid \u52a8\u6001\u8868\u683c\u663e\u793a\u6570\u636e\u5185\u5bb9\uff0c\u5728 MODEL \u5c42\u5b9a\u4e49\u7684\u5b9e\u4f53\u7c7b \u8981\u8bbe\u7f6e\u4e3a String \u683c\u5f0f\u4e0d\u7136\u663e\u793a\u4f1a\u4e71\u7801\u3002

\r\n

\u573a\u666f\u4e09\uff1a

\r\n

\u5982\u679c\u6570\u636e\u5e93\u4e2d\u7684\u5b57\u6bb5\u540d\u79f0\u548c\u5b9e\u4f53\u7c7b\u4e2d\u7684\u5b57\u6bb5\u540d\u79f0\u4e0d\u4e00\u81f4\u9700\u8981\u5199  resultMap \u67e5\u8be2\u65f6\u5019\u8981\u8bbe\u7f6e resultMap \uff0c\u4e0d\u7136\u6709\u53ef\u80fd\u5bfc\u81f4\u540e\u53f0\u65e5\u5fd7\u6253\u5370\u51fa\u6570\u636e\uff0c\u8868\u5355\u663e\u793a NULL

\r\n

\u200b\u573a\u666f\u56db\uff1a

\r\n

\u200b\u56e0\u4e3a\u573a\u666f\u4e09\u4e2d \u5b9e\u4f53\u7c7b\u5199\u7684\u662f String \u5728\u63d2\u5165\u7684\u65f6\u5019\u8981\u8fdb\u884c\u8f6c\u6362\uff0c\u4e0d\u7136\u4f1a\u62a5\u7c7b\u578b\u9519\u8bef\u3002

\r\n
\r\n<if test="xfjDjsj != null" >\r\n    to_date(substr(#{xfjDjsj,jdbcType=DATE},1,19),'yyyy-mm-dd hh24:mi:ss'),\r\n</if>
\r\n

\u573a\u666f\u4e94\uff1a

\r\n

\u5b9e\u4f53\u7c7b\u4e2d\u8bbe\u7f6e\u65f6\u95f4\u5b57\u6bb5\u7684\u7c7b\u578b\u4e3a String \u83b7\u53d6\u5230\u7684\u65f6\u95f4\u540e\u9762\u7cbe\u786e\u5230\u79d2\uff08\u5176\u5b9e\u65f6\u95f4\u540e\u9762\u591a\u4e86.0\uff09\u9700\u8981\u5728 get \u65b9\u6cd5\u4e2d\u622a\u53d6 

\r\n

 

\r\n
\r\npublic String getXfjDjsj() {\r\n    if(xfjDjsj != null && xfjDjsj.lastIndexOf(".") > 0){\r\n        xfjDjsj = xfjDjsj.substring(0, xfjDjsj.lastIndexOf("."));\r\n    }\r\n    return xfjDjsj;\r\n}
\r\n

\u4ee5\u540e\u53d1\u73b0\u5728\u6162\u6162\u603b\u7ed3\u5427\u3002

\r\n

 

\r\n

 

\r\n

 

\r\n

 

\r\n

 

\r\n

 

\r\n

 

\r\n

 

\r\n

 

\r\n"}, {"title": "No qualifying bean of type Bean\u6ce8\u5165\u5931\u8d25", "desc": "\u4e3b\u8981\u539f\u56e0\u662f\u56e0\u4e3aservice \u7c7b\u6ca1\u6709\u52a0 @Service \u6ce8\u89e3\u5bfc\u81f4\u3002", "content": "

\u62a5\u9519\u4fe1\u606f

\r\n

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'listController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.jschrj.service.JsXfjService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}
\r\n\t at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:307)
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)

\r\n

 

\r\n

\r\n\t@Autowired\u548c@Resource\u7684\u533a\u522b

\r\n
\u3000\u3000@Autowired  \u9ed8\u8ba4\u6309\u7c7b\u578b\u88c5\u914d \u3000\u3000
\r\n
\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u4f9d\u8d56\u5bf9\u8c61\u5fc5\u987b\u5b58\u5728\uff0c\u5982\u679c\u8981\u5141\u8bb8null\u503c\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5b83\u7684required\u5c5e\u6027\u4e3afalse   @Autowired(required=false)
\r\n
\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u4e5f\u53ef\u4ee5\u4f7f\u7528\u540d\u79f0\u88c5\u914d\uff0c\u914d\u5408@Qualifier\u6ce8\u89e3
\r\n

\u3000\u3000@Resource  \u9ed8\u8ba4\u6309\u540d\u79f0\u8fdb\u884c\u88c5\u914d\uff0c\u901a\u8fc7name\u5c5e\u6027\u8fdb\u884c\u6307\u5b9a

\r\n

 

\r\n

\u603b\u7ed3\uff1a@Autowired\u81ea\u52a8\u6ce8\u89e3\uff0c\u4e3e\u4e2a\u4f8b\u5b50\u5427\uff0c\u4e00\u4e2a\u7c7b\uff0c\u4fe9\u4e2a\u5b9e\u73b0\u7c7b\uff0cAutowired\u5c31\u4e0d\u77e5\u9053\u6ce8\u5165\u54ea\u4e00\u4e2a\u5b9e\u73b0\u7c7b\uff0c\u800cResource\u6709name\u5c5e\u6027\uff0c\u53ef\u4ee5\u533a\u5206\u3002

\r\n


\r\n\t 

\r\n"}, {"title": "IDEA\u3001Maven\u4f7f\u7528\u603b\u7ed3", "desc": "\u4ee5\u524d\u4e00\u76f4\u4f7f\u7528\u7684\u662f myeclipse\uff0cmyeclipsed\u5bf9\u524d\u7aef\u9875\u9762\u652f\u6301\u4e0d\u662f\u5f88\u597d\uff0c\u800c\u4e14\u6ca1\u529e\u6cd5\u4f7f\u7528JDK8.\u4f7f\u7528 layui\u3001jgrid\u7b49\u524d\u7aef\u6846\u67b6\u4e5f\u8d8a\u6765\u8d8a\u9891\u7e41\u4e8e\u662f\u4e0b\u8f7d\u4e86\u4e2aIntelliJ IDEA 2017.2.5 x64\u73a9\u73a9\u3002", "content": "

\u603b\u7ed3\u4e0b\u8fd9\u51e0\u5929\u4f7f\u7528\u7684\u5fc3\u5f97\u3002\u603b\u7684\u6765\u8bf4\u4e07\u53d8\u4e0d\u79bb\u5176\u5b97\uff0c\u57fa\u672c\u529f\u5f88\u91cd\u8981\u3002

\r\n

1.myeclipse 10 \u6bcf\u6b21\u6253\u5f00\u4ee5\u540e\u628a\u5de5\u4f5c\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u9879\u76ee\u90fd\u6253\u5f00\u4e86\uff0c\u4e3a\u4e86\u9632\u6b62\u592a\u4e71\u90fd\u662f\u628a\u4e0d\u5e38\u7528\u7684\u6216\u8005\u8001\u9879\u76ee\u5173\u95ed\uff1bIntelliJ IDEA 2017.2.5 x64 \u6bcf\u6b21\u6253\u5f00\u7684\u90fd\u662f\u6700\u8fd1\u4f7f\u7528\u5f00\u53d1\u7684\u9879\u76ee\u5f88\u65b9\u4fbf\u3002

\r\n

2.\u9879\u76ee\u7684\u5bfc\u5165\u6784\u5efa myeclipse 10 \u6709.myeclipse .settings .mymetadata\u200b\u7b49\u6587\u4ef6\u548c\u6587\u4ef6\u5939\uff0c\u5982\u679c\u60f3\u5bfc\u5165 IntelliJ IDEA \u5176\u5b9e\u53ea\u7528\u628a src \u548c WebRoot \u76ee\u5f55\u590d\u5236\u5230  IntelliJ IDEA \u9879\u76ee\u76ee\u5f55\u3002\u4e0b\u9762\u624b\u52a8\u8bbe\u7f6e “\u9879\u76ee\u7ed3\u6784" \u4e5f\u5c31\u662f\u6784\u5efa\u9879\u76ee\u6784\u5efa\u5b8c\u4f1a\u81ea\u52a8\u751f\u6210  .idea \u9879\u76ee\u914d\u7f6e\u6587\u4ef6

\r\n

3.\u8bf4\u8bf4 \u9879\u76ee\u6784\u5efa\u7684\u51e0\u4e2a\u4e3b\u8981\u53c2\u6570 Project Modules Libraies Facets Artifacts SDKs \uff08\u8fd9\u51e0\u4e2a\u4e3b\u8981\u83dc\u5355\u6253\u5f00\u9879\u76ee\u6784\u5efa\u5c31\u770b\u89c1\u4e86\u5728\u5de6\u8fb9\uff09\u3002

\r\n

Project \u4e3b\u8981\u8bbe\u7f6eJDK\u7248\u672c\u53f7\uff0c\u4ee5\u53ca JAVA\u6e90\u7801\u7684\u8f93\u51fa\u76ee\u5f55

\r\n

Modules \u5f88\u5173\u952e\uff0c\u4e3b\u8981\u8981\u8bbe\u7f6e\u6e90SOURCE\u76ee\u5f55\uff0c\u4e5f\u5c31\u662f Mark as: Sources \uff0c\u8bbe\u7f6e\u4e86\u4ee5\u540e\u5c31\u53ef\u4ee5\u7528 classpath \u8c03\u7528\u4e86;  Paths \u53ef\u4ee5\u4e0d\u8bbe\u7f6e\u76f4\u63a5\u4f7f\u7528 Project \u76ee\u5f55\uff0c\u4f5c\u7528\u5c31\u662f\u4e3a\u4e86\u66f4\u6539 \u8f93\u51fa\u76ee\u5f55\u4f7f\u7528\u3002\u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u8bbe\u8ba1\u6211\u731c\u6d4b\u662f\uff0c\u8fd9\u91cc\u7684Moudules \u76f8\u5f53\u4e8e myeclipse \u91cc\u7684\u9879\u76ee\uff0c\u53ef\u4ee5Project \u770b\u4f5c\u662f\u5de5\u4f5c\u7a7a\u95f4\uff0c\u5982\u679c\u6709\u591a\u4e2a Module \u53ef\u4ee5\u8f93\u51fa\u5230\u4e0d\u540c\u7684\u76ee\u5f55\uff0c\u53ef\u4ee5\u8fbe\u5230\u6e90\u7801\u5171\u7528\u7684\u76ee\u7684\uff0c\u6709\u70b9\u50cf myeclipse \u9879\u76ee\u5173\u8054\u3002

\r\n

Libraies \u6ca1\u4ec0\u4e48\u597d\u8bf4\u7684\u9879\u76ee\u4e2d\u7528\u5230\u7684 JAR \u5305\u76f4\u63a5\u6dfb\u52a0\u9009\u62e9\u8def\u5f84 \u4e00\u822c\u90fd\u5728 WebRoot\\WEB-INF\\lib

\r\n

Facets Modules \u91cc\u8bbe\u7f6e\u7684\u6846\u67b6\u663e\u793a\u5728\u8fd9\u91cc\uff0c\u6211\u7528\u7684\u662f web \u4e3b\u8981\u6709\u4e24\u9879 1.Deployment Descriptors \u53ea\u8981\u662f\u914d\u7f6e web.xml\u3002 myeclipse \u5728 WebRoot\\WEB-INF \u76ee\u5f55\u4e0b\u30022.Web Resource Directories \u4e3b\u8981\u8bbe\u7f6e \u9759\u6001\u8d44\u6e90  WebRoot \u8bbe\u7f6e\u4e3a\u6839\u3002

\r\n

Artifacts \u7528\u4e8e\u751f\u6210\u9879\u76ee\uff0c\u4e5f\u5c31\u662f Tomcat Webapps\u4e0b\u9762\u7684\u5185\u5bb9\uff0c\u9009\u62e9Web Application \u6709\u4e24\u4e2aExploded\u662f\u751f\u6210\u6587\u4ef6\u5939\uff0cArchive \u662f\u751f\u6210 war \u538b\u7f29\u5305

\r\n

SDKs \u6ca1\u4ec0\u4e48\u597d\u8bf4\u7684\u9009\u62e9JDK\u7248\u672c

\r\n

\u200b4. IntelliJ IDEA \u4f7f\u7528 MVEN \u6784\u5efa\u9879\u76ee\u81ea\u5df1\u8bbe\u7f6e Modules \u6ca1\u6709\u6548\u679c\uff0cMAVEN \u7684 POM \u81ea\u52a8\u8bbe\u7f6e\u4e86 Modules \u4e86\u3002

\r\n

\u200b5. Maven \u9ed8\u8ba4JDK \u4e3a1.5 \u9700\u8981\u4fee\u6539 setting.xml \u914d\u7f6e\uff0c\u5728 Modules \u91cc\u8bbe\u7f6e JDK \u4e0d\u8d77\u4f5c\u7528\uff0c\u8bbe\u7f6e\u65b9\u6cd5\u5728 setting.xml \u7684 <profiles> \u8282\u70b9\u6dfb\u52a0\u4e0b\u9762\u4ee3\u7801\u3002

\r\n

<profile>

\r\n

  <id>JDK-1.7</id> <

\r\n

    activation>

\r\n

   <activebydefault>true</activebydefault>

\r\n

    <jdk>1.7</jdk>

\r\n

    </activation>

\r\n

    <properties>

\r\n

   <maven.compiler.source>1.7</maven.compiler.source>

\r\n

   <maven.compiler.target>1.7</maven.compiler.target>

\r\n

   <maven.compiler.compilerversion>1.7</maven.compiler.compilerversion>

\r\n

   </properties>

\r\n

</profile> 

\r\n

\u200b6. Maven \u7ed3\u6784\u76ee\u5f55  .mxl \u7b49\u914d\u7f6e\u76f8\u5173\u7684\u9759\u6001\u6587\u4ef6\u5fc5\u987b\u653e\u5728 Resources \u76ee\u5f55\u4e0b\u4e0d\u7136\u7f16\u8bd1\u7684\u65f6\u5019\u4e0d\u51fa\u73b0\u5728 classpath \u6587\u4ef6\u91cc\uff0cTomCat \u4f1a\u62a5 IO \u627e\u4e0d\u5230\u6587\u4ef6\u9519\u8bef\u3002

\r\n"}, {"title": "XML\u683c\u5f0f\u9519\u8bef\u5bfc\u81f4\u7684: \u524d\u8a00\u4e2d\u4e0d\u5141\u8bb8\u6709\u5185\u5bb9", "desc": "\u4f7f\u7528Notepad++\u7f16\u5199mybatis-generator \u7684 generatorConfig.xml \u6587\u4ef6\u8fd0\u884c\u63d0\u793aXML Parser Error on line 1: \u524d\u8a00\u4e2d\u4e0d\u5141\u8bb8\u6709\u5185\u5bb9\u3002", "content": "

\u4f7f\u7528 mybatis-generator \u751f\u6210\u4ee3\u7801\u62a5\u9519XML Parser Error on line 1: \u524d\u8a00\u4e2d\u4e0d\u5141\u8bb8\u6709\u5185\u5bb9\u3002

\r\n
F:\\Java\\mybatis-generator-1.3.2>java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml
\r\n\tXML Parser Errors occurred:
\r\n
XML Parser Error on line 1: \u524d\u8a00\u4e2d\u4e0d\u5141\u8bb8\u6709\u5185\u5bb9\u3002
\r\n

\u89e3\u51b3\u65b9\u6cd5\uff1a

\r\n

\u5728 Notepad++ \u7684 Encoding \u83dc\u5355\u4e0b\u9009\u62e9 Encoding in UTF-8  \u4fdd\u5b58\u6587\u4ef6\u518d\u6b21\u8fd0\u884c\u3002

\r\n

F:\\Java\\mybatis-generator-1.3.2>java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml
\r\n\tMyBatis Generator finished successfully.

\r\n

 

\r\n"}, {"title": "Tomcat\u542f\u52a8\u62a5ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed", "desc": "\u4e3b\u8981\u662f\u4f7f\u7528\u4e86 mybatis-generator \u5de5\u5177\u751f\u6210\u4e86dao\u548cxml\u6587\u4ef6\uff0cXML\u6587\u4ef6\u91cc\u9762\u6709\u91cd\u590d\u7684ID\u5bfc\u81f4\uff0c\u6700\u540e\u6ca1\u529e\u6cd5\u628a\u81ea\u52a8\u751f\u6210\u7684SQL\u5220\u9664\u4e86\uff0c\u81ea\u5df1\u5199\u4e86\u51e0\u6761\u95ee\u9898\u89e3\u51b3\u3002", "content": "

\u62a5\u9519\u4fe1\u606f\uff1a

\r\n

2018-10-19 16:29:38,235 [RMI TCP Connection(5)-127.0.0.1] ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
\r\n\torg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/mybatis-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\\IDEA\\bdjl\\WebRoot\\WEB-INF\\classes\\artifacts\\bdjl\\WEB-INF\\classes\\com\\jschrj\\mapping\\xfjMapper.xml]'; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for dao.xfjMapper.BaseResultMap
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
\r\n\t at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
\r\n\t at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
\r\n\t at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
\r\n\t at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
\r\n\t at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:681)
\r\n\t at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
\r\n\t at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
\r\n\t at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
\r\n\t at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
\r\n\t at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
\r\n\t at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099)
\r\n\t at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)
\r\n\t at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
\r\n\t at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
\r\n\t at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
\r\n\t at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
\r\n\t at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1863)
\r\n\t at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\r\n\t at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
\r\n\t at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
\r\n\t at java.lang.reflect.Method.invoke(Method.java:498)
\r\n\t at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
\r\n\t at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
\r\n\t at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
\r\n\t at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
\r\n\t at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
\r\n\t at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\r\n\t at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
\r\n\t at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
\r\n\t at java.lang.reflect.Method.invoke(Method.java:498)
\r\n\t at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
\r\n\t at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
\r\n\t at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
\r\n\t at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
\r\n\t at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
\r\n\t at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
\r\n\t at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
\r\n\t at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
\r\n\t at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\r\n\t at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
\r\n\t at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
\r\n\t at java.lang.reflect.Method.invoke(Method.java:498)
\r\n\t at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
\r\n\t at sun.rmi.transport.Transport$1.run(Transport.java:200)
\r\n\t at sun.rmi.transport.Transport$1.run(Transport.java:197)
\r\n\t at java.security.AccessController.doPrivileged(Native Method)
\r\n\t at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
\r\n\t at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
\r\n\t at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
\r\n\t at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
\r\n\t at java.security.AccessController.doPrivileged(Native Method)
\r\n\t at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
\r\n\t at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
\r\n\t at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
\r\n\t at java.lang.Thread.run(Thread.java:748)
\r\n\tCaused by: org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\\IDEA\\bdjl\\WebRoot\\WEB-INF\\classes\\artifacts\\bdjl\\WEB-INF\\classes\\com\\jschrj\\mapping\\xfjMapper.xml]'; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for dao.xfjMapper.BaseResultMap
\r\n\t at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:466)
\r\n\t at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:340)
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
\r\n\t at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
\r\n\t ... 57 more
\r\n\t\u5341\u6708 19, 2018 4:29:38 \u4e0b\u5348 org.apache.catalina.core.StandardContext startInternal
\r\n\tCaused by: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for dao.xfjMapper.BaseResultMap
\r\n\t at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:113)
\r\n\t\u4e25\u91cd: One or more listeners failed to start. Full details will be found in the appropriate container log file
\r\n\t at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88)
\r\n\t\u5341\u6708 19, 2018 4:29:38 \u4e0b\u5348 org.apache.catalina.core.StandardContext startInternal
\r\n\t at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:464)
\r\n\t\u4e25\u91cd: Context [] startup failed due to previous errors
\r\n\t ... 60 more
\r\n\tCaused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for dao.xfjMapper.BaseResultMap
\r\n\t at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:753)
\r\n\t at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:725)
\r\n\t at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:508)
\r\n\t at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:204)
\r\n\t at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:44)
\r\n\t at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:277)
\r\n\t at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:244)
\r\n\t at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:236)
\r\n\t at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:109)
\r\n\t ... 62 more
\r\n\t\u5341\u6708 19, 2018 4:29:38 \u4e0b\u5348 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
\r\n\t\u4e25\u91cd: The web application [] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
\r\n\t\u5341\u6708 19, 2018 4:29:38 \u4e0b\u5348 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
\r\n\t\u4e25\u91cd: The web application [] registered the JDBC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
\r\n\t[2018-10-19 04:29:38,275] Artifact bdjl: Error during artifact deployment. See server log for details.
\r\n\t 

\r\n

\u8fd9\u4e2a\u9519\u8bef\u65e0\u975e\u4e24\u4e2a\u539f\u56e0\uff1a

\r\n

1.

\r\n
\r\n<mapper namespace="com.jschrj.dao.xfjMapper">
\r\n

\u91cc\u9762\u7684 namespace \u548c Dao\u91cc\u9762\u7684\u7c7b\u540d\u79f0\u4e0d\u4e00\u81f4

\r\n

2.

\r\n

SQL\u8bed\u53e5\u91cc\u7684 ID\uff0c\u548c DAO \u91cc\u9762\u7684\u65b9\u6cd5\u4e0d\u5bf9\u5e94\u3002

\r\n"}, {"title": "Apache\u5b89\u88c5\u8bc1\u4e66", "desc": "\u6211\u4f7f\u7528\u7684\u662f\u817e\u8baf\u4e91\u514d\u8d39\u7533\u8bf7\u7684\u57df\u540d\u578b\u8bc1\u4e66\uff0c\u4e0b\u8f7d\u4e0b\u6765\u7684api.jschrj.com.zip\u8bc1\u4e66\u6587\u4ef6\u91cc\u9762\u6709\u56db\u4e2a\u6587\u4ef6\u5939\u5206\u522b\u662fApache\u3001IIS\u3001Nginx\u3001Tomcat\u4e00\u76ee\u4e86\u7136\u672c\u6b21\u4f7f\u7528\u7684\u662fApache\u76ee\u5f55\u4e0b\u7684\u8bc1\u4e66\u3002", "content": "

\u7f16\u8f91Apache\u6839\u76ee\u5f55\u4e0b conf/httpd.conf \u6587\u4ef6\uff0c
\r\n\t\u627e\u5230 #LoadModule ssl_module modules/mod_ssl.so \u548c #Include conf/extra/httpd-ssl.conf\uff0c\u53bb\u6389\u524d\u9762\u7684#\u53f7\u6ce8\u91ca\uff1b
\r\n\t\u7f16\u8f91Apache\u6839\u76ee\u5f55\u4e0b conf/extra/httpd-ssl.conf \u6587\u4ef6\uff0c\u4fee\u6539\u5982\u4e0b\u5185\u5bb9\uff1a

\r\n

<VirtualHost 0.0.0.0:443>
\r\n\t    DocumentRoot "/var/www/html"
\r\n\t    ServerName www.domain.com
\r\n\t   
SSLEngine on
\r\n\t    SSLCertificateFile /usr/local/apache/conf/2_api.jschrj.com_cert.crt
\r\n\t   
SSLCertificateKeyFile /usr/local/apache/conf/3_api.jschrj.com.key
\r\n\t   
SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
\r\n\t</VirtualHost>

\r\n

\u91cd\u542fApache\u5c31\u53ef\u4ee5\u7528https\u8bbf\u95ee\u4e86\u3002

\r\n

\u914d\u7f6e\u8bf4\u660e\uff1a

\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\t\t\u914d\u7f6e\u6587\u4ef6\u53c2\u6570\r\n\t\t\t\t\u8bf4\u660e
\r\n\t\t\t\tSSLEngine on\r\n\t\t\t\t\u542f\u7528SSL\u529f\u80fd
\r\n\t\t\t\tSSLCertificateFile\r\n\t\t\t\t\u8bc1\u4e66\u6587\u4ef6
\r\n\t\t\t\tSSLCertificateKeyFile\r\n\t\t\t\t\u79c1\u94a5\u6587\u4ef6
\r\n\t\t\t\tSSLCertificateChainFile\r\n\t\t\t\t\u8bc1\u4e66\u94fe\u6587\u4ef6
\r\n

 

\r\n

 

\r\n"}, {"title": "Tenginx|Nginx\u8bc1\u4e66\u5b89\u88c5", "desc": "\u6211\u4f7f\u7528\u7684\u662f\u817e\u8baf\u4e91\u514d\u8d39\u7533\u8bf7\u7684\u57df\u540d\u578b\u8bc1\u4e66\uff0c\u4e0b\u8f7d\u4e0b\u6765\u7684api.jschrj.com.zip\u8bc1\u4e66\u6587\u4ef6\u91cc\u9762\u6709\u56db\u4e2a\u6587\u4ef6\u5939\u5206\u522b\u662fApache\u3001IIS\u3001Nginx\u3001Tomcat\u4e00\u76ee\u4e86\u7136\u672c\u6b21\u4f7f\u7528\u7684\u662fNginx\u76ee\u5f55\u4e0b\u7684\u8bc1\u4e66\u3002", "content": "

\u5c06\u57df\u540d api.jschrj.com \u7684\u8bc1\u4e66\u6587\u4ef61_api.jschrj.com_bundle.crt \u3001\u79c1\u94a5\u6587\u4ef62_api.jschrj.com.key\u4fdd\u5b58\u5230\u540c\u4e00\u4e2a\u76ee\u5f55\uff0c\u4f8b\u5982 /usr/local/nginx/cert \u76ee\u5f55\u4e0b\u3002
\r\n\t\u4fee\u6539Nginx\u6839\u76ee\u5f55\u4e0b conf/nginx.conf \u914d\u7f6e\u6587\u4ef6\uff1a

\r\n
    server {
\r\n\t        listen       80;
\r\n\t        listen       443 ssl;
\r\n\t        server_name  api.jschrj.com www.jschrj.com;
\r\n\t        ssl                  on;
\r\n\t        ssl_certificate      /usr/local/nginx/cert/1_www.jschrj.com_bundle.crt;
\r\n\t        ssl_certificate_key  /usr/local/nginx/cert/2_www.jschrj.com.key;
\r\n\t        ssl_session_timeout  5m;
\r\n\t        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
\r\n\t        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
\r\n\t        ssl_prefer_server_ciphers on;
\r\n\t       server_name  www.jschrj.com chdsj.jschrj.com;
\r\n\t        #access_log  logs/host.access.log  main;
\r\n
        rewrite ^(.*) https://$host$1 permanent;
\r\n
        location ~^/ {
\r\n
            proxy_buffers 16 512k;
\r\n\t            proxy_pass  https://api.jpush.cn;
\r\n\t            client_max_body_size       10m;
\r\n\t            client_body_buffer_size    512k;
\r\n\t        }
\r\n
     }
\r\n

 

\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\t\t\u914d\u7f6e\u6587\u4ef6\u53c2\u6570\r\n\t\t\t\t\u8bf4\u660e
\r\n\t\t\t\tlisten 443\r\n\t\t\t\tSSL\u8bbf\u95ee\u7aef\u53e3\u53f7\u4e3a443
\r\n\t\t\t\tssl on\r\n\t\t\t\t\u542f\u7528SSL\u529f\u80fd
\r\n\t\t\t\tssl_certificate\r\n\t\t\t\t\u8bc1\u4e66\u6587\u4ef6
\r\n\t\t\t\tssl_certificate_key\r\n\t\t\t\t\u79c1\u94a5\u6587\u4ef6
\r\n\t\t\t\tssl_protocols\r\n\t\t\t\t\u4f7f\u7528\u7684\u534f\u8bae
\r\n\t\t\t\tssl_ciphers\r\n\t\t\t\t\u914d\u7f6e\u52a0\u5bc6\u5957\u4ef6\uff0c\u5199\u6cd5\u9075\u5faaopenssl\u6807\u51c6
\r\n

\u6ce8\uff1a\u6211\u591a\u52a0\u4e861\u4e2a80 \u7aef\u53e3\uff0c\u662f\u9632\u6b62\u7528\u6237\u8f93\u5165\u7684\u65f6\u5019\u6ca1\u6709\u7528 https \u8bbf\u95ee\uff0c\u540c\u6837\u52a0\u4e86\u4e00\u6761 rewrite ^(.*) https://$host$1 permanent; \u5b9e\u73b080\u8fdb\u6765\u7684\u8bf7\u6c42\u3002\u6211\u7684location \u662f\u4e3a\u4e86\u505a\u4ee3\u7406\u7528\u7684\uff0c\u4f7f\u7528\u65f6\u81ea\u884c\u914d\u7f6e\u3002

\r\n

 

\r\n

 

\r\n"}, {"title": "Tomcat\u8bc1\u4e66\u5b89\u88c5", "desc": "\u6211\u4f7f\u7528\u7684\u662f\u817e\u8baf\u4e91\u514d\u8d39\u7533\u8bf7\u7684\u57df\u540d\u578b\u8bc1\u4e66\uff0c\u4e0b\u8f7d\u4e0b\u6765\u7684api.jschrj.com.zip\u8bc1\u4e66\u6587\u4ef6\u91cc\u9762\u6709\u56db\u4e2a\u6587\u4ef6\u5939\u5206\u522b\u662fApache\u3001IIS\u3001Nginx\u3001Tomcat\u4e00\u76ee\u4e86\u7136\u672c\u6b21\u4f7f\u7528\u7684\u662fTomcat\u76ee\u5f55\u4e0b\u7684\u8bc1\u4e66\u3002", "content": "

 

\r\n

\r\n\t Tomcat \u8bc1\u4e66\u90e8\u7f72

\r\n

\r\n\t1 \u83b7\u53d6\u8bc1\u4e66

\r\n

\u5982\u679c\u7533\u8bf7\u8bc1\u4e66\u65f6\u6709\u586b\u5199\u79c1\u94a5\u5bc6\u7801\uff0c\u4e0b\u8f7d\u53ef\u83b7\u5f97Tomcat\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u6709\u5bc6\u94a5\u5e93 api.jschrj.com.jks\uff1b
\r\n\t\u5982\u679c\u6ca1\u6709\u586b\u5199\u79c1\u94a5\u5bc6\u7801\uff0c\u8bc1\u4e66\u4e0b\u8f7d\u5305\u7684Tomcat\u6587\u4ef6\u5939\u4e2d\u5305\u62ec\u5bc6\u94a5\u5e93\u6587\u4ef6api.jschrj.com.jks \u4e0e\u5bc6\u94a5\u5e93\u5bc6\u7801\u6587\u4ef6keystorePass.txt
\r\n\t\u5f53\u7528\u6237\u9009\u62e9\u7c98\u8d34CSR\u65f6\uff0c\u4e0d\u63d0\u4f9bTomcat\u8bc1\u4e66\u6587\u4ef6\u7684\u4e0b\u8f7d\uff0c\u9700\u8981\u7528\u6237\u624b\u52a8\u8f6c\u6362\u683c\u5f0f\u751f\u6210,\u64cd\u4f5c\u65b9\u6cd5\u5982\u4e0b\uff1a

\r\n
\r\n\t

\u53ef\u4ee5\u901a\u8fc7 Nginx \u6587\u4ef6\u5939\u5185\u8bc1\u4e66\u6587\u4ef6\u548c\u79c1\u94a5\u6587\u4ef6\u751f\u6210jks\u683c\u5f0f\u8bc1\u4e66
\r\n\t\t\u8f6c\u6362\u5de5\u5177\uff1ahttps://www.trustasia.com/tools/cert-converter.htm
\r\n\t\t\u4f7f\u7528\u5de5\u5177\u65f6\u6ce8\u610f\u586b\u5199 \u5bc6\u94a5\u5e93\u5bc6\u7801 \uff0c\u5b89\u88c5\u8bc1\u4e66\u65f6\u914d\u7f6e\u6587\u4ef6\u4e2d\u9700\u8981\u586b\u5199\u3002

\r\n
\r\n

\r\n\t2 \u8bc1\u4e66\u5b89\u88c5

\r\n

\u914d\u7f6eSSL\u8fde\u63a5\u5668\uff0c\u5c06api.jschrj.com.jks\u6587\u4ef6\u5b58\u653e\u5230conf\u76ee\u5f55\u4e0b\uff0c\u7136\u540e\u914d\u7f6e\u540c\u76ee\u5f55\u4e0b\u7684server.xml\u6587\u4ef6\uff1a

\r\n
\r\n\t
\r\n\t\t\r\n\t\t
\r\n<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"\r\n    maxThreads="150" scheme="https" secure="true"\r\n    keystoreFile="conf/api.jschrj.com.jks"\r\n    keystorePass="changeit"\r\n    clientAuth="false" sslProtocol="TLS" />\r\n
\r\n\t
\r\n
\r\n

\u6ce8\uff1a

\r\n
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t
\r\n\t\t\t\t\t\u914d\u7f6e\u6587\u4ef6\u53c2\u6570\r\n\t\t\t\t\t\u8bf4\u660e
\r\n\t\t\t\t\tclientAuth\r\n\t\t\t\t\t\u5982\u679c\u8bbe\u4e3atrue\uff0c\u8868\u793aTomcat\u8981\u6c42\u6240\u6709\u7684SSL\u5ba2\u6237\u51fa\u793a\u5b89\u5168\u8bc1\u4e66\uff0c\u5bf9SSL\u5ba2\u6237\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1
\r\n\t\t\t\t\tkeystoreFile\r\n\t\t\t\t\t\u6307\u5b9akeystore\u6587\u4ef6\u7684\u5b58\u653e\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u6307\u5b9a\u7edd\u5bf9\u8def\u5f84\uff0c\u4e5f\u53ef\u4ee5\u6307\u5b9a\u76f8\u5bf9\u4e8e \uff08Tomcat\u5b89\u88c5\u76ee\u5f55\uff09\u73af\u5883\u53d8\u91cf\u7684\u76f8\u5bf9\u8def\u5f84\u3002\u5982\u679c\u6b64\u9879\u6ca1\u6709\u8bbe\u5b9a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cTomcat\u5c06\u4ece\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u7684\u7528\u6237\u76ee\u5f55\u4e0b\u8bfb\u53d6\u540d\u4e3a “.keystore”\u7684\u6587\u4ef6\u3002
\r\n\t\t\t\t\tkeystorePass\r\n\t\t\t\t\t\u5bc6\u94a5\u5e93\u5bc6\u7801\uff0c\u6307\u5b9akeystore\u7684\u5bc6\u7801\u3002\uff08\u5982\u679c\u7533\u8bf7\u8bc1\u4e66\u65f6\u6709\u586b\u5199\u79c1\u94a5\u5bc6\u7801\uff0c\u5bc6\u94a5\u5e93\u5bc6\u7801\u5373\u79c1\u94a5\u5bc6\u7801\uff0c\u5426\u5219\u586b\u5199\u5bc6\u94a5\u5e93\u5bc6\u7801\u6587\u4ef6\u4e2d\u7684\u5bc6\u7801\uff09
\r\n\t\t\t\t\tsslProtocol\r\n\t\t\t\t\t\u6307\u5b9a\u5957\u63a5\u5b57\uff08Socket\uff09\u4f7f\u7528\u7684\u52a0\u5bc6/\u89e3\u5bc6\u534f\u8bae\uff0c\u9ed8\u8ba4\u503c\u4e3aTLS
\r\n
\r\n

\r\n\t3 http\u81ea\u52a8\u8df3\u8f6chttps\u7684\u5b89\u5168\u914d\u7f6e

\r\n

\u5230conf\u76ee\u5f55\u4e0b\u7684web.xml\u3002\u5728</welcome-file-list>\u540e\u9762\uff0c</web-app>\uff0c\u4e5f\u5c31\u662f\u5012\u6570\u7b2c\u4e8c\u6bb5\u91cc\uff0c\u52a0\u4e0a\u8fd9\u6837\u4e00\u6bb5

\r\n
\r\n\t
\r\n\t\t\r\n\t\t
\r\n<login-config>\r\n    <!-- Authorization setting for SSL -->\r\n    <auth-method>CLIENT-CERT</auth-method>\r\n    <realm-name>Client Cert Users-only Area</realm-name>\r\n    </login-config>\r\n    <security-constraint>\r\n    <!-- Authorization setting for SSL -->\r\n    <web-resource-collection>\r\n    <web-resource-name>SSL</web-resource-name>\r\n    <url-pattern>/*</url-pattern>\r\n    </web-resource-collection>\r\n    <user-data-constraint>\r\n    <transport-guarantee>CONFIDENTIAL</transport-guarantee>\r\n    </user-data-constraint>\r\n    </security-constraint>\r\n
\r\n\t
\r\n
\r\n

\u8fd9\u6b65\u76ee\u7684\u662f\u8ba9\u975essl\u7684connector\u8df3\u8f6c\u5230ssl\u7684connector\u53bb\u3002\u6240\u4ee5\u8fd8\u9700\u8981\u524d\u5f80server.xml\u8fdb\u884c\u914d\u7f6e\uff1a

\r\n
\r\n\t
\r\n\t\t\r\n\t\t
\r\n<Connector port="80" protocol="HTTP/1.1"\r\n    connectionTimeout="20000"\r\n    redirectPort="443" />\r\n
\r\n\t
\r\n
\r\n

redirectPort\u6539\u6210ssl\u7684connector\u7684\u7aef\u53e3443\uff0c\u91cd\u542f\u540e\u4fbf\u4f1a\u751f\u6548\u3002

\r\n

 

\r\n"}, {"title": "vuepress\u8fd0\u884c\u8d77\u6765\u8bbf\u95ee\u4e0d\u4e86", "desc": "\u770b\u4e86 vuepress \u5b98\u65b9\u6587\u6863\u7167\u7740\u4e0a\u9762\u642d\u5efabuild \u9759\u6001\u6587\u4ef6\u751f\u6210\u6210\u529f\u4f46\u662f\uff0c\u901a\u8fc7 http://localhost:8080 \u8bbf\u95ee\u4e0d\u4e86\u3002", "content": "

\u5148\u8bf4\u4e0b\u6211\u5f97\u5b89\u88c5\u6b65\u9aa4

\r\n

\u5b89\u88c5 NODEJS 8\u4ee5\u4e0a\u7248\u672c\u767e\u5ea6\u6559\u7a0b\u4e00\u5927\u628a\u3002

\r\n

# curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
\r\n\t#yum install nodejs

\r\n

\u5c06npm \u7684\u6e90\u8bbe\u7f6e\u6210\u6dd8\u5b9d\u7684\uff0c\u4e0d\u7136\u5b89\u88c5\u65f6\u5019\u5f88\u6162\u6709\u53ef\u80fd\u5931\u8d25\u3002

\r\n

npm config set registry https://registry.npm.taobao.org
\r\n\tnpm config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass

\r\n

\u4f5c\u4e3a\u65b0\u624b\u76f4\u63a5\u5168\u5c40\u5b89\u88c5\u3002

\r\n

npm install -g vuepress

\r\n

\u7b2c\u4e00\u6b21\u6309\u5b98\u65b9\u6559\u7a0b

\r\n

# \u521b\u5efa\u4e00\u4e2a markdown \u6587\u4ef6
\r\n\techo '# Hello VuePress' > README.md
\r\n\t
\r\n\t# \u5f00\u59cb\u7f16\u5199\u6587\u6863
\r\n\tvuepress dev
\r\n\t
\r\n\t# \u6784\u5efa
\r\n\tvuepress build

\r\n

\u200b\u8fd0\u884c\u8d77\u6765\u6ca1\u6709\u62a5\u9519\u3002\u5728 .vuepress \u76ee\u5f55\u4e0b\u4e5f\u751f\u6210\u4e86 dist \u76ee\u5f55\u91cc\u7684\u9759\u6001\u6587\u4ef6\uff0c\u4f46\u662f\u5c31\u662f\u65e0\u6cd5\u901a\u8fc7 http://localhost:8080

\r\n

\u200b\u89e3\u51b3\u65b9\u6cd5\uff1a

\r\n

\u200b\u5728\u8fd0\u884c vuepress dev \u7684\u65f6\u5019\u6539\u6210 vuepress dev docs \u5c31\u53ef\u4ee5\u4e86\uff0c\u4e5f\u8bb8 NODEJS \u7684\u8001\u53f8\u673a\u4e00\u770b\u5c31\u77e5\u9053\u4ec0\u4e48\u539f\u56e0\u4e86\u3002\u6211\u767e\u5ea6\u4e86\u534a\u5929\u4e5f\u6ca1\u627e\u5230\u7b54\u6848

\r\n

\u770b\u6765\u8fd8\u662f\u5f97\u5148\u5b66 nodejs \u5b66\u4e1c\u897f\u8981\u5faa\u5e8f\u6e10\u8fdb\uff0c\u4e0d\u80fd\u8df3\u7740\u6765\u8d70\u4e86\u4e0d\u5c11\u5f2f\u8def\u3002

\r\n

\u200b\u5b66\u8fd9\u4e2a\u5f97\u52a8\u529b\u5f88\u7b80\u5355\u5c31\u662f\u4e3a\u4e86\u88c5\u903c\uff0c\u628a\u7f51\u7ad9\u6362\u6210 vuepress \u6837\u5f0f\u5f97\uff0c\u8fd9\u4e2a\u4eff foundation \u7684\u5f53\u65f6\u6280\u672f\u8fd8\u4e0d\u884c\u7455\u75b5\u6709\u70b9\u591a\u3002

\r\n

 

\r\n"}, {"title": "squid\u914d\u7f6ehttps", "desc": "squid\u914d\u7f6eSSL\uff0c\u622a\u53d6\u5b98\u7f51\u4e0a\u7684\u64cd\u4f5c\u65b9\u6cd5\u3002\u539f\u6587\u5730\u5740 https://wiki.squid-cache.org/Features/SslBump", "content": "

\r\n\tSquid Configuration

\r\n

Here is a sample squid.conf excerpt with SSL Bump-related options:

\r\n

 

\r\n

\r\n\tEnabling SSL Bump

\r\n

Example of how to configure the HTTP port to bump CONNECT requests

\r\n
\r\nhttp_port 3128 ssl-bump cert=/usr/local/squid3/etc/site_priv+pub.pem\r\n\r\n# Bumped requests have relative URLs so Squid has to use reverse proxy\r\n# or accelerator code. By default, that code denies direct forwarding.\r\n# The need for this option may disappear in the future.\r\nalways_direct allow all
\r\n

 

\r\n

\r\n\tAccess Controls

\r\n

ssl_bump is used to prevent some requests being bumped.

\r\n

Example of how to avoid bumping requests to sites that Squid-3.1 or Squid-3.2 cannot proxy well:

\r\n
\r\nacl broken_sites dstdomain .example.com\r\nssl_bump deny broken_sites\r\nssl_bump allow all
\r\n

The ssl_bump directive in Squid-3.3 has been updated to select between several bumping algorithms. The above rules are now configured like this:

\r\n
\r\nacl broken_sites dstdomain .example.com\r\nssl_bump none broken_sites\r\nssl_bump client-first all
\r\n\r\n"}, {"title": "\u591a\u4e2ajeecms\u90e8\u7f72\u5230\u540c\u4e00\u4e2aTOMCAT\u4e0b", "desc": "\u4e4b\u524d\u60f3\u5c06\u591a\u4e2ajeecms\u9879\u76ee\u90e8\u7f72\u5230\u540c\u4e00\u4e2aTomcat\u4e0b\uff0c\u5982\u679c\u7528\u9879\u76ee\u540d\u5206\u5f00\u653e\u5728 webapps\u4e0b\u542f\u52a8\u6210\u529f\u3002\u653e\u5728\u4e0d\u540c\u7684\u76ee\u5f55\u4e0b\u4e00\u76f4\u5c1d\u8bd5\u5931\u8d25\u3002", "content": "

1.\u9700\u6c42\u63cf\u8ff0

\r\n

\u54ea\u91cc\u7684\u9879\u76ee\u5c31\u4e0d\u8bf4\u4e86\u5427\uff0c\u56e0\u4e3a\u8d44\u6e90\u7d27\u5f20\u9879\u76ee\u591a\u60f3\u5728\u4e00\u4e2a Tomcat \u4e0b\u9762\u90e8\u7f72\u591a\u4e2a JEECMS \u9879\u76ee\uff0c\u56e0\u4e3a\u90fd\u662f\u53bf\u533a\u9879\u76ee\u8bbf\u95ee\u91cf\u90fd\u4e0d\u5927\u3002\u5404\u53bf\u533a\u90fd\u5efa\u8bbe\u673a\u623f\u4e70\u670d\u52a1\u5668\u592a\u6d88\u8017\u8d44\u6e90\uff0c\u4e5f\u6ca1\u6709\u5b9e\u529b\u7ef4\u62a4\u3002\u6240\u4ee5\u5c31\u60f3\u5230\u628a\u6240\u6709\u53bf\u533a\u7684\u9879\u76ee\u90fd\u653e\u5230\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u6258\u7ba1\u7ed9\u4e13\u4e1a\u7ef4\u62a4\u4eba\u5458\uff0c\u8fd9\u6837\u8282\u7701\u4eba\u529b\u7269\u529b\u3002

\r\n

\u5982\u679c\u4f7f\u7528\u7ec7\u68a6\u3001\u5e1d\u56fd\u4e4b\u7c7b\u7684 PHP \u8bed\u8a00\u5199\u7684 CMS \u8fd9\u4e9b\u95ee\u9898\u90fd\u4e0d\u662f\u95ee\u9898\uff0c \u4f1f\u5927\u7684 LNMP \u4e00\u53f0\u670d\u52a1\u5668\u653e\u51e0\u5341\u4e2a\u7ad9\u90fd\u4e0d\u662f\u95ee\u9898\u3002\u4f46\u662f\u516c\u53f8\u641e JAVA \u7684\u591a\uff0c\u6280\u672f\u603b\u76d1\u9009\u62e9\u4e86 JEECMS \u6211\u4e5f\u5f88\u7edd\u671b\u5440\"\"\u3002

\r\n

2.\u914d\u7f6eTOMCAT

\r\n

\u7ed9\u51fa\u4e3b\u8981\u914d\u7f6e\u914d\u7f6e

\r\n

    <Service name="kaili">
\r\n\t    <Connector port="800" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8"/>
\r\n\t    <Connector port="800" protocol="AJP/1.3" redirectPort="8443" />
\r\n\t    <Engine name="kaili" defaultHost="localhost">
\r\n\t      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
\r\n\t             resourceName="UserDatabase"/>
\r\n\t      <Host name="localhost"  appBase="kaili"
\r\n\t            unpackWARs="true" autoDeploy="true"
\r\n\t            xmlValidation="false" xmlNamespaceAware="false">
\r\n\t      </Host>
\r\n\t    </Engine>
\r\n\t  </Service>
\r\n\t<Service name="sansui">
\r\n\t    <Connector port="803" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8"/>
\r\n\t    <Connector port="803" protocol="AJP/1.3" redirectPort="8443" />
\r\n\t    <Engine name="sansui" defaultHost="localhost">
\r\n\t      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
\r\n\t             resourceName="UserDatabase"/>
\r\n\t      <Host name="localhost"  appBase="sansui"
\r\n\t            unpackWARs="true" autoDeploy="true"
\r\n\t            xmlValidation="false" xmlNamespaceAware="false">
\r\n\t      </Host>
\r\n\t    </Engine>
\r\n\t  </Service>

\r\n

\u8be6\u7ec6\u64cd\u4f5c\u53ef\u53c2\u7167\u672c\u7ad9Tomcat\u4e0b\u591a\u5e94\u7528\u90e8\u7f72\u8fd9\u7bc7\u6587\u7ae0

\r\n

3.JEECMS\u4fee\u6539\u53ca\u6ce8\u610f\u4e8b\u9879

\r\n

\u4e3b\u8981\u6ce8\u610f\u4e24\u70b9\u7b2c\u4e00\u70b9\u8981\u4fee\u6539\u9879\u76ee\u4e2d WEB-INF \u76ee\u5f55\u4e0b\u7684 web.xml \u5f53\u4e2d\u7684 <display-name>JeeCms</display-name> \u7684\u503c\uff0c\u4e24\u4e2a\u9879\u76ee\u8bbe\u7f6e\u8981\u4e0d\u4e00\u6837\u3002\u7b2c\u4e8c\u70b9\u628a\u9879\u76ee\u4e0b WEB-INF\\lib \u76ee\u5f55\u4e2d\u7684 JAR \u5305\u79fb\u52a8\u5230 TOMCAT \u7684 lib \u76ee\u5f55\u4e0b\u7684\u65f6\u5019 logback-classic-0.9.27.jar \u548c logback-core-0.9.27.jar \u8fd9\u4e24\u4e2a JAR \u5305\u4e0d\u80fd\u79fb\uff0c\u4e0d\u7136\u4f1a\u51fa\u73b0\u9875\u9762\u663e\u793a\u5f02\u5e38\u3002

\r\n

\u6309\u7167\u8fd9\u79cd\u65b9\u6cd5\u914d\u7f6e\uff0c\u6211\u53ea\u4f7f\u7528\u4e86\uff0c\u6587\u7ae0\u53d1\u5e03\u548c\u5220\u9664\u529f\u80fd\uff0c\u5176\u4ed6\u529f\u80fd\u8fd8\u6ca1\u6709\u505a\u8be6\u7ec6\u6d4b\u8bd5\uff0c\u4e0d\u77e5\u9053\u6709\u6ca1\u6709\u540e\u9057\u75c7\u3002\u6211\u53ea\u662f\u6839\u636e Tomcat \u62a5\u9519\u4fe1\u606f\u8fd9\u6837\u8c03\u6574\u7684\uff0c\u6bd5\u7adf\u6211\u5bf9 JEECMS \u4f7f\u7528\u7684\u6846\u67b6\u6280\u672f\u4e0d\u719f\u6089\uff0c\u6211\u8fd8\u4e0d\u7b97\u662f\u4e00\u4e2a\u7a0b\u5e8f\u5458\uff0c\u53ea\u80fd\u7b97\u662f\u5c0f\u5b66\u751f\u3002

\r\n"}, {"title": "jquiery\u4e8b\u4f8b\u4ee3\u7801", "desc": "W3Shool\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177\u6d4b\u8bd5\u6e90\u7801\u5229\u7528jquery\u5b9e\u73b0\u70b9\u51fb\u6309\u94ae\u5728\u6bcf\u4e2a\u6bb5\u843d\u524d\u63d2\u5165\u65b0\u7684\u5185\u5bb9\u3002", "content": "\r\n

\r\n\tThis is a heading

\r\n

This is a paragraph.

\r\n

This is another paragraph.

\r\n

\r\n"}, {"title": "Nginx\u57fa\u672c\u547d\u4ee4", "desc": "\u6709\u5fc5\u8981\u5728\u628aNGINX\u7684\u57fa\u672c\u547d\u4ee4\u5728\u590d\u4e60\u4e00\u4e0b\uff0c\u4eca\u5929\u60f3\u70ed\u542f\u52a8\u600e\u4e48\u8f93\u90fd\u4e0d\u5bf9\u3002^_^", "content": "

NGINX \u5e38\u7528\u547d\u4ee4

\r\n

\u5047\u5b9a\u662f Linux \u7cfb\u7edf\uff0cWindows \u4f7f\u7528 NGINX \u6027\u80fd\u4e00\u534a\u90fd\u8fbe\u4e0d\u5230\u4e0d\u63a8\u8350\u3002\u7ea6\u5b9a\u76ee\u5f55 /usr/local/nginx/sbin

\r\n

\u8fdb\u5165\u76ee\u5f55\uff1a cd /usr/local/nginx/sbin

\r\n

ps -ef | grep nginx  \u67e5\u770b nginx \u8fdb\u7a0b\u53f7

\r\n

\u91cd\u542fnginx\uff1a

\r\n

nginx -s reload  \uff1a\u4fee\u6539\u914d\u7f6e\u540e\u91cd\u65b0\u52a0\u8f7d\u751f\u6548
\r\n\tkill -HUP \u4e3b\u8fdb\u7a0b\u53f7  \uff1b\u5e73\u6ed1\u91cd\u542fnginx
\r\n\tnginx -s reopen  \uff1a\u91cd\u65b0\u6253\u5f00\u65e5\u5fd7\u6587\u4ef6
\r\n\tnginx -t -c /usr/local/nginx/nginx.conf \u6d4b\u8bd5nginx\u914d\u7f6e\u6587\u4ef6\u662f\u5426\u6b63\u786e

\r\n

\u5173\u95ednginx\uff1a

\r\n

kill -QUIT \u4e3b\u8fdb\u7a0b\u53f7 \uff1a\u4ece\u5bb9\u505c\u6b62Nginx
\r\n\tkill -TERM \u4e3b\u8fdb\u7a0b\u53f7 \uff1a\u5feb\u901f\u505c\u6b62Nginx
\r\n\tpkill -9 nginx \uff1a\u5f3a\u5236\u505c\u6b62Nginx nginx -s stop  :\u5feb\u901f\u505c\u6b62nginx

\r\n

\u542f\u52a8nginx:

\r\n

./nginx -c /path/to/nginx.conf ;\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u542f\u52a8
\r\n\t./nginx \uff1b\u76f4\u63a5\u542f\u52a8nginx \u52a0\u8f7d\u9ed8\u8ba4\u914d\u7f6e

\r\n"}, {"title": "Tomcat\u4e0b\u591a\u5e94\u7528\u90e8\u7f72", "desc": "\u9ed4\u4e1c\u5357\u5dde\u67d0\u4e2a\u9879\u76ee\u5ef6\u4f38\u81f3\u5404\u53bf\u533a\uff0c\u4e0d\u77e5\u9053\u5f00\u53d1\u662f\u600e\u4e48\u60f3\u7684\u6bcf\u4e2a\u53bf\u533a\u4e00\u4e2a\u9879\u76ee\u3002\u603b\u5171\u5c31\u4e00\u53f016G\u5185\u5b58\u7684\u670d\u52a1\u5668\uff0c\u5341\u516d\u4e2a\u53bf\u5e02\u533a\u3002", "content": "

1.\u9879\u76ee\u80cc\u666f

\r\n

\u8d35\u5dde\u7701\u9ed4\u4e1c\u5357\u5dde\u67d0\u4e2a\u9879\u76ee,\u5ef6\u4f38\u81f3\u5341\u516d\u4e2a\u53bf\u5e02\u533a\uff0c\u6bcf\u4e2a\u53bf\u533a\u4e00\u4e2aAPP\u3002\u53ea\u67094\u6838\u5fc3\u4e00\u53f016G\u5185\u5b58\u7684\u865a\u62df\u673a\u3002\u56e0\u4e3a\u9879\u76ee\u90fd\u662f spring+mvc+mybatis \u67b6\u6784\uff0c\u6682\u65f6\u80fd\u60f3\u5230\u6700\u8282\u7701\u8d44\u6e90\u7684\u65b9\u6cd5\u5c31\u662f\u628a\u51e0\u4e2a\u9879\u76ee\u653e\u5230\u540c\u4e00\u4e2a Tomcat \u4e0b\u5171\u7528\u76f8\u540c\u7684 JAR \u5305\u3002\u56e0\u4e3a\u9879\u76ee\u90fd\u9700\u8981\u7ed1\u5b9a\u57df\u540d\uff0c\u6240\u4ee5 Tomcat \u4e0b\u8fd8\u4e0d\u80fd\u6709\u9879\u76ee\u540d\u6587\u4ef6\u53ea\u80fd\u653e\u5728 ROOT \u4e0b\u6216\u8005\u662f\u4fee\u6539 server.xml \u3002\u524d\u7aef\u901a\u8fc7 squid \u6216\u8005 NGINX \u6765\u7ed1\u5b9a\u57df\u540d\uff08\u6211\u7528\u7684 squid\uff09\u3002

\r\n

2.Tomcat \u914d\u7f6e

\r\n

\u7ed9\u51fa\u4e3b\u8981\u914d\u7f6e

\r\n

    <Service name="kaili">
\r\n\t    <Connector port="80" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8"/>
\r\n\t    <Connector port="800" protocol="AJP/1.3" redirectPort="8443" />
\r\n\t    <Engine name="kaili" defaultHost="localhost">
\r\n\t      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
\r\n\t             resourceName="UserDatabase"/>
\r\n\t      <Host name="localhost"  appBase="kaili"
\r\n\t            unpackWARs="true" autoDeploy="true"
\r\n\t            xmlValidation="false" xmlNamespaceAware="false">
\r\n\t      </Host>
\r\n\t    </Engine>
\r\n\t  </Service>
\r\n\t    <Service name="cengong">
\r\n\t    <Connector port="81" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8"/>
\r\n\t    <Connector port="801" protocol="AJP/1.3" redirectPort="8443" />
\r\n\t    <Engine name="cengong" defaultHost="localhost">
\r\n\t      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
\r\n\t             resourceName="UserDatabase"/>
\r\n\t      <Host name="localhost"  appBase="cengong"
\r\n\t            unpackWARs="true" autoDeploy="true"
\r\n\t            xmlValidation="false" xmlNamespaceAware="false">
\r\n\t      </Host>
\r\n\t    </Engine>
\r\n\t  </Service>
\r\n\t<Service name="shibing">
\r\n\t    <Connector port="82" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8"/>
\r\n\t    <Connector port="802" protocol="AJP/1.3" redirectPort="8443" />
\r\n\t    <Engine name="shibing" defaultHost="localhost">
\r\n\t      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
\r\n\t             resourceName="UserDatabase"/>
\r\n\t      <Host name="localhost"  appBase="shibing"
\r\n\t            unpackWARs="true" autoDeploy="true"
\r\n\t            xmlValidation="false" xmlNamespaceAware="false">
\r\n\t      </Host>
\r\n\t    </Engine>
\r\n\t  </Service>
\r\n\t<Service name="sansui">
\r\n\t    <Connector port="83" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8"/>
\r\n\t    <Connector port="803" protocol="AJP/1.3" redirectPort="8443" />
\r\n\t    <Engine name="sansui" defaultHost="localhost">
\r\n\t      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
\r\n\t             resourceName="UserDatabase"/>
\r\n\t      <Host name="localhost"  appBase="sansui"
\r\n\t            unpackWARs="true" autoDeploy="true"
\r\n\t            xmlValidation="false" xmlNamespaceAware="false">
\r\n\t      </Host>
\r\n\t    </Engine>
\r\n\t  </Service>
\r\n\t<Service name="danzhai">
\r\n\t    <Connector port="84" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8"/>
\r\n\t    <Connector port="804" protocol="AJP/1.3" redirectPort="8443" />
\r\n\t    <Engine name="danzhai" defaultHost="localhost">
\r\n\t      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
\r\n\t             resourceName="UserDatabase"/>
\r\n\t      <Host name="localhost"  appBase="danzhai"
\r\n\t            unpackWARs="true" autoDeploy="true"
\r\n\t            xmlValidation="false" xmlNamespaceAware="false">
\r\n\t      </Host>
\r\n\t    </Engine>
\r\n\t  </Service>

\r\n

\u6211\u8fd9\u91cc Tomcat \u4e0b\u9762\u653e\u4e86\u4e94\u4e2a\u9879\u76ee\uff0c\u7528\u4e8680\uff0c81\uff0c82\uff0c83\uff0c84\u4e94\u4e2a\u7aef\u53e3\u4f5c\u4e3a HTTP \u7aef\u53e3\u3002\u7136\u540e\u5728 Tomcat \u4e0b\u5206\u522b\u5efa\u4e86 kaili\u3001cengong\u3001shibing\u3001sansui\u3001danzhai\u4e94\u4e2a\u76ee\u5f55\u7528\u6765\u5b58\u653e\u9879\u76ee\u3002\u5e76\u4e14\u628a\u6240\u6709\u9879\u76ee WEB-INF\\lib \u76ee\u5f55\u4e0b\u7684 jar \u6587\u4ef6\u79fb\u52a8\u5230 Tomcat \u76ee\u5f55\u4e0b\u7684 lib \u6587\u4ef6\u5939\u91cc\u3002

\r\n

3.\u6ce8\u610f\u4e8b\u9879

\r\n

\u4e3a\u4e86\u7ed1\u5b9a\u57df\u540d\uff0c\u4e5f\u5c31\u662f\u4e0d\u60f3\u8bbf\u95ee\u8def\u5f84\u5e26\u6709\u9879\u76ee\u540d\uff0c\u9879\u76ee\u6587\u4ef6\u9700\u8981\u653e\u5728 ROOT \u91cc\u9762\uff08\u8bb0\u5f97\u5fc5\u987b\u662f\u5927\u5199\u7684\uff09\uff1b\u9879\u76ee WEB-INF\\lib \u76ee\u5f55\u4e0b\u7684 jar \u5305\uff0c\u522b\u5fd8\u4e86\u79fb\u52a8\u5230 Tomcat \u7684 lib \u76ee\u5f55\uff1b\u5f53\u7136\u4fee\u6539 Tomcat \u5185\u5b58\u3001\u5b89\u88c5 native\u7b49\u4f18\u5316\u8fd8\u662f\u8981\u505a\u7684;\u9879\u76ee\u672c\u8eab\u914d\u7f6e\u6587\u4ef6\u8fd8\u8981\u505a\u4fee\u6539 \u6bd4\u5982 WEB-INF\u4e0b\u7684 web.xml \u547d\u540d\u4e0d\u8981\u90fd\u4e00\u6837\u3001WEB-INF\\classes \u4e2d ehcache.xml \u547d\u540d\u7a7a\u95f4\u522b\u540d\u4e5f\u4e0d\u80fd\u8bbe\u7f6e\u4e00\u6837\u3002

\r\n

\u603b\u4e4b\u53ef\u80fd\u8fd8\u6709\u5176\u4ed6\u6742\u4e03\u6742\u516b\u7684\u62a5\u9519\uff0c\u6839\u636e Tomcat \u65e5\u5fd7\u62a5\u9519\u4fe1\u606f\u7ec6\u5fc3\u6392\u67e5\u603b\u4f1a\u6210\u529f\u7684\u3002

\r\n"}, {"title": "\u9879\u76ee\u7528\u6237\u767b\u5f55\u4ee5\u540e1\u52302\u5206\u949fsession\u4e22\u5931\u9700\u8981\u91cd\u65b0\u767b\u5f55", "desc": "\u6c5f\u897f\u7701\u7684\u4e00\u4e2a\u9879\u76ee\uff0c\u7528\u6237\u767b\u5f55\u4ee5\u540e\u7528\u4e862\u5206\u949f\u5de6\u53f3\u9875\u9762\u9700\u8981\u518d\u6b21\u767b\u5f55\u3002\u67e5\u770b\u9879\u76ee\u6e90\u7801\u8bbe\u7f6e session \u4fdd\u5b58\u65f6\u95f4\u4e3a30\u5206\u949f\u3002", "content": "

\u95ee\u9898\u63cf\u8ff0

\n

\u6c5f\u897f\u7701\u7684\u4e00\u4e2a\u9879\u76ee\uff0c\u7528\u6237\u767b\u5f55\u4ee5\u540e\u7528\u4e862\u5206\u949f\u5de6\u53f3\u9875\u9762\u9700\u8981\u518d\u6b21\u767b\u5f55\u3002\u67e5\u770b\u9879\u76ee\u6e90\u7801\u8bbe\u7f6e session \u4fdd\u5b58\u65f6\u95f4\u4e3a30\u5206\u949f\u3002\u672c\u9879\u76ee4\u53f0\u5e94\u7528\u670d\u52a1\u5668IP \u4e3a10.x.x.210-213 \u300210.x.x.214 \u4e3a\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668 \u5668\u3002

\n

\u8d1f\u8f7d\u5747\u8861\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u4e2d\u6807\u9e92\u9e9f\uff0c\u8d1f\u8f7d\u8f6f\u4ef6 Tengine2.1.2 \u3002\u5355\u72ec\u767b\u5f55\u56db\u53f0\u5e94\u7528\u4f7f\u7528\u5747\u6b63\u5e38\uff0c\u4f7f\u7528 10.x.x.214  \u767b\u5f55\u670d\u52a1\u5668\u4f7f\u7528\u4e00\u5230\u4e24\u5206\u949f\u540e\u767b\u5f55\u4fe1\u606f\u4e22\u5931\u9700\u8981\u91cd\u65b0\u767b\u5f55\u3002

\n

\u95ee\u9898\u89e3\u51b3

\n

\u5355\u72ec\u4f7f\u7528\u6b63\u5e38\uff0c\u67e5\u770b\u6e90\u7801 session \u8d85\u65f6\u65f6\u95f4\u4e3a30\u79d2\u6392\u9664\u5e94\u7528\u672c\u8eab\u95ee\u9898\u3002telnet 10.x.x.210 -213 11211 \u7684 memcached \u670d\u52a1\uff0cget \u83b7\u53d6 key \u503c\uff0c\u65e0\u5f02\u5e38\u3002\u5220\u9664\u6240\u6709 KEY \u5173\u95ed4\u53f0 memcached \u91cd\u65b0\u542f\u52a8\uff0c\u95ee\u9898\u4f9d\u7136\u5b58\u5728\u3002\u67e5\u770b Tengine \u76ee\u5f55 logs \u76ee\u5f55\u4e0b error.log \u6587\u4ef6\u53d1\u73b0\u5927\u91cf Upstream timed out (110: Connection timed out) while reading response header from upstream \u62a5\u9519\u4fe1\u606f\u3002

\n

1. nginx proxy
\n\t\u9700\u8981\u9002\u5f53\u7684\u8c03\u6574proxy_read_timeout\u503c\u3002
\n\t
\n\t
\n\tlocation / {
\n\t        ...
\n\t        proxy_read_timeout 150;
\n\t        ...
\n\t    }
\n\t
\n\t2. Nginx\u4f5c\u4e3aphp-fpm\u7b49\u7b49\u5176\u4ed6\u7684\u6709\u4e0a\u6e38\u670d\u52a1
\n\t
\n\t\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9002\u5f53\u7684\u8c03\u6574fastcgi_read_timeout\u9009\u9879\u503c
\n\t
\n\t location ~* .php$ {
\n\t    include         fastcgi_params;
\n\t    fastcgi_index   index.php;
\n\t    fastcgi_read_timeout 150;
\n\t    fastcgi_pass    127.0.0.1:9000;
\n\t    fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
\n\t}
\n\t\u672c\u9879\u76ee\u4f7f\u7528\u7684\u662f nginx proxy \u6240\u4ee5\u53ea\u9700\u8981\u5728 location \u91cc\u6dfb\u52a0  proxy_read_timeout 150; \u5373\u53ef\u3002
\n\t

\n"}, {"title": "\u9879\u76ee\u4e2d\u8fde\u63a5\u88ab\u91cd\u7f6e\u63d0\u4ea4\u4e0d\u4e86\u6570\u636e", "desc": "\u6c5f\u897f\u7684\u4e00\u4e2a\u9879\u76ee\uff0c4\u53f0Tongweb\u505a\u8d1f\u8f7d\u5747\u8861\uff0c\u6709\u4e00\u53f0212\u670d\u52a1\u5668\u603b\u662f\u4fdd\u5b58\u4e0d\u4e86\u4fe1\u8bbf\u4ef6\u3002\u901a\u8fc7\u524d\u53f0\u9875\u9762\u63d0\u4ea4\u6392\u67e5addInput.do\u8fd9\u4e2a\u9875\u9762\u603b\u662f\u88ab\u91cd\u7f6e\u3002", "content": "

\r\n\t\u95ee\u9898\u63cf\u8ff0

\r\n

\u6c5f\u897f\u9879\u76ee\uff0c4\u53f0Tongweb\u505a\u8d1f\u8f7d\u5747\u8861\uff0c\u6709\u4e00\u53f0212\u670d\u52a1\u5668\u603b\u662f\u4fdd\u5b58\u4e0d\u4e86\u4fe1\u8bbf\u4ef6\u3002\u4e0d\u63d0\u793a\u4efb\u4f55\u62a5\u9519\u4fe1\u606f\uff0c\u70b9\u4fdd\u5b58\u6309\u94ae\u611f\u89c9\u9875\u9762\u50cf\u5237\u65b0\u4e86\u4e00\u4e0b\uff0c\u4f46\u662f\u586b\u5199\u7684\u6570\u636e\u8fd8\u5728\u3002\u6545\u610f\u7559\u51e0\u4e2a\u5e26\u661f\u53f7\u7684\u6587\u672c\u7b50\u4e0d\u586b\uff0c\u70b9\u51fb\u4fdd\u5b58\u6309\u94ae\uff0c\u6b63\u5e38\u63d0\u793a\u5fc5\u586b\u9879\u76ee\uff0cAjex\u6b63\u5e38\u5f39\u51fa\u63d0\u793a\u4fe1\u606f\u3002\u91cd\u65b0\u5c06\u4fe1\u8bbf\u4ef6\u4fe1\u606f\u586b\u5199\u5b8c\u6574\u518d\u6b21\u70b9\u51fb\u4fdd\u5b58\u6309\u94ae\u4f9d\u7136\u65e0\u6cd5\u4fdd\u5b58\u3002

\r\n

\u6545\u969c\u5206\u6790

\r\n

\u5148\u5c06\u670d\u52a1\u5668IP\u5730\u5740\u52a0\u5165\u6d4f\u89c8\u5668\u4fe1\u4efb\u533a\u57df\u9632\u6b62\u63d2\u4ef6\u963b\u6b62\u4e4b\u7c7b\u7684\u95ee\u9898\uff08\u5176\u5b9e\u7b2c\u4e00\u65f6\u95f4\u6392\u9664\u4e86\u8fd9\u4e2a\u539f\u56e0\uff0c\u6362\u4e86\u51e0\u53f0\u7535\u8111\u6d4b\u8bd5\u4e86^_^\uff09\u3002

\r\n

\u6545\u610f\u7559\u51e0\u4e2a\u5e26\u661f\u53f7\u7684\u6587\u672c\u7b50\u4e0d\u586b\uff0c\u70b9\u51fb\u4fdd\u5b58\u6309\u94ae\uff0c\u6b63\u5e38\u63d0\u793a\u5fc5\u586b\u9879\u76ee\uff0cAjex\u6b63\u5e38\u5f39\u51fa\u63d0\u793a\u4fe1\u606f\u3002\u8bf4\u660e\u524d\u7aef\u63a7\u5236 JS \u8d77\u4f5c\u7528\u4e86\uff0c\u4f7f\u7528\u6d4f\u89c8\u5668 “\u67e5\u770b\u5143\u7d20” \u8c03\u8bd5\u529f\u80fd\u63d0\u793a addInput.do \u9875\u9762\u6709 ERR_CONNECTION_RESET \u62a5\u9519\u4fe1\u606f\u3002\u5224\u65ad\u53ef\u80fd\u662f\u7f51\u7edc\u539f\u56e0\u5bfc\u81f4\u7684\u3002

\r\n

\r\n\t\u89e3\u51b3\u95ee\u9898

\r\n

\u7528ping -t -l, telnet \u7b49\u547d\u4ee4\u6d4b\u8bd5\u670d\u52a1\u5668\u7f51\u7edc\u4e0d\u4e22\u5305\u65e0\u5ef6\u8fdf\uff0c\u5173\u95ed\u7cfb\u7edf\u81ea\u5e26\u7684 IPTABLES \u9632\u706b\u5899\u3002selinux \u8bbe\u7f6e\u4e3a disabled \u3002\u91cd\u65b0\u6d4b\u8bd5\u4fe1\u8bbf\u4ef6\u63d0\u4ea4\u95ee\u9898\u4f9d\u65e7\uff0c\u65e0\u4efb\u4f55\u6539\u53d8\u3002

\r\n

\u5173\u95ed\u56db\u53f0\u5e94\u7528\u7684 memcached \u6e05\u7a7a\u7f13\u5b58\uff0c\u95ee\u9898\u4f9d\u65e7

\r\n

\u5c06\u9879\u76ee\u4ee3\u7801\u4ece\u597d\u7684\u670d\u52a1\u5668\u4e0a\u62f7\u8d1d\u8fc7\u6765\uff0c\u91cd\u65b0\u90e8\u7f72\u95ee\u9898\u4f9d\u65e7\uff0c\u6ca1\u529e\u6cd5\u5c06\uff0c\u95ee\u9898\u670d\u52a1\u5668\u4ece\u96c6\u7fa4\u4e2d\u5254\u9664\uff0c\u5c1d\u8bd5\u4fdd\u5b58\uff0c\u4f9d\u7136\u4fdd\u5b58\u4e0d\u4e86\uff0c\u91cd\u65b0\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf\uff0c\u90e8\u7f72 rsync \u540c\u6b65\uff0cmemcached \u7f13\u5b58\uff0c\u5b89\u88c5 Tongweb \u518d\u6b21\u542f\u52a8\u9192\u76ee\u6d4b\u8bd5\uff0c\u4fdd\u5b58\u5c45\u7136\u6210\u529f\u4e86\u3002\u4e07\u6076\u7684\u7cfb\u7edf\u95ee\u9898\"\"\uff0c\u7528\u4e86\u4e24\u5929\uff0c\u66f4\u65b0\u4ee3\u7801\u3002\u53c8\u6ca1\u529e\u6cd5\u4fdd\u5b58\u4e86\uff0c\u53c8\u662f\u91cd\u590d\u4e86\u4e0a\u9762\u4e00\u7cfb\u5217\u64cd\u4f5c\u8fd8\u662f\u4e0d\u7ba1\uff0c\u96be\u9053\u53c8\u8981\u91cd\u88c5\u7cfb\u7edf\uff1f

\r\n

\u51b7\u9759\u4e0b\u6765\u4ed4\u7ec6\u60f3\u60f3 ps ,top ,netstat \u7b49\u7cfb\u5217\u547d\u4ee4\u67e5\u4e0b\u6765\u4e5f\u6ca1\u53d1\u73b0\u5927\u5185\u5b58\u5360 CPU \u7684\u5f02\u5e38\u8d44\u6e90\uff0cnetstat -ntpl \u770b\u5230\u4e86 httpd \u3001python \u3001rpc *\u3001xinted \u591a\u597d\u6ca1\u7528\u7684\u5230\u7aef\u53e3\u670d\u52a1\u3002\u6d01\u7656\u5fc3\u7406\uff0c\u9664\u4e86 java ,sshd \uff0crsync,memcached \u51e0\u4e2a\u7528\u5230\u7684\u8fdb\u7a0b\u5176\u4ed6\u5168\u90e8 kill \uff0c\u5728\u6b21\u6d4b\u8bd5\u4fe1\u8bbf\u4ef6\u4fdd\u5b58\u3002\u5c45\u7136\u6210\u529f\u4e86\u3002\u90a3\u4e2a\u6b23\u559c\u554a\"\"

\r\n

\r\n\t\u95ee\u9898\u603b\u7ed3

\r\n

\u65b0\u9879\u76ee\u4e0a\u7ebf\u4e4b\u524d\u5b89\u88c5\u670d\u52a1\u5668\u6700\u597d\u4f7f\u7528\u7cbe\u7b80\u5b89\u88c5\uff0c\u7528\u4e0d\u5230\u7684\u7a0b\u5e8f\u4e0d\u8981\u968f\u610f\u5b89\u88c5\uff08\u6211\u4eec\u8fd9\u4e2a\u662f\u4fe1\u606f\u4e2d\u5fc3\u653f\u5e9c\u91c7\u8d2d\u5fc5\u987b\u4f7f\u7528\u4e2d\u6807\u9e92\u9e9f\uff0c\u8fd8\u662f\u5b8c\u5168\u5b89\u88c5\u7684\u6ca1\u529e\u6cd5\u5440\"\"\u6211\u8fd8\u662f\u504f\u7231 centos6.6mini\u7248\u5c0f\u800c\u8f7b\u5feb\uff09\u3002\u540e\u671f\u8ddf\u4fe1\u606f\u4e2d\u5fc3\u53cd\u6620\u60c5\u51b5\uff0c\u6709\u53ef\u80fd\u662f\u4ed6\u4eec\u9879\u76ee\u4e2d\u91c7\u8d2d\u7684360\u3001\u8d8b\u52bf\u9632\u706b\u5899\u963b\u6b62\u4e86\u7a0b\u5e8f\u8fd0\u884c\u3002\u8fd9\u91cc\u8fd8\u662f\u5f97\u8868\u626c\u4e0b\u817e\u8baf\u4e91\u3001\u963f\u91cc\u4e91\u8fd9\u4e9b\u5e26\u5934\u5927\u54e5\uff0c\u91cd\u6765\u6ca1\u53d1\u751f\u8fc7\u8fd9\u79cd\u5947\u8469\u53eb\u4eba\u6293\u72c2\u7684\u95ee\u9898\u3002

\r\n"}, {"title": "\u5de7\u7528\u53cd\u5411\u4ee3\u7406\u53bb\u9664\u9879\u76ee\u4e2d\u7684\u5de5\u7a0b\u540d", "desc": "\u6700\u8fd1\u5b9e\u65bd\u6bd5\u8282\u7684\u4e00\u4e2a\u9879\u76ee\uff0c\u90e8\u7f72Tomcat\u7684\u65f6\u5019\u628a\u9879\u76ee\u540d\u8bbe\u7f6e\u6210 ROOT \u5c31\u662f\u4e0d\u9700\u8981\u5de5\u7a0b\u540d\u8bbf\u95ee\u561b\u3002\u53d1\u73b0\u6709\u90e8\u5206\u8fde\u63a5\u6253\u4e0d\u5f00\uff0c\u8be2\u95ee\u5f00\u53d1\uff0c\u53ea\u544a\u8bc9\u6211\u8bf4\u90e8\u7f72\u7684\u65f6\u5019\u4e0d\u80fd\u4fee\u6539\u6587\u4ef6\u5939\u540d\u3002", "content": "

1.\u4e8b\u60c5\u662f\u8fd9\u6837\u6ef4

\r\n

\u6700\u8fd1\u5b9e\u65bd\u6bd5\u8282\u7684\u4e00\u4e2a\u9879\u76ee\uff0c\u90e8\u7f72Tomcat\u7684\u65f6\u5019\u628a\u9879\u76ee\u540d\u8bbe\u7f6e\u6210 ROOT \u5c31\u662f\u4e0d\u9700\u8981\u5de5\u7a0b\u540d\u8bbf\u95ee\u561b\u3002\u53d1\u73b0\u6709\u90e8\u5206\u8fde\u63a5\u6253\u4e0d\u5f00\uff0c\u8be2\u95ee\u5f00\u53d1\uff0c\u53ea\u544a\u8bc9\u6211\u8bf4\u90e8\u7f72\u7684\u65f6\u5019\u4e0d\u80fd\u4fee\u6539\u6587\u4ef6\u5939\u540d\u3002\u8001\u706b\u554a\uff0c\u6709\u6d01\u7656\u554a\uff0c\u89c1\u4e0d\u5f97\u4ed6\u5f04\u90a3\u8e69\u811a\u7684\u5de5\u7a0b\u540d\u653e\u540e\u9762\u8bbf\u95ee\uff0c\u5ba2\u6237\u7528\u8d77\u6765\u4e5f\u4e0d\u65b9\u4fbf\u3002\u8c01\u53eb\u4eba\u5bb6\u662f\u5f00\u53d1\u5462\uff0c\u516c\u53f8\u652f\u67f1\u9886\u5bfc\u91cd\u89c6\uff0c\u53c8\u4e0d\u6562\u5f97\u7f6a\uff0c\u53ea\u80fd\u82e6\u903c\u4e86\u81ea\u5df1\u60f3\u5230\u7528 NGINX \u505a\u524d\u7aef\u670d\u52a1\u5668\uff0c\u53cd\u5411\u4ee3\u7406 TOMCAT .

\r\n

2.\u670d\u52a1\u67b6\u6784

\r\n

\u9879\u76ee\u5e94\u7528\u670d\u52a1 Tomcat6, \u8bbf\u95ee\u8def\u5f84\uff1ahttp://192.168.20.2:8082/bijie  

\r\n

Tengine\u524d\u7aef\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\uff1a http://192.168.20.3

\r\n

3.\u89e3\u51b3\u601d\u8def\u65b9\u6cd5

\r\n

\u5148\u524d\u8003\u8651\u4f7f\u7528rewrite,\u600e\u4e48\u5199\u90fd\u6709\u51e0\u4e2a\u8def\u5f84\u6253\u4e0d\u5f00\uff0c\u540e\u6765\u53cd\u8fc7\u6765\u4e00\u60f3\u5982\u679c  /bijie/ \u548c / \u8bbf\u95ee\u7684\u4e00\u6837\u7684\u5185\u5bb9\u95ee\u9898\u4e0d\u5c31\u89e3\u51b3\u4e86\u5417\u3002\u4e0b\u9762\u7ed9\u51fa Tengine \u7684\u5173\u952e\u4ee3\u7801\u3002

\r\n
\r\n\t
\r\n\r\n server {\r\n     listen  80;\r\n     server_name localhost;\r\n  location / {\r\n     proxy_pass http://192.168.20.2:8081/bijie/;\r\n     proxy_redirect off;\r\n     proxy_set_header HOST $host;\r\n     proxy_set_header X-Real-IP $remote_addr;\r\n     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n     client_max_body_size 10m;\r\n     client_body_buffer_size 128k;\r\n     proxy_connect_timeout 90;\r\n     proxy_send_timeout 90;\r\n     proxy_read_timeout 90;\r\n     proxy_buffer_size 4k;\r\n     proxy_buffers 4 32k;\r\n     proxy_busy_buffers_size 64k;\r\n     proxy_temp_file_write_size 64k;\r\n              }\r\n  location /bijie/ {\r\n     proxy_pass http://192.168.20.2:8081/bijie/;\r\n     proxy_redirect off;\r\n     proxy_set_header HOST $host;\r\n     proxy_set_header X-Real-IP $remote_addr;\r\n     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n     client_max_body_size 10m;\r\n     client_body_buffer_size 128k;\r\n     proxy_connect_timeout 90;\r\n     proxy_send_timeout 90;\r\n     proxy_read_timeout 90;\r\n     proxy_buffer_size 4k;\r\n     proxy_buffers 4 32k;\r\n     proxy_busy_buffers_size 64k;\r\n     proxy_temp_file_write_size 64k;\r\n                   }\r\n        }\r\n
\r\n
\r\n

\u6d4b\u8bd5\u8bbf\u95ee http://192.168.20.3  \u4e00\u5207\u6b63\u5e38\u3002

\r\n"}, {"title": "mybatis-generator\u4f7f\u7528\u65b9\u6cd5", "desc": "Windows\u64cd\u4f5c\u7cfb\u7edf\u4e0b\u901a\u8fc7CMD\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u9006\u5411\u751f\u6210\u5de5\u7a0b\u6587\u4ef6\u3002", "content": "

1.\u4e0b\u8f7dmybatis-generator-1.3.2-all.zip\u5de5\u5177

\r\n

\u81ea\u5df1\u767e\u5ea6\u4e0b\u8f7d\uff0c\u5b9e\u5728\u627e\u4e0d\u5230\u8054\u7cfb\u6211QQ\u7ed9\u4e00\u4e2a\uff0c\u628a\u4e0b\u8f7d\u597d\u7684mybatis-generator-1.3.2-all.zip\u8fdb\u884c\u89e3\u538b\u3002\u51fa\u73b0\u91cc\u9762mybatis-generator-core-1.3.2.jar\u662f\u6267\u884c\u6587\u4ef6\uff0cgeneratorConfig.xml\u662f\u914d\u7f6e\u6587\u4ef6\uff0c\u6211\u4eec\u7ec4\u8981\u7528\u5230\u8fd9\u4e24\u4e2a\u6587\u4ef6\uff0c\u5176\u4ed6\u6587\u4ef6\u4e0d\u505a\u89e3\u91ca\u3002

\r\n

2.\u8bbe\u7f6emybatis-generator.xml\u914d\u7f6e\u6587\u4ef6

\r\n

<generatorConfiguration>
\r\n\t    <!-- \u6570\u636e\u5e93\u9a71\u52a8\u5305\u4f4d\u7f6e -->
\r\n\t    <classPathEntry location="H:\\ojdbc6.jar" />
\r\n\t    <context id="DB2Tables" targetRuntime="MyBatis3">
\r\n\t        <commentGenerator>
\r\n\t            <property name="suppressAllComments" value="true" />
\r\n\t        </commentGenerator>
\r\n\t        <!-- \u6570\u636e\u5e93\u94fe\u63a5URL\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801 -->
\r\n\t      <!--    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/spring4_mybatis3" userId="root" password="XDP">  -->
\r\n\t        <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
\r\n\t        connectionURL="jdbc:oracle:thin:@192.168.134.104:1521:orcl"
\r\n\t        userId="lvs6jx"
\r\n\t        password="lvs6jx">
\r\n\t        </jdbcConnection>
\r\n\t        <javaTypeResolver>
\r\n\t            <property name="forceBigDecimals" value="false" />
\r\n\t        </javaTypeResolver>
\r\n\t        <!-- \u751f\u6210\u5b9e\u4f53\u7c7b\u7684\u5305\u540d\u548c\u4f4d\u7f6e\uff0c\u8fd9\u91cc\u914d\u7f6e\u5c06\u751f\u6210\u7684\u5b9e\u4f53\u7c7b\u653e\u5728me.jschrj.po\u8fd9\u4e2a\u5305\u4e0b -->
\r\n\t        <javaModelGenerator targetPackage="me.jschrj.po" targetProject="D:\\MyEclipse\\ygxf7.0\\src\\main\\java">
\r\n\t            <property name="enableSubPackages" value="true" />
\r\n\t            <property name="trimStrings" value="true" />
\r\n\t        </javaModelGenerator>
\r\n\t        <!-- \u751f\u6210\u7684SQL\u6620\u5c04\u6587\u4ef6\u5305\u540d\u548c\u4f4d\u7f6e\uff0c\u8fd9\u91cc\u914d\u7f6e\u5c06\u751f\u6210\u7684SQL\u6620\u5c04\u6587\u4ef6\u653e\u5728me.jschrj.mapping"\u8fd9\u4e2a\u5305\u4e0b -->
\r\n\t        <sqlMapGenerator targetPackage="me.jschrj.mapping" targetProject="D:\\MyEclipse\\ygxf7.0\\src\\main\\java">
\r\n\t            <property name="enableSubPackages" value="true" />
\r\n\t        </sqlMapGenerator>
\r\n\t        <!-- \u751f\u6210DAO\u7684\u5305\u540d\u548c\u4f4d\u7f6e\uff0c\u8fd9\u91cc\u914d\u7f6e\u5c06\u751f\u6210\u7684dao\u7c7b\u653e\u5728me.gacl.dao\u8fd9\u4e2a\u5305\u4e0b -->
\r\n\t        <javaClientGenerator type="XMLMAPPER" targetPackage="me.jschrj.mapping" targetProject="D:\\MyEclipse\\ygxf7.0\\src\\main\\java">
\r\n\t            <property name="enableSubPackages" value="true" />
\r\n\t        </javaClientGenerator>
\r\n\t        <!-- \u8981\u751f\u6210\u90a3\u4e9b\u8868(\u66f4\u6539tableName\u548cdomainObjectName\u5c31\u53ef\u4ee5) -->
\r\n\t        <table tableName="sys_user" domainObjectName="sys_user" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />
\r\n\t        <table tableName="sys_org" domainObjectName="xf_org" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />
\r\n\t    </context>

\r\n

\u5176\u4e2d\u6807\u7ea2\u7684\u90e8\u5206\u5c31\u662f\u6211\u4eec\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9700\u8981\u4fee\u6539\u7684\u90e8\u95e8\u6807\u6ce8\u7684\u5f88\u8be6\u7ec6\u3002

\r\n

3.\u8fd0\u884cmybatis-generator-core-1.3.2.jar\u751f\u6210\u6587\u4ef6

\r\n

     \u6253\u5f00CMD\u547d\u4ee4\u63d0\u793a\u7b26\u8f93\u5165

\r\n

g:  \u6309\u56de\u8f66\u952e\u8fdb\u5165G\u76d8                 //\u56e0\u4e3a\u6211\u7684mybatis-generator-1.3.2-all.zip\u662f\u89e3\u538b\u5728G\u76d8\u7684\uff0c\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u66f4\u6539

\r\n

cd mybatis-generator-1.3.2     \u6309\u56de\u8f66\u952e\u8fdb\u5165mybatis-generator-1.3.2\u7684\u6587\u4ef6\u4e3b\u76ee\u5f55

\r\n

\u8f93\u5165

\r\n

java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml -overwrite

\r\n

\u6309\u56de\u8f66\u952e\u751f\u6210\u6587\u4ef6

\r\n

 

\r\n

 

\r\n

 

\r\n"}, {"title": "\u5728maven\u4e2d\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93", "desc": "maven\u8c03\u7528\u8fdc\u7a0b\u4ed3\u5e93\u7684\u4e24\u79cd\u65b9\u6cd5\u8bb0\u5f55\uff0c\u4fbf\u4e8e\u6df1\u523b\u7406\u89e3maven\uff0c\u7b80\u5316\u9879\u76ee\u914d\u7f6e\u96be\u5ea6\u3002", "content": "

\r\n\t\u65b9\u6cd5\u4e00\uff1a\u4fee\u6539MAVEN\u914d\u7f6e\u6587\u4ef6

\r\n

\u5728MAVEN\u5b89\u88c5\u76ee\u5f55\u4e0b\u7740\u5230 conf \u76ee\u5f55\uff0c\u8fdb\u5165\u4e0b\u9762\u6709\u4e2a settings.xml \u6587\u4ef6\uff0c\u7528 Notepad++ \u6253\u5f00\u627e\u5230  \u8282\u70b9

\r\n

\u5c06\u5982\u4e0b\u5185\u5bb9\u590d\u5236\u5230\u8282\u70b9
\r\n\t  
\r\n\t      alimaven
\r\n\t      aliyun maven
\r\n\t      http://maven.aliyun.com/nexus/content/groups/public/
\r\n\t      central        
\r\n\t   

\r\n\t 

\r\n

\r\n\t\u65b9\u6cd5\u4e8c\uff1a\u4fee\u6539\u9879\u76ee\u4e2d\u7684 pom.xml \u6587\u4ef6

\r\n

MAVEN \u9879\u76ee\u4e0b\u6709\u4e00\u4e2a pom.xml \u6587\u4ef6\u5728\u91cc\u9762\u52a0\u5165

\r\n

 
\r\n\t  
\r\n\t   gilead-repo
\r\n\t   Gilead Maven Repository
\r\n\t   https://gilead.svn.sourceforge.net/svnroot/gilead/gilead/maven-repo
\r\n\t  

\r\n\t 

\r\n

\r\n\t\u5e38\u7528\u7684 MAVEN \u4ed3\u5e93

\r\n

\u5171\u6709\u7684\u4ed3\u5e93
\r\n\thttp://repo1.maven.org/maven2/
\r\n\thttp://repository.jboss.com/maven2/
\r\n\thttp://repository.sonatype.org/content/groups/public/
\r\n\thttp://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/
\r\n\thttp://maven.glassfish.org/content/groups/glassfish/
\r\n\thttp://maven.aliyun.com/nexus/content/groups/public/
\r\n\thttps://nexus.sourcesense.com/nexus/content/repositories/public/
\r\n\t
\r\n\t\u79c1\u6709\u7684\u4ed3\u5e93
\r\n\thttp://repository.codehaus.org/
\r\n\thttp://snapshots.repository.codehaus.org/
\r\n\thttp://people.apache.org/repo/m2-snapshot-repository
\r\n\thttp://people.apache.org/repo/m2-incubating-repository/

\r\n"}, {"title": "nginx\u5f02\u6b65\u4f20\u8f93\u6709\u4f18\u52bf", "desc": null, "content": "

\r\n\tNginx\u53cd\u5411\u4ee3\u7406\u6a21\u5f0f\u539f\u7406\u53ca\u4f18\u52bf

\r\n\t

\r\n\tNginx\u7684\u53cd\u5411\u4ee3\u7406\u662f\u4e00\u4e2a\u5f02\u6b65\u4f20\u8f93\u6a21\u5f0f\uff0c\u5b83\u53ef\u4ee5\u51cf\u5c11\u540e\u7aef\u8fde\u63a5\u6570\u548c\u538b\u529b\uff0c\u8fd9\u662f\u4e3a\u4f55\uff1f
\r\n\t
\r\n\t\u4e0b\u9762\u5c31\u6765\u8bb2\u89e3\u4e0b\u4f20\u7edf\u7684\u4ee3\u7406\uff08Apache/squid\uff09\u7684\u540c\u6b65\u4f20\u8f93\u548cnginx\u7684\u5f02\u6b65\u4f20\u8f93\u7684\u5dee\u5f02\u3002

\r\n

\"\"

\r\n

squid\u540c\u6b65\u4f20\u8f93\uff1a

\r\n

\u6d4f\u89c8\u5668\u53d1\u8d77\u8bf7\u6c42\uff0c\u800c\u540e\u8bf7\u6c42\u4f1a\u7acb\u523b\u88ab\u8f6c\u5230\u540e\u53f0\uff0c\u4e8e\u662f\u5728\u6d4f\u89c8\u5668\u548c\u540e\u53f0\u4e4b\u95f4\u5c31\u5efa\u7acb\u4e86\u4e00\u4e2a\u901a\u9053\u3002\u5728\u8bf7\u6c42\u53d1\u8d77\u76f4\u5230\u8bf7\u6c42\u5b8c\u6210\uff0c\u8fd9\u6761\u901a\u9053\u90fd\u662f\u4e00\u76f4\u5b58\u5728\u7684\u3002

\r\n

nginx\u5f02\u6b65\u4f20\u8f93\uff1a

\r\n

\u6d4f\u89c8\u5668\u53d1\u8d77\u8bf7\u6c42\uff0c\u8bf7\u6c42\u4e0d\u4f1a\u7acb\u523b\u8f6c\u5230\u540e\u53f0\uff0c\u800c\u662f\u5c06\u8bf7\u6c42\u6570\u636e\uff08header\uff09\u5148\u6536\u5230nginx\u4e0a\uff0c\u7136\u540enginx\u518d\u628a\u8fd9\u4e2a\u8bf7\u6c42\u53d1\u5230\u540e\u7aef\uff0c \u540e\u7aef\u5904\u7406\u5b8c\u4e4b\u540e\u628a\u6570\u636e\u8fd4\u56de\u5230nginx\u4e0a\uff0cnginx\u5c06\u6570\u636e\u6d41\u53d1\u5230\u6d4f\u89c8\u5668\uff0c\u8fd9\u70b9\u548clighttpd\u6709\u70b9\u4e0d\u540c\uff0clighttpd\u662f\u5c06\u540e\u7aef\u6570\u636e\u5b8c\u5168\u63a5\u6536\u540e\u624d\u53d1 \u9001\u5230\u6d4f\u89c8\u5668\u3002

\r\n

1) \u5047\u8bbe\u7528\u6237\u6267\u884c\u4e00\u4e2a\u4e0a\u4f20\u6587\u4ef6\u64cd\u4f5c\uff0c\u56e0\u4e3a\u7528\u6237\u7f51\u901f\u53c8\u6bd4\u8f83\u6162\uff0c\u56e0\u6b64\u9700\u8981\u82b1\u534a\u4e2a\u5c0f\u65f6\u624d\u80fd\u628a\u6587\u4ef6\u4f20\u5230\u670d\u52a1\u5668\u3002
\r\n\t
\r\n\tsquid\u7684\u540c\u6b65\u4ee3\u7406\u5728\u7528\u6237\u5f00\u59cb\u4e0a\u4f20\u540e\u5c31\u548c\u540e\u53f0\u5efa\u7acb\u4e86\u8fde \u63a5\uff0c\u534a\u5c0f\u65f6\u540e\u6587\u4ef6\u4e0a\u4f20\u7ed3\u675f\uff0c\u7531\u6b64\u53ef\u89c1\uff0c\u540e\u53f0\u670d\u52a1\u5668\u8fde\u63a5\u4fdd\u6301\u4e86\u534a\u4e2a\u5c0f\u65f6\uff1b
\r\n\t
\r\n\t\u800cnginx\u5f02\u6b65\u4ee3\u7406\u5c31\u662f\u5148\u5c06\u6b64\u6587\u4ef6\u6536\u5230nginx\u4e0a\uff0c\u56e0\u6b64\u4ec5\u4ec5\u662fnginx\u548c\u7528\u6237 \u4fdd\u6301\u4e86\u534a\u5c0f\u65f6\u8fde\u63a5\uff0c\u540e\u53f0\u670d\u52a1\u5668\u5728\u8fd9\u534a\u5c0f\u65f6\u5185\u6ca1\u6709\u4e3a\u8fd9\u4e2a\u8bf7\u6c42\u5f00\u542f\u8fde\u63a5\uff0c\u534a\u5c0f\u65f6\u540e\u7528\u6237\u4e0a\u4f20\u7ed3\u675f\uff0cnginx\u624d\u5c06\u4e0a\u4f20\u5185\u5bb9\u53d1\u5230\u540e\u53f0\uff0cnginx\u548c\u540e\u53f0\u4e4b\u95f4\u7684\u5e26\u5bbd \u662f\u5f88\u5145\u88d5\u7684\uff0c\u6240\u4ee5\u53ea\u82b1\u4e86\u4e00\u79d2\u949f\u5c31\u5c06\u8bf7\u6c42\u53d1\u9001\u5230\u4e86\u540e\u53f0\uff0c\u7531\u6b64\u53ef\u89c1\uff0c\u540e\u53f0\u670d\u52a1\u5668\u8fde\u63a5\u4fdd\u6301\u4e86\u4e00\u79d2\u3002\u540c\u6b65\u4f20\u8f93\u82b1\u4e86\u540e\u53f0\u670d\u52a1\u5668\u534a\u4e2a\u5c0f\u65f6\uff0c\u5f02\u6b65\u4f20\u8f93\u53ea\u82b1\u4e00\u79d2\uff0c\u53ef\u89c1\u4f18\u5316 \u7a0b\u5ea6\u5f88\u5927\u3002
\r\n\t
\r\n\t2) \u5728\u4e0a\u9762\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5047\u5982\u540e\u53f0\u670d\u52a1\u5668\u56e0\u4e3a\u79cd\u79cd\u539f\u56e0\u91cd\u542f\u4e86\uff0c\u4e0a\u4f20\u6587\u4ef6\u5c31\u81ea\u7136\u4e2d\u65ad\u4e86\uff0c\u8fd9\u5bf9\u7528\u6237\u6765\u8bf4\u662f\u975e\u5e38\u607c\u706b\u7684\u4e00\u4ef6\u4e8b\u60c5\uff0c\u60f3\u5fc5\u5404\u4f4d\u4e5f\u6709\u4e0a\u4f20\u6587\u4ef6\u4f20\u5230\u4e00\u534a\u88ab\u4e2d\u65ad\u7684 \u7ecf\u5386\u3002
\r\n\t
\r\n\t\u7528nginx\u4ee3\u7406\u4e4b\u540e\uff0c\u540e\u53f0\u670d\u52a1\u5668\u7684\u91cd\u542f\u5bf9\u7528\u6237\u4e0a\u4f20\u7684\u5f71\u54cd\u51cf\u5c11\u5230\u4e86\u6781\u70b9\uff0c\u800cnginx\u662f\u975e\u5e38\u7a33\u5b9a\u7684\u5e76\u4e0d\u9700\u8981\u5e38\u53bb\u91cd\u542f\u5b83\uff0c\u5373\u4f7f\u9700\u8981\u91cd\u542f\uff0c\u5229\u7528kill -HUP\u5c31\u53ef\u4ee5\u505a\u5230\u4e0d\u95f4\u65ad\u91cd\u542fnginx\u3002
\r\n\t
\r\n\t3) \u5f02\u6b65\u4f20\u8f93\u53ef\u4ee5\u4ee4\u8d1f\u8f7d\u5747\u8861\u5668\u66f4\u6709\u4fdd\u969c\uff0c\u4e3a\u4ec0\u4e48\u8fd9\u4e48\u8bf4\u5462\uff1f
\r\n\t
\r\n\t\u5728\u5176\u5b83\u7684\u5747\u8861\u5668\uff08lvs/haproxy/apache\u7b49\uff09\u91cc\uff0c\u6bcf\u4e2a\u8bf7\u6c42\u90fd\u662f\u53ea\u6709\u4e00\u6b21\u673a\u4f1a\u7684\uff0c\u5047\u5982\u7528 \u6237\u53d1\u8d77\u4e00\u4e2a\u8bf7\u6c42\uff0c\u7ed3\u679c\u8be5\u8bf7\u6c42\u5206\u5230\u7684\u540e\u53f0\u670d\u52a1\u5668\u521a\u597d\u6302\u6389\u4e86\uff0c\u90a3\u4e48\u8fd9\u4e2a\u8bf7\u6c42\u5c31\u5931\u8d25\u4e86\uff1b\u800cnginx\u56e0\u4e3a\u662f\u5f02\u6b65\u7684\uff0c\u6240\u4ee5\u8fd9\u4e2a\u8bf7\u6c42\u53ef\u4ee5\u91cd\u65b0\u53d1\u5f80\u4e0b\u4e00\u4e2a\u540e\u53f0\uff0c\u4e0b\u4e00\u4e2a \u540e\u53f0\u8fd4\u56de\u4e86\u6b63\u5e38\u7684\u6570\u636e\uff0c\u4e8e\u662f\u8fd9\u4e2a\u8bf7\u6c42\u5c31\u80fd\u6210\u529f\u4e86\u3002
\r\n\t
\r\n\t\u8fd8\u662f\u7528\u7528\u6237\u4e0a\u4f20\u6587\u4ef6\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u5047\u5982\u4e0d\u4f46\u7528\u4e86nginx\u4ee3\u7406\uff0c\u800c\u4e14\u7528\u4e86\u8d1f\u8f7d\u5747\u8861\uff0cnginx\u628a\u4e0a\u4f20\u6587\u4ef6\u53d1\u5f80 \u5176\u4e2d\u4e00\u53f0\u540e\u53f0\uff0c\u4f46\u8fd9\u53f0\u670d\u52a1\u5668\u7a81\u7136\u91cd\u542f\u4e86\uff0cnginx\u6536\u5230\u9519\u8bef\u540e\uff0c\u4f1a\u5c06\u8fd9\u4e2a\u4e0a\u4f20\u6587\u4ef6\u53d1\u5230\u53e6\u4e00\u53f0\u540e\u53f0\uff0c\u4e8e\u662f\u7528\u6237\u5c31\u4e0d\u7528\u518d\u82b1\u534a\u5c0f\u65f6\u4e0a\u4f20\u4e00\u904d\u3002
\r\n\t
\r\n\t4) \u5047\u5982\u7528\u6237\u4e0a\u4f20\u4e00\u4e2a10GB\u5927\u5c0f\u7684\u6587\u4ef6\uff0c\u800c\u540e\u53f0\u670d\u52a1\u5668\u6ca1\u6709\u8003\u8651\u5230\u8fd9\u4e2a\u60c5\u51b5\uff0c\u90a3\u4e48\u540e\u53f0\u670d\u52a1\u5668\u5c82\u4e0d\u8981\u5d29\u6e83\u4e86\u3002
\r\n\t
\r\n\t\u7528nginx\u5c31\u53ef\u4ee5\u628a\u8fd9\u4e9b\u4e1c\u897f\u90fd\u62e6\u5728nginx\u4e0a\uff0c \u901a\u8fc7nginx\u7684\u4e0a\u4f20\u6587\u4ef6\u5927\u5c0f\u9650\u5236\u529f\u80fd\u6765\u9650\u5236\uff0c\u53e6\u5916nginx\u6027\u80fd\u975e\u5e38\u6709\u4fdd\u969c\uff0c\u5c31\u653e\u5fc3\u7684\u8ba9\u4e92\u8054\u7f51\u4e0a\u90a3\u4e9b\u53e6\u7c7b\u7684\u7528\u6237\u548cnginx\u5bf9\u6297\u53bb\u5427\u3002
\r\n\t\u7528Nginx\u4f1a\u9020\u6210\u7684\u95ee\u9898\uff1a
\r\n\t\u540e\u53f0\u670d\u52a1\u5668\u6709\u63d0\u4f9b\u4e0a\u4f20\u8fdb\u5ea6\u7684\u529f\u80fd\u7684\u8bdd\uff0c\u7528\u4e86nginx\u4ee3\u7406\u5c31\u65e0\u6cd5\u53d6\u5f97\u8fdb\u5ea6\uff0c\u8fd9\u4e2a\u9700\u8981\u4f7f\u7528nginx\u7684\u4e00\u4e2a\u7b2c\u4e09\u65b9\u6a21\u5757\u6765\u5b9e\u73b0\u3002

\r\n"}, {"title": "Tomcat\u7f16\u7801\u95ee\u9898\u5bfc\u81f4\u9879\u76ee\u9875\u9762\u53d8\u5316", "desc": "\u56e0\u4e3aTomcat\u7684\u7f16\u7801\u95ee\u9898\u5bfc\u81f4\u7684\u670d\u52a1\u9879\u76ee\u7684\u9875\u9762\u548c\u672c\u5730\u6d4b\u8bd5\u73af\u5883\u7684\u9875\u9762\u4e0d\u4e00\u81f4\u3002\u5bfc\u81f4\u6709\u4e9b\u529f\u80fd\u62a5\u9519\u3002", "content": "

\u95ee\u9898\u63cf\u8ff0

\r\n

\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u90e8\u7f72JDK+TOMCAT\u5e94\u7528\u73af\u5883\uff0c\u53d1\u73b0\u670d\u52a1\u5668\u4e0a\u7684\u5e94\u7528\u9875\u9762\u548c\u672c\u5730\u73af\u5883\u5e94\u7528\u9875\u9762\u4e0d\u4e00\u81f4\uff0c\u90e8\u5206\u529f\u80fd\u62a5\u9519\u3002\u5f00\u59cb\u6000\u7591\u662fJDK\u4ee5\u53caTOMCAT\u7684\u672c\u6765\u548c\u672c\u5730\u5f00\u53d1\u73af\u5883\u7248\u672c\u4e0d\u4e00\u81f4\u6216\u8005\u662f\u6570\u636e\u5e93\u7f3a\u5c11\u8868\u6216\u8005\u662f\u7528\u6237\u5bf9\u8c61\u5bfc\u81f4\u7684\u3002\u66f4\u6539\u670d\u52a1\u5668JDK\u548cTOMCAT\u7248\u672c\u548c\u672c\u5730\u5f00\u53d1\u73af\u5883\u4e00\u81f4\u5e76\u4e14\u670d\u52a1\u5668\u548c\u672c\u5730\u5f00\u53d1\u73af\u5883\u94fe\u63a5\u540c\u4e00\u6570\u636e\u5e93\uff0c\u9879\u76ee\u4f9d\u7136\u663e\u793a\u4e0d\u6b63\u5e38\u3002

\r\n

\u89e3\u51b3\u95ee\u9898

\r\n

\u901a\u8fc7\u66f4\u6539\u670d\u52a1\u5668JDK\u548cTOMCAT\u7248\u672c\u4f9d\u7136\u65e0\u6cd5\u89e3\u51b3\u9879\u76ee\u663e\u793a\u4e0d\u6b63\u5e38\u540e\uff0c\u67e5\u770b\u9879\u76ee\u542f\u52a8\u65e5\u5fd7\u4e5f\u65e0\u5f02\u5e38\u3002\u540e\u6765\u6bd4\u5bf9TOMCAT\u914d\u7f6e\u6587\u4ef6server.xml\u6587\u4ef6\uff0c\u53d1\u73b0\u672c\u5730\u73af\u5883\u4e2d\u7684\u914d\u7f6e\u6587\u4ef6

\r\n

    <Connector port="80" protocol="HTTP/1.1"
\r\n\t               connectionTimeout="20000"
\r\n\t               redirectPort="8443" URIEncoding="UTF-8" />

\r\n

\u6bd4\u670d\u52a1\u5668\u4e0a\u591a\u4e86\u4e00\u4e2a URIEncoding="UTF-8" \u5bfc\u81f4\u7684\u670d\u52a1\u5668\u9879\u76ee\u663e\u793a \u95ee\u9898\uff0c\u7531\u4e8e\u65b0\u5b89\u88c5\u7684Tomcat\u9ed8\u8ba4\u6ca1\u6709\u8bbe\u7f6e\u7f16\u7801\u5bfc\u81f4\u9879\u76ee\u663e\u793a\u5f02\u5e38\uff0c\u8fd9\u4e2a\u95ee\u9898\u6bd4\u8f83\u4e0d\u5bb9\u6613\u53d1\u73b0\uff0c\u5982\u679c\u53d1\u73b0\u81ea\u5df1\u7684\u9879\u76ee\u663e\u793a\u4e0d\u6b63\u5e38\u7684\uff0c\u65e0\u59a8\u628aTomcat\u7684\u7f16\u7801\u683c\u5f0f\u66f4\u6539\u548c\u9879\u76ee\u672c\u8eab\u7f16\u7801\u4e00\u81f4\uff0c\u5c1d\u8bd5\u89e3\u51b3\u95ee\u9898\u3002

\r\n"}, {"title": "Tomcat\u5e76\u53d1\u5927\u62a5\u9519\u5904\u7406", "desc": "\u53f8\u6cd5\u5385\u4fe1\u8bbf\u6295\u8bc9\u5e73\u53f0Windows\u670d\u52a1\u5668\u4e0bTomcat\u62a5\u9519\u5904\u7406\u3002", "content": "

\r\n\t\u62a5\u9519\u4fe1\u606f

\r\n

Maximum number of threads (200) created for connector with address null and port 80

\r\n

\r\n\t\u62a5\u9519\u539f\u56e0

\r\n

\u6700\u5927\u7ebf\u7a0b\u6570\u9519\u8bef\uff0c\u7b80\u5355\u8bf4\u5c31\u662f\u5e76\u53d1\u592a\u5927\u62a5\u7684\u9519\uff0c\u524d\u671f\u6ca1\u60f3\u5230\u4f1a\u6709\u8fd9\u4e48\u591a\u8bbf\u95ee\u91cf\u3002\u5355\u5e94\u7528\uff0c\u5355TOMCAT\u3002

\r\n

\r\n\t\u89e3\u51b3\u529e\u6cd5

\r\n

1.\u7531\u4e8eWindows\u7cfb\u7edf\uff0c\u76f4\u63a5\u5173\u95edTomcat\u91cd\u65b0\u6253\u5f00\uff0c\u7f51\u7ad9\u5373\u53ef\u8bbf\u95ee

\r\n

2.\u7f51\u4e0a\u7ed9\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u7ebf\u7a0b\u6c60\uff0c\u7528\u8f83\u5c11\u7684\u7ebf\u7a0b\u5904\u7406\u8f83\u591a\u7684\u8bbf\u95ee\uff0c\u6765\u63d0\u9ad8tomcat\u5904\u7406\u8bf7\u6c42\u7684\u80fd\u529b\u3002

\r\n

\u9996\u5148,\u6253\u5f00/conf/server.xml\uff0c\u589e\u52a0
\r\n\t
\r\n\t                maxThreads="500" minSpareThreads="20" maxIdleTime="60000" />
\r\n\t
\r\n\t 
\r\n\t\u6700\u5927\u7ebf\u7a0b500\uff08\u4e00\u822c\u670d\u52a1\u5668\u8db3\u4ee5\uff09\uff0c\u6700\u5c0f\u7a7a\u95f2\u7ebf\u7a0b\u657020\uff0c\u7ebf\u7a0b\u6700\u5927\u7a7a\u95f2\u65f6\u95f460\u79d2\u3002
\r\n\t
\r\n\t\u7136\u540e\uff0c\u4fee\u6539\u8282\u70b9\uff0c\u589e\u52a0executor\u5c5e\u6027\uff0c\u5982:
\r\n\t
\r\n\t                       port="80" protocol="HTTP/1.1"      
\r\n\t                   connectionTimeout="60000"    
\r\n\t                   keepAliveTimeout="15000"    
\r\n\t                   maxKeepAliveRequests="1"    
\r\n\t                   redirectPort="8443" />

\r\n

\u4ee5\u4e0a\u4e3b\u8981\u662f\u4fee\u6539server.xml\u7684\u914d\u7f6e\u6765\u4f18\u5316\u94fe\u63a5\u6570\uff0c\u5e94\u4ed8\u5927\u5e76\u53d1\u8fd8\u662f\u5f97\u9760\u591a\u53f0WEB\u4ee5\u53ca\u8d1f\u8f7d\u5747\u8861\u3002

\r\n"}, {"title": "Linux\u4e0bTomcat\u914d\u7f6e\u4f18\u5316", "desc": "\u63d0\u9ad8JAVA\u865a\u62df\u673a\u7684\u8fd0\u884c\u5185\u5b58\uff0cTomcat\u8fd0\u884c\u6700\u5927\u7ebf\u7a0b\u6c60\u6765\u4f18\u5316Linux\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u7684Tomcat\u4e2d\u95f4\u4ef6\u3002", "content": "

tomcat\u8fd0\u884c\u671f\u4f18\u5316\u53ca\u95ee\u9898\u89e3\u51b3\u65b9\u6848 Tomcat \u7ebf\u7a0b\u6c60

\r\n

\r\n\t1\u3001\u73af\u5883\u8bf4\u660e

\r\n

\u3000\u3000Linux \u64cd\u4f5c\u7cfb\u7edf\u4e0b \u8fd0\u884c APACHE TOMCAT

\r\n

\r\n\t2\u3001\u589e\u52a0jvm \u5185\u5b58\u7684\u914d\u7f6e

\r\n

        \u8fdb\u5165  TOMCAT \u7684  bin \u76ee\u5f55\u4fee\u6539 catalina.sh \u6587\u4ef6\u589e\u52a0 JVM \u8fd0\u884c\u5185\u5b58

\r\n

\u3000\u3000#vi catalina.sh
\r\n\t
\r\n\t\u3000\u3000\u63d2\u5165\u5982\u4e0b:
\r\n\t
\r\n\t\u3000\u3000JAVA_OPTS='-Xms512m -Xmx2048m'
\r\n\t       # \u6700\u5927\u8fd0\u884c\u5185\u5b582G\uff0c\u6700\u5c0f\u8fd0\u884c\u5185\u5b58512M

\r\n

\r\n\t3\u3001\u5927\u5e76\u53d1\u4e0b\u62a5\u9519\u53ca\u4f18\u5316

\r\n

\u62a5\u9519\u4fe1\u606f\uff1aINFO: Maximum number of threads (200) created for connector with address null and port 8080
\r\n\t
\r\n\t\u3000\u3000\u8bf4\u660e\uff1a\u6700\u5927\u7ebf\u7a0b\u6570\u9519\u8bef
\r\n\t
\r\n\t\u3000\u3000\u89e3\u51b3\u65b9\u6848\uff1a
\r\n\t
\r\n\t\u3000\u3000\u4f7f\u7528\u7ebf\u7a0b\u6c60\uff0c\u7528\u8f83\u5c11\u7684\u7ebf\u7a0b\u5904\u7406\u8f83\u591a\u7684\u8bbf\u95ee\uff0c\u53ef\u4ee5\u63d0\u9ad8tomcat\u5904\u7406\u8bf7\u6c42\u7684\u80fd\u529b\u3002\u4f7f\u7528\u65b9\u5f0f\uff1a
\r\n\t
\r\n\t\u3000\u3000\u9996\u5148\u3002\u6253\u5f00/conf/server.xml\uff0c\u589e\u52a0
\r\n\t
\r\n\t\u3000\u3000
\r\n\t\u6700\u5927\u7ebf\u7a0b500\uff08\u4e00\u822c\u670d\u52a1\u5668\u8db3\u4ee5\uff09\uff0c\u6700\u5c0f\u7a7a\u95f2\u7ebf\u7a0b\u657020\uff0c\u7ebf\u7a0b\u6700\u5927\u7a7a\u95f2\u65f6\u95f460\u79d2\u3002
\r\n\t
\r\n\t\u3000\u3000\u7136\u540e\uff0c\u4fee\u6539\u8282\u70b9\uff0c\u589e\u52a0executor\u5c5e\u6027\uff0c\u5982:
\r\n\t\u3000\u3000<Connector executor="tomcatThreadPool" port="80" protocol="HTTP/1.1" connectionTimeout="60000" keepAliveTimeout="15000" maxKeepAliveRequests="1" redirectPort="443" ....../>

\r\n


\r\n\t\u3000\u30004\u3001java.net.SocketException: Too many open files
\r\n\t
\r\n\t\u3000\u3000\u5f53tomcat\u5e76\u53d1\u7528\u6237\u91cf\u5927\u7684\u65f6\u5019\uff0c\u5355\u4e2ajvm\u8fdb\u7a0b\u786e\u5b9e\u53ef\u80fd\u6253\u5f00\u8fc7\u591a\u7684\u6587\u4ef6\u53e5\u67c4\u3002
\r\n\t
\r\n\t\u3000\u3000\u4f7f\u7528 #lsof -p 10001|wc -l\u3000 \u67e5\u770b\u6587\u4ef6\u64cd\u4f5c\u6570
\r\n\t
\r\n\t\u3000\u3000\u5982\u4e0b\u64cd\u4f5c\uff1a
\r\n\t
\r\n\t\u3000\u3000\uff081\uff09.ps -ef |grep tomcat \u67e5\u770btomcat\u7684\u8fdb\u7a0bID\uff0c\u8bb0\u5f55ID\u53f7\uff0c\u5047\u8bbe\u8fdb\u7a0bID\u4e3a10001

\r\n

        \uff082\uff09.lsof -p 10001|wc -l \u67e5\u770b\u5f53\u524d\u8fdb\u7a0bid\u4e3a10001\u7684 \u6587\u4ef6\u64cd\u4f5c\u6570

\r\n

        \uff083\uff09.\u4f7f\u7528\u547d\u4ee4\uff1aulimit -a \u67e5\u770b\u6bcf\u4e2a\u7528\u6237\u5141\u8bb8\u6253\u5f00\u7684\u6700\u5927\u6587\u4ef6\u6570 \u9ed8\u8ba4\u662f1024.

\r\n

        \uff084\uff09.\u7136\u540e\u6267\u884c\uff1aulimit -n 65536 \u5c06\u5141\u8bb8\u7684\u6700\u5927\u6587\u4ef6\u6570\u8c03\u6574\u4e3a65536

\r\n"}, {"title": "APV2600\u8d1f\u8f7d\u5747\u8861\u4e0b\u90e8\u5206\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u6545\u969c\u5206\u6790", "desc": "\u4e91\u5357\u66f2\u9756APV2600\u8d1f\u8f7d\u505a\u6700\u524d\u7aef\uff0c\u540e\u7aef\u4e24\u53f0WINDOWS\u670d\u52a1\u5668IIS\u627f\u8f7d\u4e1a\u52a1\u3002\u90e8\u5206\u7528\u6237\u53ef\u4ee5\u8bbf\u95eeservice.asmx\u63a5\u53e3\u7aef\u53e3\uff0c\u90e8\u5206\u7528\u6237\u8bbf\u95ee\u4e0d\u4e86\u3002", "content": "

\r\n\t\u95ee\u9898\u5206\u6790

\r\n

\u90e8\u5206\u53bf\u533a\u7528\u6237\u53cd\u5e94\u7cfb\u7edf\u4f7f\u7528\u4e0d\u4e86\uff0c\u4f46\u662f\u6211\u4eec\u5728\u516c\u53f8\u8bbf\u95ee\u90fd\u6b63\u5e38\u3002\u521d\u6b65\u5206\u6790\u53ef\u80fd\u662f\u7528\u6237\u5ba2\u6237\u7aef\u5b89\u88c5\u4e86360\u5b89\u5168\u536b\u58eb\u6216\u8005\u662fQQ\u7ba1\u5bb6\u5c06service.asmx\u9875\u9762\u963b\u6b62\u4e86\u3002

\r\n

\r\n\t1.\u5173\u95ed\u7528\u6237\u672c\u673a\u81ea\u5e26\u9632\u706b\u5899\uff0c\u5173\u95ed360\u6216\u8005QQ\u7ba1\u5bb6

\r\n

\u7528\u6237\u4f9d\u7136\u8bbf\u95ee\u4e0d\u4e86\uff0c\u5b89\u88c5telnet\u5ba2\u6237\u7aef.\u5728CMD\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\uff08\u8fd9\u91cc\u4e3a\u4e86\u7528\u6237\u7684\u9690\u79c1IP\u540e\u4e24\u6bb5\u7528XX\u9690\u85cf\uff09 telnet 183.224.xx.xx:8000  \u53d1\u73b0\u7aef\u53e3\u662f\u901a\u7684\uff0c\u4f46\u662fhttp://183.224.xx.xx:8000/service.asmx\u63a5\u53e3\u9875\u9762\u5c31\u6253\u4e0d\u5f00\u3002

\r\n

\r\n\t2.\u6000\u7591\u662f\u7528\u6237\u7aef\u7f51\u7edc\u95ee\u9898

\r\n

\u8bf7\u79fb\u52a8\u7f51\u7edc\u5de5\u7a0b\u5e08\u534f\u52a9\u6392\u67e5\uff0c\u5bf9\u4e0a\u5c42\u9632\u706b\u5899\u653e\u884c\uff0c\u7b56\u7565\u66f4\u6539\u3002\u5de5\u7a0b\u5e08\u7684\u7b14\u8bb0\u672c\u7535\u8111\u53ef\u4ee5\u8bbf\u95eeservice.asmx\uff0c\u4f46\u662f\u5ba2\u6237\u7684\u53f0\u5f0f\u7535\u8111\u8fd8\u662f\u65e0\u6cd5\u8bbf\u95ee\uff0c\u79fb\u52a8\u5de5\u7a0b\u5e08\u548c\u5ba2\u6237\u5904\u5728\u540c\u4e00\u7f51\u7edc\u73af\u5883\u4e0b\uff0c\u5355\u72ec\u8bbf\u95eeWEB\u8282\u70b9\u7684192.168.x.x/service.asmx \u90fd\u662f\u6b63\u5e38\u7684\u3002

\r\n

\r\n\t3.\u6000\u7591\u662f\u786c\u4ef6\u8d1f\u8f7dAPV2600\u7684\u95ee\u9898

\r\n

\u8054\u7cfb\u8d1f\u8f7d\u5747\u8861\u5382\u5bb6\u5de5\u7a0b\u5e08\uff0c\u8d1f\u8f7d\u5747\u8861\u5382\u5bb6\u8981\u6c42\u6d4b\u8bd5WEB\u8282\u70b9\u65f6\u8981\u6d4b\u8bd5\u6839\u76ee\u5f55\u4e0d\u80fd\u5e26\u4e1a\u52a1\u5730\u5740\u3002\u6d4b\u8bd5\u4e24\u53f0WEB\uff0c192.168.x.x1/  \u548c 192.168.x.x2/ \u53d1\u73b0 x2 \u670d\u52a1\u5668\u4e0d\u5e26service.asmx\u6587\u4ef6\u540d\u65e0\u6cd5\u8bbf\u95ee\uff0c\u63d0\u793a403\u9519\u8bef\u3002\u5728 IIS \u7ba1\u7406\u5668\u7f51\u7ad9\u76ee\u5f55\u4e0b\u70b9\u51fb\u7ad9\u70b9 \uff08\u6211\u8fd9\u91cc\u7528\u7684\u662fDefault Web Site \u9ed8\u8ba4\u7ad9\u70b9\uff09 \u529f\u80fd\u8bd5\u56fe \u6253\u5f00\u9ed8\u8ba4\u6587\u6863\u529f\u80fd \u53d1\u73b0\u6ca1\u6709 service.asmx \u6761\u76ee \u70b9\u51fb\u53f3\u4fa7\u7684\u6dfb\u52a0\u6309\u94ae\u6dfb\u52a0 service.asmx \u9875\u9762\uff0c\u901a\u8fc7 http://192.168.x.x2/ \u548c http://192.168.x.x1/ \u8def\u5f84\u90fd\u53ef\u4ee5\u8bbf\u95ee service.asmx \u9875\u9762\u3002

\r\n

3.1\u5173\u95ed\u8d1f\u8f7d\u8282\u70b9\u6d4b\u8bd5\u4e1a\u52a1

\r\n

\u5355\u72ec\u5f00\u653e 192.168.XX.X1 \u8282\u70b9\u4e1a\u52a1\u6b63\u5e38\uff0c\u5355\u72ec\u5f00\u653e 192.168.XX.X2 \u8282\u70b9\u8bbf\u95ee\u8d1f\u8f7d\u5747\u8861\u7684\u5730\u5740\u65e0\u6cd5\u8bbf\u95ee\u3002\u8d1f\u8d23\u5747\u8861\u5382\u5bb6\u575a\u6301\u8bf4\u8d1f\u8f7d\u5747\u8861\u6ca1\u6709\u95ee\u9898\uff0c\u901a\u8fc7 192\u3002168.XX.X2 \u7684web\u670d\u52a1\u5668\u8bbf\u95ee\u53c8\u53ef\u4ee5\u8bbf\u95ee\uff0c\u86cb\u75bc\u4e2d\uff0c\u5c1d\u8bd5\u91cd\u542f IIS.\u670d\u52a1\uff0c\u95ee\u9898\u4f9d\u65e7\u3002\u767e\u822c\u65e0\u5948\u4e0b\u60f3\u66f4\u6539\u7f51\u5173\u5730\u5740\uff0c\u901a\u8fc7\u8def\u7531\u65b9\u5f0f\u786c\u8fde\uff0c\u4fee\u6539\u672c\u5730\u8fde\u63a5\u4fe1\u606f\u65f6\u53d1\u73b0\u5982\u4e0b\u9519\u8bef\u3002

\r\n

\"\"

\r\n

\u8fd9\u4e2a\u95ee\u9898\u7b2c\u4e00\u6b21\u9047\u5230\uff0c\u7b2c\u4e00\u53cd\u5e94\u91cd\u542f\u670d\u52a1\u5668\uff0c\u518d\u6b21\u4fee\u6539\u7f51\u5361\u3002\u9519\u8bef\u63d0\u793a\u6ca1\u6709\u4e86\uff0c\u5728\u6d4b\u8bd5\u8d1f\u8f7d\u5747\u8861\u4e5f\u6b63\u5e38\u4e86\u3002\u7531\u4e8e\u9879\u76ee\u4e0d\u662f\u6211\u7684\uff0c\u524d\u671f\u4e5f\u4e0d\u662f\u6211\u5b9e\u65bd\u7684\uff0c\u4e5f\u6ca1\u6562\u8fdb\u884c\u518d\u591a\u7684\u6d4b\u8bd5\u3002\u5173\u4e8e\u4e3a\u4ec0\u4e48\u4f1a\u5f71\u54cd\u8d1f\u8f7d\u5747\u8861\u4e5f\u4e0d\u5f97\u800c\u77e5

\r\n

3.2\u91cd\u542f\u6cbb\u767e\u75c5

\r\n

\u4e1a\u52a1\u7cfb\u7edf\u653ewindows\u4e0a\u8fc7\u6bb5\u65f6\u95f4\u5c31\u4f1a\u6709\u83ab\u540d\u5176\u5999\u7684\u95ee\u9898\uff0c\u8fd8\u662f\u6709\u5fc5\u8981\u8fc7\u6bb5\u65f6\u95f4\u91cd\u542f\u4e00\u6b21\u6ef4\"\"\uff0c\u8fd8\u662f\u949f\u7231 Centos.

\r\n"}, {"title": "apache\u4e0etomcat\u6574\u5408", "desc": "\u6574\u5408apache http server \u548c tomcat\u53ef\u4ee5\u63d0\u5347\u5bf9\u9759\u6001\u6587\u4ef6\u7684\u5904\u7406\u6027\u80fd\u3001\u5229\u7528WEB\u670d\u52a1\u5668\u6765\u505a\u8d1f\u8f7d\u5747\u8861\u4ee5\u53ca\u5bb9\u9519\u3001\u65e0\u7f1d\u5730\u5347\u7ea7\u5e94\u7528\u7a0b\u5e8f\u3002", "content": "

Tomcat\u672c\u8eab\u5df2\u7ecf\u63d0\u4f9b\u4e86http\u670d\u52a1\uff0c\u8be5\u670d\u52a1\u7684\u9ed8\u8ba4\u7aef\u53e3\u662f8080\uff0c\u88c5\u597dTomcat\u540e\u901a\u8fc78080\u7aef\u53e3\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Tomcat\u6240\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u4e5f\u53ef\u4ee5\u4fee\u6539server.xml\u914d\u7f6e\u5c06\u7aef\u53e3\u4fee\u6539\u4e3a80.\u5f15\u5165APACHE\u6216\u8005\u5176\u4ed6\u4e13\u95e8\u7684HTTP\u670d\u52a1\u5668\u4e0eTOMCAT\u6574\u5408\u6709\u4ee5\u4e0b\u51e0\u4e2a\u539f\u56e0\uff1a

\r\n

1.\u63d0\u5347\u5bf9\u9759\u6001\u6587\u4ef6\u7684\u5904\u7406\u80fd\u529b

\r\n

2.\u5229\u7528web\u670d\u52a1\u5668\u6765\u505a\u5747\u8861\u8d1f\u8f7d\u548c\u5bb9\u9519

\r\n

3.\u65e0\u7f1d\u5730\u5347\u7ea7\u5e94\u7528\u7a0b\u5e8f

\r\n

\u8fd9\u4e09\u70b9\u5bf9\u4e8e\u4e00\u4e2aWEB\u7f51\u7ad9\u6765\u8bf4\u662f\u6781\u5176\u91cd\u8981\u7684\uff0c\u6211\u4eec\u5e0c\u671b\u6211\u4eec\u7684\u7f51\u7ad9\u4e0d\u4ec5\u662f\u901f\u5ea6\u5feb\u3001\u800c\u4e14\u8981\u7a33\u5b9a\uff0c\u4e0d\u80fd\u56e0\u4e3a\u67d0\u4e2aTOMCAT\u5b95\u673a\u6216\u8005\u5347\u7ea7\u7a0b\u5e8f\u5bfc\u81f4\u7528\u6237\u8bbf\u95ee\u4e0d\u4e86\uff0c\u800c\u80fd\u5b8c\u6210\u8fd9\u51e0\u4e2a\u529f\u80fd\u7684\u3001\u6700\u597d\u7684HTTP\u670d\u52a1\u5668\u4e5f\u5c31\u53ea\u6709APACHE\u7684HTTP SERVER \u4e86\uff0c\u5b83\u8ddfTOMCAT\u7684\u7ed3\u5408\u662f\u6700\u7d27\u5bc6\u548c\u53ef\u9760\u7684\u4e86\u3002

\r\n

\u63a5\u4e0b\u6765\u4ecb\u7ecd\u4e09\u79cd\u8d1f\u8f7d\u65b9\u5f0f

\r\n

\u4e00\u3001JK(mod_jk)

\r\n

    \u8fd9\u662f\u6700\u5e38\u89c1\u7684\u65b9\u5f0f\uff0cJK\u672c\u8eab\u6709\u4e24\u4e2a\u7248\u672c\u5206\u522b\u662f1\u548c2\u76ee\u524d1\u6700\u65b0\u7684\u7248\u672c\u662f1.2.42,\u800c\u7248\u672c2\u65e9\u5df2\u5e9f\u5f03\uff0c\u4e0d\u5728\u6709\u65b0\u7248\u672c\u63a8\u51fa\uff0c\u5efa\u8bae\u91c7\u7528\u7248\u672c1\u3002

\r\n

JK\u914d\u7f6e\u6587\u6863\u767e\u5ea6\u4e0a\u5df2\u7ecf\u975e\u5e38\u591a\u4e86\uff0c\u81ea\u884c\u767e\u5ea6\u6216\u8005\u53c2\u7167\u672c\u7ad9JK\u5b89\u88c5\u914d\u7f6e\u6587\u6863\uff0c\u4e0b\u9762\u8bb2\u4e0bJK\u7684\u914d\u7f6e\u601d\u8def\u3002

\r\n

JK\u7684\u6700\u5173\u952e\u7684\u4e09\u4e2a\u6587\u4ef6\u5206\u522b\u662f

\r\n

httpd.conf  #Apache \u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\uff0c\u7528\u6765\u52a0\u8f7dJK\u6a21\u5757\u4ee5\u53ca\u6307\u5b9aJK\u914d\u7f6e\u6587\u4ef6\u4fe1\u606fper

\r\n

workers.properties  #\u5230Tomcat\u7684\u94fe\u63a5\u5b9a\u4e49\u6587\u4ef6

\r\n

uriworkrmap.properties  #URI\u6620\u5c04\u6587\u4ef6\u3002\u7528\u6765\u6307\u5b9a\u90a3\u4e9bURL\u7531Tomcat\u5904\u7406\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5728httpd.conf \u4e2d\u914d\u7f6e\u8fd9\u4e9bURI, \u72ec\u7acb\u8fd9\u4e9b\u914d\u7f6e\u7684\u597d\u5904\u662f\u65b9\u4fbfJK\u6a21\u5757\u5b9a\u671f\u66f4\u65b0\u8be5\u6587\u4ef6\u5185\u5bb9\uff0c\u65b9\u4fbf\u6dfb\u52a0\u5220\u9664\u670d\u52a1\u5668\uff0c\u4f7f\u5f97\u4fee\u6539\u914d\u7f6e\u7684\u65f6\u5019\u4e0d\u9700\u8981\u91cd\u65b0\u542f\u52a8Apache\u670d\u52a1\u5668\u3002

\r\n

\u5176\u4e2dworkers.properties\u548curiworkrmap.properties\u7684\u6587\u4ef6\u540d\u53ef\u4ee5\u81ea\u5df1\u5b9a\u4e49\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u5178\u578b\u7684httpd.conf \u5bf9 JK \u7684\u914d\u7f6e

\r\n

#\u52a0\u8f7d JK \u6a21\u5757 mod_jk.so \u548c\u914d\u7f6e\u6587\u4ef6 workers.properties
\r\n\tLoadModule jk_module modules/mod_jk.so
\r\n\tJkWorkersFile "conf/workers.properties"
\r\n\t#\u8bbe\u7f6e JK \u65e5\u5fd7\u6587\u4ef6, \u8bbe\u7f6e JK \u65e5\u5fd7\u7ea7\u522b\u548c\u683c\u5f0f
\r\n\tJkLogFile "logs/mod_jk.log"
\r\n\tJkLogLevel warn
\r\n\tJkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
\r\n\tJkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
\r\n\tJKMountFile "conf/uriworkrmap.properties"
\r\n\t\u63a5\u4e0b\u6765\u5728Apache\u7684conf\u76ee\u5f55\u4e0b\u65b0\u5efaworkers.properties\u548curiworkrmap.properties\u4e24\u4e2a\u6587\u4ef6\u6587\u4ef6\u5927\u6982\u5185\u5bb9\u5982\u4e0b

\r\n

#\u5b9a\u4e49\u4e86\u4e00\u4e2a\u8d1f\u8f7d\u5e73\u8861\u670d\u52a1\u5668\uff0c\u540d\u79f0\u4e0euriworkrmap.propertie \u4e2d\u5bf9\u5e94

\r\n

#workers.properties\u7684\u914d\u7f6e\u4fe1\u606f
\r\n\tworker.list=loadbalancer
\r\n\tworker.loadbalancer.type=lb
\r\n\t#\u5c06\u4e24\u8282\u70b9\u52a0\u5165\u8d1f\u8f7d\u5e73\u8861\u670d\u52a1\u5668
\r\n\tworker.loadbalancer.balance_workers=worker1,worker2,worker3
\r\n\t#\u4fdd\u8bc1\u4f1a\u8bdd\u4eb2\u548c,\u8bbe\u4e3a true
\r\n\tworker.loadbalancer.sticky_session=true
\r\n\tworker.loadbalancer.sticky_session_force=false
\r\n\t#\u8282\u70b9 1
\r\n\tworker.worker1.type=ajp13
\r\n\tworker.worker1.host=192.168.134.100 # Tomcat \u7684 IP
\r\n\tworker.worker1.port=8109 #AJP \u7684\u7aef\u53e3\uff0c\u8981\u548c Tomcatb \u7684 AJP \u7aef\u53e3\u5bf9\u5e94
\r\n\tworker.worker1.lbfactor=1 #\u6743\u91cd
\r\n\tworker.worker1.socket_keepalive=true
\r\n\tworker.worker1.socket_timeout=600
\r\n\t#\u8282\u70b9 2 \u542b\u4e49\u540c\u4e0a
\r\n\tworker.worker2.type=ajp13
\r\n\tworker.worker2.host=192.168.134.101
\r\n\tworker.worker2.port=8209
\r\n\tworker.worker2.lbfactor=1
\r\n\tworker.worker2.socket_keepalive=true
\r\n\tworker.worker2.socket_timeout=600
\r\n\t#\u8282\u70b9 3 \u542b\u4e49\u540c\u4e0a
\r\n\tworker.worker3.type=ajp13
\r\n\tworker.worker3.host=192.168.134.1
\r\n\tworker.worker3.port=8309
\r\n\tworker.worker3.lbfactor=1
\r\n\tworker.worker3.socket_keepalive=true
\r\n\tworker.worker2.socket_timeout=600
\r\n\t#\u96c6\u7fa4\u72b6\u6001\u76d1\u63a7\u914d\u7f6e
\r\n\tworker.list=mystatus
\r\n\tworker.mystatus.type=status
\r\n\tworker.mystatus.read_only=1

\r\n

\u6211\u4eec\u914d\u7f6e\u4e86\u4e09\u4e2a\u7c7b\u578b\u4e3aajp13\u7684worker \u5206\u522b\u662fworker1,worker2,worker3\u4ed6\u4eec\u6307\u5411\u4e86\u4e09\u53f0\u670d\u52a1\u56688109\u30018209\u30018309\u7684Tomcat\u4e0a\uff0c\u6211\u4eec\u914d\u7f6e\u7684\u8d1f\u8f7d\u5747\u8861\u5668\u7684\u540d\u79f0\u4e3aloadbalancer\u4e0euriworkrmap.propertie \u4e2d\u914d\u7f6e\u8981\u4e00\u81f4\u3002

\r\n

\u63a5\u4e0b\u6765\u914d\u7f6e URI \u7684\u6620\u5c04

\r\n

/* = loadbalancer

\r\n

/tong_status mystatus

\r\n

!/*.gi f= loadbalancer

\r\n

!/*.jpg= loadbalancer

\r\n

!/*.js = loadbalancer

\r\n

!/*.html = loadbalancer

\r\n

!/*.htm  = loadbalancer

\r\n

\u6240\u6709\u7684\u8bf7\u6c42\u90fd\u7531 loadbalancer \u8fd9\u4e2a worker \u8fdb\u7a0b\u5904\u7406\uff0c\u4f46\u662f\u6709\u51e0\u4e2a\u4f8b\u5916\uff0c /tong_status \u8bf7\u6c42\u7531 mystatus \u8fd9\u4e2aworker \u5904\u7406\u3002\u4e0b\u9762\u611f\u53f9\u53f7\u7684\u4ee3\u8868 URI \u4e0d\u9700\u8981\u7531 JK \u5904\u7406\uff0c\u7531 Apache\u76f4\u63a5\u5904\u7406 gif\u3001 jpg\u3001 js\u3001 html\u3001 htm\u7b49\u9759\u6001\u5185\u5bb9\u5176\u4ed6CSS\u3001 PNG \u683c\u5f0f\u7684\u9759\u6001\u5185\u5bb9\u81ea\u884c\u8111\u8865\u3002

\r\n

\u4e8c\u3001http_proxy

\r\n

    \u8fd9\u662f\u5229\u7528 Apache \u81ea\u5e26\u7684 mod_proxy \u6a21\u5757\u4f7f\u7528\u4ee3\u7406\u6280\u672f\u6765\u94fe\u63a5 Tomcat ,\u610f\u89c1\u4f7f\u7528 Apache 2.2.xx \u7248\u672c\uff0c\u8fd9\u4e2a\u7248\u672c\u5bf9 http_proxy \u8fdb\u884c\u4e86\u91cd\u5199\uff0c\u5927\u5927\u589e\u5f3a\u4e86\u5176\u529f\u80fd\u548c\u7a33\u5b9a\u6027\u3002

\r\n

    http_proxy \u6a21\u5f0f\u662f\u57fa\u4e8e HTTP \u534f\u8bae\u7684\u4ee3\u7406\uff0c\u56e0\u6b64\u5b83\u8981\u6c42 Tomcat \u5fc5\u987b\u63d0\u4f9b HTTP \u670d\u52a1\uff0c\u4e5f\u5c31\u662f\u8bf4\u5fc5\u987b\u542f\u7528 Tomcat \u7684 HTTP Connector .\u4e0b\u9762\u7ed9\u51fa\u6700\u7b80\u5355\u7684\u57fa\u672c\u914d\u7f6e\u3002

\r\n

    ProxyPass  /images !

\r\n

    ProxyPass  /css !

\r\n

    ProxyPass  /js !

\r\n

    ProxyPass  / http://localhost:8080/

\r\n

\u4ee5\u4e0a\u914d\u7f6e\u662f\u9664\u4e86 images\u3001 css\u3001 js \u51e0\u4e2a\u76ee\u5f55\u5916\u628a\u6240\u6709 http://localhost/ \u7684\u8bf7\u6c42\u4ee3\u7406\u5230 http://localhost:8080/ ,\u8fd9\u4e5f\u5c31\u662f Tomcat \u7684\u8bbf\u95ee\u5730\u5740\u3002\u540c\u6837\u53ef\u4ee5\u7528 mod_proxy \u6765\u505a\u8d1f\u8f7d\u5747\u8861\uff0c\u518d\u770b\u770b\u4e0b\u9762\u8fd9\u4e2a\u914d\u7f6e

\r\n

    ProxyPass  /images !

\r\n

    ProxyPass  /css !

\r\n

    ProxyPass  /js !

\r\n

    ProxyPass / balancer://example/

\r\n

   

\r\n

    BalancerMember http://server1:8080/

\r\n

    BalancerMember http://server2:8080/

\r\n

    BalancerMember http://server3:8080/

\r\n

   

\r\n

\u914d\u7f6e\u6bd4 JK \u7b80\u5355\u591a\u4e86\uff0c\u53ef\u4ee5\u901a\u8fc7 http://localhost:8080/balancer-manager \u6765\u76d1\u63a7\u96c6\u7fa4\u72b6\u6001\u3002

\r\n

\u4e09\u3001ajp_proxy

\r\n

        ajp_proxy \u94fe\u63a5\u65b9\u5f0f\u5176\u5b9e\u8ddf http_proxy \u65b9\u5f0f\u4e00\u6837\uff0c\u90fd\u662f\u7531 mod_proxy \u6240\u63d0\u4f9b\u7684\u529f\u80fd\u3002\u914d\u7f6e\u4e5f\u4e00\u6837\u7684\uff0c\u5c31\u662f\u628a http:// \u6362\u6210 ajp:// \u540c\u65f6\u8fde\u63a5\u7684\u662f Tomcat \u7684 AJP Connector \u6240\u5728\u7684\u7aef\u53e3\u3002\u4e0a\u9762\u4f8b\u5b50\u53ef\u4fee\u6539\u4e3a\uff1a

\r\n

    ProxyPass  /images !

\r\n

    ProxyPass  /css !

\r\n

    ProxyPass  /js !

\r\n

    ProxyPass / balancer://example/

\r\n

   

\r\n

    BalancerMember ajp://server1:8080/

\r\n

    BalancerMember ajp://server2:8080/

\r\n

    BalancerMember ajp://server3:8080/

\r\n

   

\r\n

    \u91c7\u7528 proxy \u7684\u94fe\u63a5\u65b9\u5f0f\uff0c\u9700\u8981\u5728 Apache \u4e0a\u52a0\u8f7d\u6240\u9700\u7684\u6a21\u5757\uff0cmod_proxy \u76f8\u5173\u7684\u6a21\u5757\u6709 mod_proxy.so\u3001 mod_proxy_connect.so\u3001 mod_proxy_http.so\u3001 mod_proxy_ftp.so\u3001 mod_proxy_ajp.so\uff0c\u5176\u4e2d mod_proxy_ajp.so \u53ea\u5728 Apache 2.2.x \u4e2d\u624d\u6709\u3002\u5982\u679c\u4f7f\u7528 http_proxy \u9700\u8981 mod_proxy.so\u3001mod_proxy_http.so\u4e24\u4e2a\u6a21\u5757\uff1b\u5982\u679c\u662f ajp_proxy \u9700\u8981\u52a0\u8f7d mod_proxy.so\u3001 mod_proxy_ajp.so \u8fd9\u4e24\u4e2a\u6a21\u5757\u3002

\r\n

    \u76f8\u5bf9\u4e8e JK \u7684\u94fe\u63a5\u65b9\u5f0f\uff0c\u540e\u4e24\u79cd\u5728\u914d\u7f6e\u4e0a\u6bd4\u8f83\u7b80\u5355\uff0c\u7075\u6d3b\u6027\u65b9\u9762\u4e5f\u4e0d\u900a\u8272\u3002\u4f46\u5c31\u7a33\u5b9a\u6027\u800c\u8a00\u4e0d\u50cf JK \u4e45\u7ecf\u8003\u9a8c\uff0c\u5982\u679c\u5e94\u7528\u4e8e\u5173\u952e\u7684\u4e92\u8054\u7f51\u7f51\u7ad9\u5efa\u8bae\u4f7f\u7528 JK \u7684\u94fe\u63a5\u65b9\u5f0f\u3002

\r\n"}, {"title": "\u5c06TomCat\u5b89\u88c5\u4e3awindows\u670d\u52a1", "desc": "TomCat\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u7684TOMCAT6windows64\u4f4d\u7248\u672c\u662f\u514d\u5b89\u88c5\u7248\u4e0d\u65b9\u4fbf\u7ba1\u7406\uff0c\u8fd0\u884cBIN\u76ee\u5f55\u4e0b\u7684Tomcat6w.exe\u62a5\u6307\u5b9a\u670d\u52a1\u6ca1\u5b89\u88c5\u9519\u8bef\u3002\u901a\u8fc7\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5c06TOMCAT\u52a0\u5165WINDOWS\u670d\u52a1\u3002", "content": "

\r\n\t1.\u914d\u7f6eservice.bat\u6587\u4ef6

\r\n

1.1\u627e\u5230TOMCAT\u4e3b\u76ee\u5f55\u5728\u4e8c\u7ea7bin\u76ee\u5f55\u4e0b\u627e\u5230service.bat\u6587\u4ef6\uff0c\u9f20\u6807\u53f3\u51fb\u9009\u62e9\u7f16\u8f91

\r\n

\u6587\u6863\u4f1a\u4ee5txt\u65b9\u5f0f\u6253\u5f00\u6587\u4ef6\u5728\u5f00\u5934\u90e8\u5206\u52a0\u5165\u4ee5\u4e0b\u4e09\u884c\u4ee3\u7801

\r\n
\r\n\t
\r\n\r\nSET JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_80\r\nSET CATALINA_HOME=D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\r\nSET PR_DISPLAYNAME=Tomcat6\r\n
\r\n
\r\n

\u7b2c\u4e00\u884c\u662f\u8bbe\u7f6eJDK\u7684\u76ee\u5f55\uff0c\u6211\u7528\u7684\u662f1.7\u7248\u672c\u8fd9\u91cc\u8981\u6839\u636e\u8ddf\u4eba\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\uff1b\u7b2c\u4e8c\u884c\u8bbe\u7f6eTOMCAT\u7684\u4e3b\u76ee\u5f55\u4e5f\u8981\u6839\u636e\u4e2a\u4eba\u60c5\u51b5\u4fee\u6539\u6210\u81ea\u5df1\u7684\u76ee\u5f55\uff1b\u7b2c\u4e09\u884c\u8bbe\u7f6e\u670d\u52a1\u540d\u79f0\uff0c\u6211\u8fd9\u91cc\u8bbe\u7f6e\u7684\u53ebTomcat6\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u6210\u5176\u5b83\u7684\uff08\u5efa\u8bae\u4e0d\u8981\u8bbe\u7f6e\u6210\u5176\u4ed6\u540d\u79f0\uff09\u8981\u548c\u4e0b\u9762\u7684\u4fee\u6539\u4e00\u81f4\u5c3d\u91cf\u8bbe\u7f6e\u4e00\u773c\u53ef\u4ee5\u8ba4\u51fa\u6765\u7684\u670d\u52a1\u540d\u3002

\r\n

1.2\u7ee7\u7eed\u627e\u5230

\r\n

rem Set default Service name
\r\n\tset SERVICE_NAME=Tomcat6

\r\n

\u4fee\u6539\u4e3a

\r\n

rem Set default Service name
\r\n\tset SERVICE_NAME=Tomcat6

\r\n

\u56e0\u4e3a\u6211\u4e0a\u9762\u8bbe\u7f6eSET PR_DISPLAYNAME=Tomcat6\u6240\u4ee5\u8fd9\u4e00\u6b65\u4e0d\u7528\u4fee\u6539

\r\n

\r\n\t2.\u914d\u7f6eshutdown.bat\u548cstartup.bat\u6587\u4ef6

\r\n

2.1TOMCAT\u4e3b\u76ee\u5f55\u5728\u4e8c\u7ea7bin\u76ee\u5f55\u4e0b\u627e\u5230shutdown.bat\u6587\u4ef6\uff0c\u9f20\u6807\u53f3\u51fb\u9009\u62e9\u7f16\u8f91

\r\n

\u6587\u6863\u4f1a\u4ee5txt\u65b9\u5f0f\u6253\u5f00\u6587\u4ef6\u5728\u5f00\u5934\u90e8\u5206\u52a0\u5165\u4ee5\u4e0b\u4e24\u884c\u4ee3\u7801

\r\n

SET JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_80
\r\n\tSET CATALINA_HOME=D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6

\r\n

2.2TOMCAT\u4e3b\u76ee\u5f55\u5728\u4e8c\u7ea7bin\u76ee\u5f55\u4e0b\u627e\u5230startup.bat\u6587\u4ef6\uff0c\u9f20\u6807\u53f3\u51fb\u9009\u62e9\u7f16\u8f91

\r\n

\u6587\u6863\u4f1a\u4ee5txt\u65b9\u5f0f\u6253\u5f00\u6587\u4ef6\u5728\u5f00\u5934\u90e8\u5206\u52a0\u5165\u4ee5\u4e0b\u4e24\u884c\u4ee3\u7801

\r\n

SET JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_80
\r\n\tSET CATALINA_HOME=D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6

\r\n

\r\n\t3.\u5c06Tomcat\u52a0\u5165windows\u670d\u52a1

\r\n

3.1\u8fdb\u5165Tomcat\u7684bin\u76ee\u5f55

\r\n

\u8fd0\u884cWin+R\u6253\u5f00\u8fd0\u884c\u5bf9\u8bdd\u6846\uff0c\u8f93\u5165cmd\u547d\u4ee4\u6253\u5f00\u63a7\u5236\u53f0\u8f93\u5165

\r\n

d:      //\u6309\u56de\u8f66\u952e\u8fdb\u5165D\u76d8

\r\n

cd D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin           //\u6309\u56de\u8f66\u952e\u8fdb\u5165Tomcat\u7684bin\u76ee\u5f55

\r\n

3.2\u5b89\u88c5Tomcat\u670d\u52a1

\r\n

service install Tomcat6      //\u6309\u56de\u8f66\u8fdb\u884c\u5b89\u88c5\u670d\u52a1install Tomcat6\u5fc5\u987b\u8ddf\u524d\u9762\u8bbe\u7f6e\u7684\u4e00\u81f4\u5efa\u8bae\u4e0d\u8981\u4fee\u6539

\r\n

\u5982\u679c\u63d0\u793a\u4ee5\u4e0b\u9519\u8bef

\r\n

The tomcat6.exe was not found...
\r\n\tThe CATALINA_HOME environment variable is not defined correctly.
\r\n\tThis environment variable is needed to run this program

\r\n

\u662f\u56e0\u4e3a\u4f60\u7684Tomcat\u76ee\u5f55\u8bbe\u7f6e\u4e0d\u5bf9\uff0cTomcat\u5b58\u653e\u76ee\u5f55\u548c\u8bbe\u7f6e\u76ee\u5f55\u4e0d\u4e00\u81f4\u5bfc\u81f4\u7684

\r\n

\u51fa\u73b0\u4e0b\u9762\u63d0\u793a\u8868\u793a\u5b89\u88c5\u6210\u529f

\r\n

D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>service install Tomcat6
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET JAVA_HOME=C:\\Program Files\\J
\r\n\tava\\jdk1.7.0_80
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET CATALINA_HOME=D:\\TomcatServe
\r\n\trs\\tomcat6
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET PR_DISPLAYNAME=Tomcat6
\r\n\tThe tomcat6.exe was not found...
\r\n\tThe CATALINA_HOME environment variable is not defined correctly.
\r\n\tThis environment variable is needed to run this program
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>service install Tomcat6
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET JAVA_HOME=C:\\Program Files\\J
\r\n\tava\\jdk1.7.0_80
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET CATALINA_HOME=D:\\apache-tomc
\r\n\tat-6.0.48-windows-x64\\tomcat6
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET PR_DISPLAYNAME=Tomcat6
\r\n\tInstalling the service 'Tomcat6' ...
\r\n\tUsing CATALINA_HOME:    "D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6"
\r\n\tUsing CATALINA_BASE:    "D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6"
\r\n\tUsing JAVA_HOME:        "C:\\Program Files\\Java\\jdk1.7.0_80"
\r\n\tUsing JRE_HOME:         "C:\\Program Files\\Java\\jdk1.7.0_80\\jre"
\r\n\tUsing JVM:              "C:\\Program Files\\Java\\jdk1.7.0_80\\jre\\bin\\server\\jvm.dl
\r\n\tl"
\r\n\tThe service 'Tomcat6' has been installed.

\r\n

\r\n\t4.\u5378\u8f7dTomcat\u670d\u52a1

\r\n

service.bat remove

\r\n

\u63d0\u793a\u5982\u4e0b\u4fe1\u606f\u5378\u8f7d\u6210\u529f

\r\n

D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>service remove
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET JAVA_HOME=C:\\Program Files\\J
\r\n\tava\\jdk1.7.0_80
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET CATALINA_HOME=D:\\apache-tomc
\r\n\tat-6.0.48-windows-x64\\tomcat6
\r\n\t
\r\n\tD:\\apache-tomcat-6.0.48-windows-x64\\tomcat6\\bin>SET PR_DISPLAYNAME=Tomcat6
\r\n\tRemoving the service 'Tomcat6' ...
\r\n\tUsing CATALINA_BASE:    "D:\\apache-tomcat-6.0.48-windows-x64\\tomcat6"
\r\n\tThe service 'Tomcat6' has been removed

\r\n"}, {"title": "Tengine|NGINX\u8d1f\u8f7d\u5747\u8861", "desc": "\u672c\u6587\u9488\u5bf9Linux\u7cfb\u7edf\u4e0b\u5b89\u88c5Tenginx\u5e76\u901a\u8fc7upstream\u6a21\u5757\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\uff0c\u672c\u6587\u5728\u7aef\u53e380\u4e1a\u52a1\u72b6\u6001\u6b63\u5e38\u7684\u60c5\u51b5\u4e0b\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\u3002\u5982\u60f3\u5b66\u4e60\u4e1a\u52a1\u914d\u7f6e\u8bf7\u67e5\u770bTOMCAT\u76ee\u5f55\u4e0bsession\u5171\u4eab\u5b9e\u73b0\u6587\u7ae0\u3002", "content": "

\r\n\t1.\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5e76\u5b89\u88c5Tengine(\u767e\u5ea6\u7f51\u76d8\u94fe\u63a5\u5931\u6548\u8bf7\u548c\u6211\u8054\u7cfb)

\r\n

\u767e\u5ea6\u7f51\u76d8:http://pan.baidu.com/s/1geTOFSn  \u5bc6\u7801\uff1abcmb

\r\n

\u6211\u4e0b\u8f7d\u7684\u76ee\u5f55\u662f/opt\u76ee\u5f55

\r\n

#cd /opt   //\u8fdb\u5165/opt\u76ee\u5f55

\r\n

#ls    //\u67e5\u770b\u76ee\u5f55\u4e0b\u6587\u4ef6

\r\n

[root@vpn opt]# ls
\r\n\thttpd                mod_encoding.c.apache2.20040616  pcre-8.36.tar.gz  redis-2.8.0.tar.gz  tengine-2.1.2.tar.gz
\r\n\thttpd-2.2.31.tar.gz  openvpn-2.3.7.tar.gz             redis             redis-3.0.6.tar.gz  tomcat-connectors-1.2.41-src
\r\n\tmod_encoding         pcre-8.36                        redis-2.8.0       tengine-2.1.2       tomcat-connectors-1.2.41-src.tar.gz

\r\n

[root@vpn opt]#cd tengine-2.1.2     //\u8fdb\u5165Tengine\u76ee\u5f55\uff0c\u6211\u7684\u5df2\u7ecf\u89e3\u538b\u597d\uff0c\u6ca1\u89e3\u538b\u7684\u81ea\u5df1\u6267\u884ctar\u8fdb\u884c\u89e3\u538b

\r\n

[root@vpn tengine-2.1.2]# ls
\r\n\tAUTHORS.te  CHANGES     CHANGES.ru  conf       contrib  good_configure  LICENSE   man      objs      README           src    THANKS.te
\r\n\tauto        CHANGES.cn  CHANGES.te  configure  docs     html            Makefile  modules  packages  README.markdown  tests

\r\n

[root@vpn tengine-2.1.2]# ./configure   //\u6267\u884c\u7f16\u8bd1\u5b89\u88c5

\r\n

\u5927\u90e8\u5206\u7684\u9009\u9879\u8ddfNginx\u662f\u517c\u5bb9\u7684\u3002\u4e0b\u9762\u5217\u51fa\u7684\u90fd\u662fTengine\u7279\u6709\u7684\u9009\u9879\u3002\u5982\u679c\u4f60\u60f3\u67e5\u770bTengine\u652f\u6301\u7684\u6240\u6709\u9009\u9879\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c'./configure --help'\u547d\u4ee4\u6765\u83b7\u53d6\u5e2e\u52a9\u3002
\r\n\t
\r\n\t--dso-path
\r\n\t
\r\n\t\u8bbe\u7f6eDSO\u6a21\u5757\u7684\u5b89\u88c5\u8def\u5f84\u3002
\r\n\t
\r\n\t--dso-tool-path
\r\n\t
\r\n\t\u8bbe\u7f6edso_tool\u811a\u672c\u672c\u8eab\u7684\u5b89\u88c5\u8def\u5f84\u3002
\r\n\t
\r\n\t--without-dso
\r\n\t
\r\n\t\u5173\u95ed\u52a8\u6001\u52a0\u8f7d\u6a21\u5757\u7684\u529f\u80fd\u3002
\r\n\t
\r\n\t--with-jemalloc
\r\n\t
\r\n\t\u8ba9Tengine\u94fe\u63a5jemalloc\u5e93\uff0c\u8fd0\u884c\u65f6\u7528jemalloc\u6765\u5206\u914d\u548c\u91ca\u653e\u5185\u5b58\u3002
\r\n\t
\r\n\t--with-jemalloc=path
\r\n\t
\r\n\t\u8bbe\u7f6ejemalloc\u5e93\u7684\u6e90\u4ee3\u7801\u8def\u5f84\uff0cTengine\u53ef\u4ee5\u9759\u6001\u7f16\u8bd1\u548c\u94fe\u63a5\u8be5\u5e93\u3002

\r\n

[root@vpn tengine-2.1.2]#make   

\r\n

[root@vpn tengine-2.1.2]#make   install

\r\n

\r\n\t2.\u914d\u7f6eTengine\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861

\r\n

Tengine\u9ed8\u8ba4\u5b89\u88c5\u5728/usr/local/nginx\u76ee\u5f55\u3002\u4f60\u53ef\u4ee5\u7528'--prefix'\u6765\u6307\u5b9a\u4f60\u60f3\u8981\u7684\u5b89\u88c5\u76ee\u5f55\u3002

\r\n

\u8fdb\u5165\u914d\u7f6e\u76ee\u5f55    #cd /usr/local/nginx/conf

\r\n

\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6   #vi nginx.conf  \u5728http{} \u4e4b\u95f4\u6dfb\u52a0upstream

\r\n

\u4ee3\u7801\u5982\u4e0b\uff1a

\r\n
\r\n\t
\r\n\r\n        upstream jschrj {\r\n        server 192.168.134.1:80;\r\n        server 192.168.134.100:80;\r\n        server 192.168.134.101:80;\r\n        session_sticky;\r\n}\r\n
\r\n
\r\n

\u5728sever{}\u4e4b\u95f4\u6dfb\u52a0\u76d1\u542c\u7aef\u53e3\u53cd\u5411\u4ee3\u7406

\r\n

\u4ee3\u7801\u5982\u4e0b\uff1a

\r\n
\r\n\t
\r\n\r\nserver {\r\nlisten 80;\r\nserver_name www.zhoudl.com zhoudl.com;\r\nproxy_set_header X-Real-IP $remote_addr;\r\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\naccess_log off;\r\n location / {\r\nproxy_pass http://jschrj;\r\n#session_sticky_hide_cookie upstream=jschrj\r\n}\r\n}\r\n
\r\n
\r\n

\r\n\t3.\u4ee3\u7801\u91cd\u8981\u90e8\u5206\u89e3\u91ca

\r\n

1.upstream jschrj \u5176\u4e2djschrj\u662f\u81ea\u5df1\u8bbe\u7f6e\u7684\u522b\u540d

\r\n

2.server 192.168.134.1:80; \u6709\u51e0\u53f0\u4e1a\u52a1\u670d\u52a1\u5668\u5c31\u51e0\u4e2aserver\u5176\u4e2d192.168.1.1\u662f\u670d\u52a1\u5668\u7684IP\u5730\u5740\uff0c80\u662f\u670d\u52a1\u7aef\u53e3

\r\n

3.server_name \u662f\u7ed1\u5b9a\u7684\u57df\u540d\uff0c\u591a\u4e2a\u57df\u540d\u7528\u7a7a\u683c\u9694\u5f00

\r\n

4.proxy_pass http://jschrj\u8fd9\u91cc\u7684jschrj\u8981\u548cupstream\u91cc\u9762\u7684\u522b\u540d\u4e00\u81f4;

\r\n"}, {"title": "LINUX\u7cfb\u7edf\u4e0bTOMCAT\u6ca1\u6709\u5b89\u88c5Native\u8dd1JEECMS\u62a5\u9519", "desc": "Tomcat Native \u662f\u4e00\u4e2a\u5229\u7528 APR \u6765\u63d0\u5347Tomcat\u6027\u80fd\u7684\u672c\u5730API,\u53ef\u4ee5\u8ba9 Tomcat \u4f7f\u7528 Apache \u7684 apr \u5305\u6765\u5904\u7406\u5305\u62ec\u6587\u4ef6\u548c\u7f51\u7edcIO\u64cd\u4f5c\uff0c\u4ee5\u63d0\u5347\u6027\u80fd\u3002\u5728Windows\u4e0d\u7528\u5355\u72ec\u5b89\u88c5\u81ea\u52a8\u8fd0\u884ctcnative-1.dll", "content": "

\u5148\u8d34\u4e0a\u90e8\u5206\u62a5\u9519\u65e5\u5fd7

\r\n

21-Nov-2016 16:46:05.376 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal perfor
\r\n\tmance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
\r\n\t21-Nov-2016 16:46:05.544 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-801"]
\r\n\t21-Nov-2016 16:46:05.595 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-801]]
\r\n\t org.apache.catalina.LifecycleException: Protocol handler initialization failed
\r\n\t        at org.apache.catalina.connector.Connector.initInternal(Connector.java:944)
\r\n\t        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
\r\n\t        at org.apache.catalina.core.StandardService.initInternal(StandardService.java:530)
\r\n\t        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
\r\n\t        at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
\r\n\t        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
\r\n\t        at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
\r\n\t        at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
\r\n\t        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\r\n\t        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
\r\n\t        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
\r\n\t        at java.lang.reflect.Method.invoke(Method.java:497)
\r\n\t        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
\r\n\t        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
\r\n\tCaused by: java.net.BindException: Address already in use
\r\n\t        at sun.nio.ch.Net.bind0(Native Method)
\r\n\t        at sun.nio.ch.Net.bind(Net.java:433)
\r\n\t        at sun.nio.ch.Net.bind(Net.java:425)
\r\n\t        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
\r\n\t        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
\r\n\t        at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:229)
\r\n\t        at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:875)
\r\n\t        at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:542)
\r\n\t        at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:65)
\r\n\t        at org.apache.catalina.connector.Connector.initInternal(Connector.java:941)
\r\n\t        ... 13 more

\r\n
\r\n

Tomcat-Native \u5b89\u88c5\u65b9\u6cd5\uff1a

\r\n

1.\u5b89\u88c5\u4f9d\u8d56\u5305

\r\n

yum install apr-devel openssl-devel

\r\n

2.\u5230Tomcat-Native\u76ee\u5f55\u4e0b\u5b89\u88c5

\r\n

./configure --with-apr=/usr/bin/apr-1-config \\
\r\n\t            --with-java-home=/usr/java/jdk1.8.0_60
\r\n\t            --with-ssl=yes \\
\r\n\t            --prefix=$CATALINA_HOME
\r\n\t
\r\n\t\u6ce8\u610f\uff1a--with-java-home=/usr/java/jdk1.8.0_60\u9700\u8981\u6539\u6210\u4f60\u81ea\u5df1\u7684JDK\u76ee\u5f55

\r\n

3.\u62f7\u8d1d\u5feb\u6377\u65b9\u5f0f\u5230\u8fd0\u884c\u76ee\u5f55

\r\n

cp /opt/tomcat1/bin/tomcat-native-1.1.30-src/jni/native/.libs/libtcnative-1*  /usr/lib

\r\n

\u6ce8\u610f\uff1a/opt/tomcat1/bin/tomcat-native-1.1.30-src\u8981\u6362\u6210\u4f60\u81ea\u5df1\u7684Native\u5b89\u88c5\u76ee\u5f55\u3002

\r\n"}, {"title": "squid\u8bbe\u7f6e\u57df\u540d\u89e3\u6790", "desc": "\u57df\u540d\u89e3\u6790\u4e5f\u53eb\u57df\u540d\u6307\u5411\u3001\u670d\u52a1\u5668\u8bbe\u7f6e\u3001\u57df\u540d\u914d\u7f6e\u4ee5\u53ca\u53cd\u5411IP\u767b\u8bb0\u7b49\u7b49\u3002\u8bf4\u5f97\u7b80\u5355\u70b9\u5c31\u662f\u5c06\u597d\u8bb0\u7684\u57df\u540d\u89e3\u6790\u6210IP\uff0c\u670d\u52a1\u7531DNS\u670d\u52a1\u5668\u5b8c\u6210\uff0c\u662f\u628a\u57df\u540d\u89e3\u6790\u5230\u4e00\u4e2aIP\u5730\u5740\uff0c\u7136\u540e\u5728\u6b64IP\u5730\u5740\u7684\u4e3b\u673a\u4e0a\u5c06\u4e00\u4e2a\u5b50\u76ee\u5f55\u4e0e\u57df\u540d\u7ed1\u5b9a\u3002", "content": "

\r\n\t1.\u4ee3\u7406\u5230\u672c\u673a\u768480\u7aef\u53e3\u7684\u670d\u52a1\uff0c\u4ec5\u4ec5\u505a\u4e3a\u539f\u59cb\u5185\u5bb9\u670d\u52a1\u5668

\r\n

 cache_peer 127.0.0.1 parent 80 0 no-query originserver

\r\n

\r\n\t2.squid\u52a0\u901f\u591a\u4e2a\u7ad9\u70b9\u57df\u540d\u6cdb\u89e3\u6790\u8bbe\u7f6e

\r\n
\r\n\t\u6cdb\u89e3\u6790\u7684\u7528\u9014
\r\n

1.\u53ef\u4ee5\u8ba9\u57df\u540d\u652f\u6301\u65e0\u9650\u7684\u5b50\u57df\u540d(\u8fd9\u4e5f\u662f\u6cdb\u57df\u540d\u89e3\u6790\u6700\u5927\u7684\u7528\u9014)\u3002
\r\n\t2.\u9632\u6b62\u7528\u6237\u9519\u8bef\u8f93\u5165\u5bfc\u81f4\u7684\u7f51\u7ad9\u4e0d\u80fd\u8bbf\u95ee\u7684\u95ee\u9898
\r\n\t3.\u53ef\u4ee5\u8ba9\u76f4\u63a5\u8f93\u5165\u7f51\u5740\u767b\u9646\u7f51\u7ad9\u7684\u7528\u6237\u8f93\u5165\u7b80\u6d01\u7684\u7f51\u5740\u5373\u53ef\u8bbf\u95ee\u7f51\u7ad9
\r\n\t\u6cdb\u57df\u540d\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\u4f5c\u7528\u662f\u975e\u5e38\u5e7f\u6cdb\u7684\uff0c\u6bd4\u5982\u5b9e\u73b0\u65e0\u9650\u4e8c\u7ea7\u57df\u540d\u529f\u80fd\uff0c\u63d0\u4f9b\u514d\u8d39\u7684url\u8f6c\u53d1\uff0c\u5728IDC\u90e8\u95e8\u5b9e\u73b0\u81ea\u52a8\u5206\u914d\u514d\u8d39\u7f51\u5740\uff0c\u5728\u5927\u578b\u4f01\u4e1a\u4e2d\u5b9e\u73b0\u7f51\u5740\u5206\u7c7b\u7ba1\u7406\u7b49\u7b49\uff0c\u90fd\u53d1\u6325\u4e86\u5de8\u5927\u7684\u4f5c\u7528\u3002
\r\n\t“\u9ad8\u7ea7\u89e3\u6790\u670d\u52a1”\u9009\u62e9\u7c7b\u578b\u4e3a“A\u8bb0\u5f55”\u5e76\u586b\u5199“RR”\u503c\u4e3a“*”\u53f7\u548c\u6307\u5411\u7684IP\u5730\u5740“\u503c”\uff08\u6cdb\u57df\u540d\u89e3\u6790\u4e2d\u8be5\u503c\u5fc5\u987b\u4e3a\u72ec\u7acbIP\uff0c\u5373\u901a\u8fc7IP\u53ef\u8bbf\u95ee\u7ad9\u70b9\u3002\u4e0d\u9002\u7528\u4e8e\u5171\u4eabIP\u5730\u5740\uff09\uff0c\u586b\u5199\u5b8c\u6bd5\u540e\u70b9\u51fb“\u65b0\u589e”\u3002

\r\n
\r\n\t
\r\n\r\ncache_peer 192.168.1.1 parent 80 0 no-query originserver name=dns1\r\ncache_peer 192.168.1.254 parent 80 0 no-query originserver name=dns2\r\ncache_peer_domain dns1 .test.com .test1.com\r\ncache_peer_domain dns2 .test2.com .test3.com\r\n\r\n
\r\n
\r\n

\r\n\t3.\u6cdb\u89e3\u6790\u4e0e\u57df\u540d\u89e3\u6790\u533a\u522b

\r\n

\u6cdb\u57df\u540d\u89e3\u6790\u662f\uff1a*.\u57df\u540d\u89e3\u6790\u5230\u540c\u4e00IP\u3002
\r\n\t\u57df\u540d\u89e3\u6790\u662f\uff1a\u5b50\u57df\u540d.\u57df\u540d\u89e3\u6790\u5230\u540c\u4e00IP\u3002

\r\n"}, {"title": "Squid\u662f\u4ec0\u4e48? ", "desc": "Squid\u662f\u4e00\u79cd\u7528\u6765\u7f13\u51b2Internet\u6570\u636e\u7684\u8f6f\u4ef6\u3002\u5b83\u662f\u8fd9\u6837\u5b9e\u73b0\u5176\u529f\u80fd\u7684\uff0c\u63a5\u53d7\u6765\u81ea\u4eba\r\n\u4eec\u9700\u8981\u4e0b\u8f7d\u7684\u76ee\u6807\uff08object\uff09\u7684\u8bf7\u6c42\u5e76\u9002\u5f53\u5730\u5904\u7406\u8fd9\u4e9b\u8bf7\u6c42\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u4e00\u4e2a\u4eba\u60f3\u4e0b\u8f7d\u4e00web\u9875\u9762\uff0c\u4ed6\u8bf7\u6c42Squid\u4e3a\u4ed6\u53d6\u5f97\u8fd9\u4e2a\u9875\u9762\u3002Squid\u968f\u4e4b\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff08\u6bd4\u5982\uff1ahttp\uff1a//squid.nlanr.net/\uff09\u5e76\u5411\u8fd9\u4e2a\u9875\u9762\u53d1\u51fa\u8bf7\u6c42\u3002\u7136\u540e\uff0cSquid\u663e\u5f0f\u5730\u805a\u96c6\u6570\u636e\u5230\u5ba2\u6237\u7aef\u673a\u5668\uff0c\u800c\u4e14\u540c\u65f6\u590d\u5236\u4e00\u4efd\u3002\u5f53\u4e0b\u4e00\u6b21\u6709\u4eba\u9700\u8981\u540c\u4e00\u9875\u9762\u65f6\uff0cSquid\u53ef\u4ee5\u7b80\u5355\u5730\u4ece\u78c1\u76d8\u4e2d\u8bfb\u5230\u5b83\uff0c\u90a3\u6837\u6570\u636e\u8fc5\u5373\u5c31\u4f1a\u4f20\u8f93\u5230\u5ba2\u6237\u673a\u4e0a\u3002\u5f53\u524d\u7684Squid", "content": "

1\uff0eSquid\u662f\u4ec0\u4e48?

\r\n

\tSquid\u662f\u4e00\u79cd\u7528\u6765\u7f13\u51b2Internet\u6570\u636e\u7684\u8f6f\u4ef6\u3002\u5b83\u662f\u8fd9\u6837\u5b9e\u73b0\u5176\u529f\u80fd\u7684\uff0c\u63a5\u53d7\u6765\u81ea\u4eba\u4eec\u9700\u8981\u4e0b\u8f7d\u7684\u76ee\u6807\uff08object\uff09\u7684\u8bf7\u6c42\u5e76\u9002\u5f53\u5730\u5904\u7406\u8fd9\u4e9b\u8bf7\u6c42\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u4e00\u4e2a\u4eba\u60f3\u4e0b\u8f7d\u4e00web\u9875\u9762\uff0c\u4ed6\u8bf7\u6c42Squid\u4e3a\u4ed6\u53d6\u5f97\u8fd9\u4e2a\u9875\u9762\u3002Squid\u968f\u4e4b\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff08\u6bd4\u5982\uff1ahttp\uff1a//squid.nlanr.net/\uff09\u5e76\u5411\u8fd9\u4e2a\u9875\u9762\u53d1\u51fa\u8bf7\u6c42\u3002\u7136\u540e\uff0cSquid\u663e\u5f0f\u5730\u805a\u96c6\u6570\u636e\u5230\u5ba2\u6237\u7aef\u673a\u5668\uff0c\u800c\u4e14\u540c\u65f6\u590d\u5236\u4e00\u4efd\u3002\u5f53\u4e0b\u4e00\u6b21\u6709\u4eba\u9700\u8981\u540c\u4e00\u9875\u9762\u65f6\uff0cSquid\u53ef\u4ee5\u7b80\u5355\u5730\u4ece\u78c1\u76d8\u4e2d\u8bfb\u5230\u5b83\uff0c\u90a3\u6837\u6570\u636e\u8fc5\u5373\u5c31\u4f1a\u4f20\u8f93\u5230\u5ba2\u6237\u673a\u4e0a\u3002\u5f53\u524d\u7684Squid\u53ef\u4ee5\u5904\u7406HTTP\uff0cFTP\uff0cGOPHER\uff0cSSL\u548cWAIS\u7b49\u534f\u8bae\u3002\u4f46\u5b83\u4e0d\u80fd\u5904\u7406\u5982POP\uff0cNNTP\uff0cRealAudio\u4ee5\u53ca\u5176\u5b83\u7c7b\u578b\u7684\u4e1c\u897f\u3002
\r\n\t


\r\n

2.squid\u4ee3\u7406\u7684\u4f5c\u7528\uff1a

\r\n

1 \u901a\u8fc7\u7f13\u5b58\u7684\u65b9\u5f0f\u4e3a\u7528\u6237\u63d0\u4f9b\u52a0\u901fWEB\u8bbf\u95ee
\r\n\t
\r\n\t2 \u5bf9\u7528\u6237\u7684WEB\u8bbf\u95ee\u8fdb\u884c\u8fc7\u6ee4\u63a7\u5236
\r\n\t
\r\n\t3 \u5171\u4eabinternet\u8fde\u63a5\uff0c\u8282\u7701ip\u5f00\u9500
\r\n\t

\r\n

3\uff0e \u63a5\u4e0b\u6765\u6211\u4eec\u4e3b\u8981\u63a2\u8ba8\u7684\u662fsquid\u5404\u79cd\u4ee3\u7406\u7684\u5b9a\u4e49

\r\n\t

\r\n\t\u6b63\u5411\u4ee3\u7406:
\r\n\t
\r\n\ta\uff0e\u6807\u51c6\u7684\u4ee3\u7406\u7f13\u51b2\u670d\u52a1\u5668
\r\n\t
\r\n\t\u4e00\u4e2a\u6807\u51c6\u7684\u4ee3\u7406\u7f13\u51b2\u670d\u52a1\u88ab\u7528\u4e8e\u7f13\u5b58\u9759\u6001\u7684\u7f51\u9875\uff08\u4f8b\u5982\uff1ahtml\u6587\u4ef6\u548c\u56fe\u7247\u6587\u4ef6\u7b49\uff09\u5230\u672c\u5730\u7f51\u7edc\u4e0a\u7684\u4e00\u53f0\u4e3b\u673a\u4e0a\uff08\u5373\u4ee3\u7406\u670d\u52a1\u5668\uff09\u3002\u5f53\u88ab\u7f13\u5b58\u7684\u9875\u9762\u88ab\u7b2c\u4e8c\u6b21\u8bbf\u95ee\u7684\u65f6\u5019\uff0c\u6d4f\u89c8\u5668\u5c06\u76f4\u63a5\u4ece\u672c\u5730\u4ee3\u7406\u670d\u52a1\u5668\u90a3\u91cc\u83b7\u53d6\u8bf7\u6c42\u6570\u636e\u800c\u4e0d\u518d\u5411\u539fweb\u7ad9\u70b9\u8bf7\u6c42\u6570\u636e\u3002\u8fd9\u6837\u5c31\u8282\u7701\u4e86\u5b9d\u8d35\u7684\u7f51\u7edc\u5e26\u5bbd\uff0c\u800c\u4e14\u63d0\u9ad8\u4e86\u8bbf\u95ee\u901f\u5ea6\u3002\u4f46\u662f\uff0c\u8981\u60f3\u5b9e\u73b0\u8fd9\u79cd\u65b9\u5f0f\uff0c\u5fc5\u987b\u5728\u6bcf\u4e00\u4e2a\u5185\u90e8\u4e3b\u673a\u7684\u6d4f\u89c8\u5668\u4e0a\u660e\u786e\u6307\u660e\u4ee3\u7406\u670d\u52a1\u5668\u7684IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u3002\u5ba2\u6237\u7aef\u4e0a\u7f51\u65f6\uff0c\u6bcf\u6b21\u90fd\u628a\u8bf7\u6c42\u9001\u7ed9\u4ee3\u7406\u670d\u52a1\u5668\u5904\u7406\uff0c\u4ee3\u7406\u670d\u52a1\u5668\u6839\u636e\u8bf7\u6c42\u786e\u5b9a\u662f\u5426\u8fde\u63a5\u5230\u8fdc\u7a0bweb\u670d\u52a1\u5668\u83b7\u53d6\u6570\u636e\u3002\u5982\u679c\u5728\u672c\u5730\u7f13\u51b2\u533a\u6709\u76ee\u6807\u6587\u4ef6\uff0c\u5219\u76f4\u63a5\u5c06\u6587\u4ef6\u4f20\u7ed9\u7528\u6237\u5373\u53ef\u3002\u5982\u679c\u6ca1\u6709\u7684\u8bdd\u5219\u5148\u53d6\u56de\u6587\u4ef6\uff0c\u5148\u5728\u672c\u5730\u4fdd\u5b58\u4e00\u4efd\u7f13\u51b2\uff0c\u7136\u540e\u5c06\u6587\u4ef6\u53d1\u7ed9\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u3002
\r\n\t
\r\n\tb\uff0e\u900f\u660e\u4ee3\u7406\u7f13\u51b2\u670d\u52a1\u5668
\r\n\t
\r\n\t\u900f\u660e\u4ee3\u7406\u7f13\u51b2\u670d\u52a1\u548c\u6807\u51c6\u4ee3\u7406\u670d\u52a1\u5668\u7684\u529f\u80fd\u5b8c\u5168\u76f8\u540c\u3002\u4f46\u662f\uff0c\u4ee3\u7406\u64cd\u4f5c\u5bf9\u5ba2\u6237\u7aef\u7684\u6d4f\u89c8\u5668\u662f\u900f\u660e\u7684\uff08\u5373\u4e0d\u9700\u6307\u660e\u4ee3\u7406\u670d\u52a1\u5668\u7684IP\u548c\u7aef\u53e3\uff09\u3002\u900f\u660e\u4ee3\u7406\u670d\u52a1\u5668\u963b\u65ad\u7f51\u7edc\u901a\u4fe1\uff0c\u5e76\u4e14\u8fc7\u6ee4\u51fa\u8bbf\u95ee\u5916\u90e8\u7684HTTP\uff0880\u7aef\u53e3\uff09\u6d41\u91cf\u3002\u5982\u679c\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u5728\u672c\u5730\u6709\u7f13\u51b2\u5219\u5c06\u7f13\u51b2\u7684\u6570\u636e\u76f4\u63a5\u53d1\u7ed9\u7528\u6237\uff0c\u5982\u679c\u5728\u672c\u5730\u6ca1\u6709\u7f13\u51b2\u5219\u5411\u8fdc\u7a0bweb\u670d\u52a1\u5668\u53d1\u51fa\u8bf7\u6c42\uff0c\u5176\u4f59\u64cd\u4f5c\u548c\u6807\u51c6\u7684\u4ee3\u7406\u670d\u52a1\u5668\u5b8c\u5168\u76f8\u540c\u3002\u5bf9\u4e8eLinux\u64cd\u4f5c\u7cfb\u7edf\u6765\u8bf4\uff0c\u900f\u660e\u4ee3\u7406\u4f7f\u7528Iptables\u6216\u8005Ipchains\u5b9e\u73b0\u3002\u56e0\u4e3a\u4e0d\u9700\u8981\u5bf9\u6d4f\u89c8\u5668\u4f5c\u4efb\u4f55\u8bbe\u7f6e\uff0c\u6240\u4ee5\uff0c\u900f\u660e\u4ee3\u7406\u5bf9\u4e8eISP\uff08Internet\u670d\u52a1\u5668\u63d0\u4f9b\u5546\uff09\u7279\u522b\u6709\u7528\u3002
\r\n\t
\r\n\t\u53cd\u5411\u4ee3\u7406:
\r\n\t
\r\n\ta. \u53cd\u5411\u4ee3\u7406\u7f13\u51b2\u670d\u52a1\u5668
\r\n\t
\r\n\t\u53cd\u5411\u4ee3\u7406\u662f\u548c\u524d\u4e24\u79cd\u4ee3\u7406\u5b8c\u5168\u4e0d\u540c\u7684\u4e00\u79cd\u4ee3\u7406\u670d\u52a1\u3002\u4f7f\u7528\u5b83\u53ef\u4ee5\u964d\u4f4e\u539f\u59cbWEB\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u627f\u62c5\u4e86\u5bf9\u539f\u59cbWEB\u670d\u52a1\u5668\u7684\u9759\u6001\u9875\u9762\u7684\u8bf7\u6c42\uff0c\u9632\u6b62\u539f\u59cb\u670d\u52a1\u5668\u8fc7\u8f7d\u3002\u5b83\u4f4d\u4e8e\u672c\u5730WEB\u670d\u52a1\u5668\u548cInternet\u4e4b\u95f4\uff0c\u5904\u7406\u6240\u6709\u5bf9WEB\u670d\u52a1\u5668\u7684\u8bf7\u6c42\uff0c\u7ec4\u7ec7\u4e86WEB\u670d\u52a1\u5668\u548cInternet\u7684\u76f4\u63a5\u901a\u4fe1\u3002\u5982\u679c\u4e92\u8054\u7f51\u7528\u6237\u8bf7\u6c42\u7684\u9875\u9762\u5728\u4ee3\u7406\u670d\u52a1\u5668\u4e0a\u6709\u7f13\u51b2\u7684\u8bdd\uff0c\u4ee3\u7406\u670d\u52a1\u5668\u76f4\u63a5\u5c06\u7f13\u51b2\u5185\u5bb9\u53d1\u9001\u7ed9\u7528\u6237\u3002\u5982\u679c\u6ca1\u6709\u7f13\u51b2\u5219\u5148\u5411WEB\u670d\u52a1\u5668\u53d1\u51fa\u8bf7\u6c42\uff0c\u53d6\u56de\u6570\u636e\uff0c\u672c\u5730\u7f13\u5b58\u540e\u518d\u53d1\u9001\u7ed9\u7528\u6237\u3002\u8fd9\u79cd\u65b9\u5f0f\u901a\u8fc7\u964d\u4f4e\u4e86\u5411WEB\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u6570\u4ece\u800c\u964d\u4f4e\u4e86WEB\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002
\r\n\t

\r\n

4\uff0eSquid\u4e3b\u8981\u7ec4\u6210\u90e8\u5206

\r\n\t

\r\n\t\u670d\u52a1\u540d\uff1asquid
\r\n\t
\r\n\t\u4e3b\u7a0b\u5e8f\uff1a/usr/sbin/squid
\r\n\t
\r\n\t\u914d\u7f6e\u76ee\u5f55\uff1a/etc/squid
\r\n\t
\r\n\t\u4e3b\u914d\u6587\u4ef6\uff1a/etc/squid/squid.conf
\r\n\t
\r\n\t\u76d1\u542ctcp\u7aef\u53e3\u53f7\uff1a3128
\r\n\t
\r\n\t\u9ed8\u8ba4\u8bbf\u95ee\u65e5\u5fd7\u6587\u4ef6\uff1a/var/log/squid/access.log
\r\n\t

\r\n

5.squid \u5e38\u7528\u914d\u7f6e\u9009\u9879(/etc/squid/squid.conf)

\r\n\t

\r\n\thttp_port 3128 (\u8fd8\u53ef\u4ee5\u53ea\u76d1\u542c\u4e00\u4e2a\u4e00\u4e2aip http_port 192.168.0.1:3128)
\r\n\t
\r\n\tcache_mem 64MB#\u7f13\u5b58\u5360\u5185\u5b58\u5927\u5c0f
\r\n\t
\r\n\tmaximum_object_size 4096KB#\u6700\u5927\u7f13\u5b58\u5757
\r\n\t
\r\n\treply_body_max_size 1024000 allow all #\u9650\u5b9a\u4e0b\u8f7d\u6587\u4ef6\u5927\u5c0f
\r\n\t
\r\n\taccess_log /var/log/squid/access.log #\u8bbf\u95ee\u65e5\u5fd7\u5b58\u653e\u7684\u6587\u4ef6
\r\n\t
\r\n\tvisible_hostname proxy.test.com #\u53ef\u89c1\u7684\u4e3b\u673a\u540d
\r\n\t
\r\n\tcache_dir ufs /var/spool/squid 100 16 256
\r\n\t
\r\n\tusf:\u7f13\u5b58\u6570\u636e\u7684\u5b58\u50a8\u683c\u5f0f
\r\n\t
\r\n\t/var/spool/squid \u7f13\u5b58\u76ee\u5f55
\r\n\t
\r\n\t100 : \u7f13\u5b58\u76ee\u5f55\u5360\u78c1\u76d8\u7a7a\u95f4\u5927\u5c0f\uff08M\uff09
\r\n\t
\r\n\t16 \uff1a\u7f13\u5b58\u7a7a\u95f4\u4e00\u7ea7\u5b50\u76ee\u5f55\u4e2a\u6570
\r\n\t
\r\n\t256 \uff1a\u7f13\u5b58\u7a7a\u95f4\u4e8c\u7ea7\u5b50\u76ee\u5f55\u4e2a\u6570
\r\n\t
\r\n\tcache_mgr webmaster@test.com #\u5b9a\u4e49\u7ba1\u7406\u5458\u90ae\u7bb1
\r\n\t
\r\n\thttp_access deny all #\u8bbf\u95ee\u63a7\u5236
\r\n\t

\r\n

6.squid\u4e2d\u7684\u8bbf\u95ee\u63a7\u5236

\r\n\t

\r\n\t\u4f7f\u7528\u8bbf\u95ee\u63a7\u5236\u7279\u6027\uff0c\u53ef\u4ee5\u63a7\u5236\u5728\u8bbf\u95ee\u65f6\u6839\u636e\u7279\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fdb\u884c\u7f13\u5b58\u3001\u8bbf\u95ee\u7279\u5b9a\u7ad9\u70b9\u6216\u4e00\u7ec4\u7ad9\u70b9\u7b49\u7b49\u3002 Squid \u8bbf\u95ee\u63a7\u5236\u6709\u4e24\u4e2a\u8981\u7d20\uff1aACL \u5143\u7d20\u548c\u8bbf\u95ee\u5217\u8868\u3002\u8bbf\u95ee\u5217\u8868\u53ef\u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u67d0\u4e9b\u7528\u6237\u5bf9\u6b64\u670d\u52a1\u7684\u8bbf\u95ee\u3002
\r\n\t
\r\n\t\u4e0b\u9762\u5217\u51fa\u4e00\u4e9b\u91cd\u8981\u7684 ACL \u5143\u7d20\u7c7b\u578b
\r\n\t
\r\n\t\u3000\u3000* src : \u6e90\u5730\u5740 \uff08\u5373\u5ba2\u6237\u673aIP\u5730\u5740\uff09
\r\n\t
\r\n\t\u3000\u3000* dst : \u76ee\u6807\u5730\u5740 \uff08\u5373\u670d\u52a1\u5668IP\u5730\u5740\uff09
\r\n\t
\r\n\t\u3000\u3000* srcdomain : \u6e90\u540d\u79f0 \uff08\u5373\u5ba2\u6237\u673a\u540d\u79f0\uff09
\r\n\t
\r\n\t\u3000\u3000* dstdomain : \u76ee\u6807\u540d\u79f0 \uff08\u5373\u670d\u52a1\u5668\u540d\u79f0\uff09
\r\n\t
\r\n\t\u3000\u3000* time : \u4e00\u5929\u4e2d\u7684\u65f6\u523b\u548c\u4e00\u5468\u5185\u7684\u4e00\u5929
\r\n\t
\r\n\t\u3000\u3000* url_regex : URL \u89c4\u5219\u8868\u8fbe\u5f0f\u5339\u914d
\r\n\t
\r\n\t\u3000\u3000* urlpath_regex: URL-path \u89c4\u5219\u8868\u8fbe\u5f0f\u5339\u914d\uff0c\u7565\u53bb\u534f\u8bae\u548c\u4e3b\u673a\u540d
\r\n\t
\r\n\t\u3000\u3000* proxy_auth : \u901a\u8fc7\u5916\u90e8\u7a0b\u5e8f\u8fdb\u884c\u7528\u6237\u9a8c\u8bc1
\r\n\t
\r\n\t\u3000\u3000* maxconn : \u5355\u4e00 IP \u7684\u6700\u5927\u8fde\u63a5\u6570
\r\n\t
\r\n\t\u4e3a\u4e86\u4f7f\u7528\u63a7\u5236\u529f\u80fd\uff0c\u5fc5\u987b\u5148\u8bbe\u7f6e ACL \u89c4\u5219\u5e76\u5e94\u7528\u3002ACL \u58f0\u660e\u7684\u683c\u5f0f\u5982\u4e0b\uff1a
\r\n\t
\r\n\tacl acl_element_name type_of_acl_element values_to_acl
\r\n\t
\r\n\t\u6ce8\uff1a
\r\n\t
\r\n\t\u3000\u30001. acl_element_name \u53ef\u4ee5\u662f\u4efb\u4e00\u4e2a\u5728 ACL \u4e2d\u5b9a\u4e49\u7684\u540d\u79f0\u3002
\r\n\t
\r\n\t\u3000\u30002. \u4efb\u4f55\u4e24\u4e2a ACL \u5143\u7d20\u4e0d\u80fd\u7528\u76f8\u540c\u7684\u540d\u5b57\u3002
\r\n\t
\r\n\t\u3000\u30003. \u6bcf\u4e2a ACL \u7531\u5217\u8868\u503c\u7ec4\u6210\u3002\u5f53\u8fdb\u884c\u5339\u914d\u68c0\u6d4b\u7684\u65f6\u5019\uff0c\u591a\u4e2a\u503c\u7531\u903b\u8f91\u6216\u8fd0\u7b97\u8fde\u63a5\uff1b\u6362\u8a00\u4e4b\uff0c\u5373\u4efb\u4e00 ACL bbs.bitsCN.com \u5143\u7d20\u7684\u503c\u88ab\u5339\u914d\uff0c\uff0c\u5219\u8fd9\u4e2a ACL \u5143\u7d20\u5373\u88ab\u5339\u914d\u3002
\r\n\t
\r\n\t\u3000\u30004. \u5e76\u4e0d\u662f\u6240\u6709\u7684 ACL \u5143\u7d20\u90fd\u80fd\u4f7f\u7528\u8bbf\u95ee\u5217\u8868\u4e2d\u7684\u5168\u90e8\u7c7b\u578b\u3002
\r\n\t
\r\n\t\u3000\u30005. \u4e0d\u540c\u7684 ACL \u5143\u7d20\u5199\u5728\u4e0d\u540c\u884c\u4e2d\uff0cSquid \u5c06\u628a\u5b83\u4eec\u7ec4\u5408\u5728\u4e00\u4e2a\u5217\u8868\u4e2d\u3002
\r\n\t
\r\n\t\u3000\u3000\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u8bb8\u591a\u4e0d\u540c\u7684\u8bbf\u95ee\u6761\u76ee\u3002\u4e0b\u9762\u5217\u51fa\u6211\u4eec\u5c06\u8981\u7528\u5230\u7684\u51e0\u4e2a\uff1a
\r\n\t
\r\n\t\u3000\u3000* http_access: \u5141\u8bb8 HTTP \u8bbf\u95ee\u3002\u8fd9\u4e2a\u662f\u4e3b\u8981\u7684\u8bbf\u95ee\u63a7\u5236\u6761\u76ee\u3002
\r\n\t
\r\n\t\u3000\u3000* no_cache: \u5b9a\u4e49\u5bf9\u7f13\u5b58\u8bf7\u6c42\u7684\u54cd\u5e94\u3002
\r\n\t
\r\n\t\u3000\u3000\u8bbf\u95ee\u5217\u8868\u7684\u89c4\u5219\u7531\u4e00\u4e9b\u7c7b\u4f3c 'allow' \u6216 'deny' \u7684\u5173\u952e\u5b57\u6784\u6210\uff0c\u7528\u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u5411\u7279\u5b9a\u6216\u4e00\u7ec4 ACL \u5143\u7d20\u63d0\u4f9b\u670d\u52a1\u3002
\r\n\t
\r\n\t\u3000\u3000\u6ce8\uff1a\u3000
\r\n\t
\r\n\t\u3000\u30001. \u8fd9\u4e9b\u89c4\u5219\u6309\u7167\u5b83\u4eec\u7684\u6392\u5217\u987a\u5e8f\u8fdb\u884c\u5339\u914d\u68c0\u6d4b\uff0c\u4e00\u65e6\u68c0\u6d4b\u5230\u5339\u914d\u7684\u89c4\u5219\uff0c\u5339\u914d\u68c0\u6d4b\u5c31\u7acb\u5373\u7ed3\u675f\u3002
\r\n\t
\r\n\t\u3000\u30002. \u4e00\u4e2a\u8bbf\u95ee\u5217\u8868\u53ef\u4ee5\u6709\u591a\u6761\u89c4\u5219\u7ec4\u6210\u3002
\r\n\t
\r\n\t\u3000\u30003. \u5982\u679c\u6ca1\u6709\u4efb\u4f55\u89c4\u5219\u4e0e\u8bbf\u95ee\u8bf7\u6c42\u5339\u914d\uff0c\u9ed8\u8ba4\u52a8\u4f5c\u5c06\u4e0e\u5217\u8868\u4e2d\u6700\u540e\u4e00\u6761\u89c4\u5219\u5bf9\u5e94\u3002
\r\n\t
\r\n\t\u3000\u30004. \u4e00\u4e2a\u8bbf\u95ee\u6761\u76ee\u4e2d\u7684\u6240\u6709\u5143\u7d20\u5c06\u7528\u903b\u8f91\u4e0e\u8fd0\u7b97\u8fde\u63a5\uff1a
\r\n\t
\r\n\t\u3000\u3000http_access Action \u58f0\u660e1 AND \u58f0\u660e2 AND \u58f0\u660e OR.
\r\n\t
\r\n\t\u3000\u3000http_access Action \u58f0\u660e3
\r\n\t
\r\n\t\u3000\u3000\u591a\u4e2a http_access \u58f0\u660e\u95f4\u7528\u6216\u8fd0\u7b97\u8fde\u63a5\uff0c\u4f46\u6bcf\u4e2a\u8bbf\u95ee\u6761\u76ee\u7684\u5143\u7d20\u95f4\u7528\u4e0e\u8fd0\u7b97\u8fde\u63a5\u3002
\r\n\t
\r\n\t\u3000\u30005. \u8bf7\u8bb0\u4f4f\u5217\u8868\u4e2d\u7684\u89c4\u5219\u603b\u662f\u9075\u5faa\u7531\u4e0a\u800c\u4e0b\u7684\u987a\u5e8f\u3002
\r\n\t 

\r\n"}, {"title": "Linux\u5b89\u88c5squid", "desc": "Squid\u53ef\u8fd0\u884c\u5728\u5927\u591a\u6570Unix\u548cOS/2\u7248\u672c\u7684\u7cfb\u7edf\u4e4b\u4e0a\uff0c\u5df2\u77e5\u7684\u53ef\u5de5\u4f5c\u7684\u6709\uff1a\r\nWindows,AIX\uff0cDigital Unix\uff0cFreeBSD\uff0cHP-UX\uff0cIrix\uff0cLinux\uff0cNetBSD\uff0cNextstep\uff0cSCO\uff0cSolaris", "content": "

\r\n\t1.\u4e0b\u8f7dsquid\u6e90\u7801\u5b89\u88c5\u5305

\r\n

wget http://www.squid-cache.org/Versions/v3/3.2/squid-3.2.3.tar.gz

\r\n

\r\n\t2.\u5b89\u88c5\u4f9d\u8d56\u5305\r\n

yum install gcc* \uff1b

\r\n

yum -y install gcc-*

\r\n

\r\n\t3.\u5b89\u88c5squid\r\n

\u89e3\u538b\u7f29
\r\n\t
\r\n\ttar zxvf squid-3.2.3.tar.gz
\r\n\t
\r\n\t\u8fdb\u5165\u89e3\u538b\u540e\u7684\u76ee\u5f55
\r\n\t
\r\n\tcd squid-3.2.3\uff08\u76ee\u5f55\u4f4d\u7f6e\u4f9d\u636e\u4e2a\u4eba\u8bbe\u5b9a\u800c\u4e0d\u540c\uff09
\r\n\t
\r\n\t\u5b89\u88c5
\r\n\t
\r\n\t[root@localhost squid-3.2.3]# ./configure --prefix=/usr/local/squid --enable-gnuregex --enable-icmp --enable-linux-netfilter --enable-default-err-language="Simplify_Chinese" --enable-kill-parent-hack --enable-cache-digests --enable-dlmalloc --enable-poll --enable-async-io=240 --enable-delay-pools --with-filedescriptors=65536 --enable-snmp --enable-arp-acl --mandir=/usr/share/man/ --with-large-files
\r\n\t
\r\n\t[root@localhost squid-3.2.3]#make && make install

\r\n

************************************************************************************************************
\r\n\t
\r\n\tchmod 777 /usr/local/squid/var
\r\n\t
\r\n\tchmod 777 /usr/local/squid/var/logs
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -z  #\u91cd\u65b0\u5efa\u7acb\u7f13\u5b58
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -k parse # \u6d4b\u8bd5\u914d\u7f6e\u6587\u4ef6
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -k reconfigure  #\u91cd\u65b0\u914d\u7f6e\u6587\u4ef6
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -k shutdown  #\u5173\u95edsquid
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -s #\u540e\u53f0\u5f00\u542fsquid
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -N -d1 #\u524d\u53f0\u5f00\u542fsquid
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -k interrupt  #\u5173\u95edsquid\uff08\u66f4\u9ad8\u4f18\u5148\u7ea7\uff0c\u76f4\u63a5\u5173\u95edsquid\uff09
\r\n\t
\r\n\t/usr/local/squid/sbin/squid -k kill  #\u5173\u95edsquid\uff08\u6700\u9ad8\u4f18\u5148\u7ea7\uff0c\u76f4\u63a5\u6740\u6b7bsquid\u8fdb\u7a0b\uff09
\r\n\t 

\r\n

\r\n\t4.\u8bbe\u7f6esquid\u81ea\u542f\u52a8\r\n

echo "/usr/local/squid/sbin/squid -s " >>/etc/rc.local
\r\n\t
\r\n\t\u8bbe\u7f6e\u6bcf\u5468\u4e8c\u51cc\u6668\u4e24\u70b925\u5206\u81ea\u52a8\u6eda\u52a8\u65e5\u5fd7
\r\n\t
\r\n\techo "25 2 * * 2 root /usr/local/squid/sbin/squid -k rotate " >>/etc/crontab

\r\n"}, {"title": "\u914d\u7f6eSquid\u900f\u660e\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u4f7f\u5c40\u57df\u7f51\u5185\u5ba2\u6237\u673a\u901a\u8fc7\u4ee3\u7406\u670d\u52a1\u5668\u4e0a\u7f51", "desc": "1\u3001\u7981\u6b62\u6240\u6709\u5ba2\u6237\u673a\u8bbf\u95eewww.abc.com\u57df\u540d\r\n2\u3001\u7981\u6b62IP\u5730\u5740\u4e3a192.168.237.131\u7684\u5ba2\u6237\u673a\u8bbf\u95ee\u5916\u7f51\r\n3\u3001\u7981\u6b62\u6240\u6709\u7528\u6237\u8bbf\u95eeIP\u5730\u5740\u4e3a192.168.237.129\u7684\u7f51\u7ad9\r\n4\u3001\u7981\u6b62\u6240\u6709\u7528\u6237\u8bbf\u95ee\u57df\u540d\u4e2d\u5305\u542b\u6709163.com\u7684\u7f51\u7ad9\r\n5\u3001\u7981\u6b62192.168.237.0/24\u8fd9\u4e2a\u7f51\u6bb5\u6240\u6709\u7684\u5ba2\u6237\u673a\u5728\u5468\u4e00\u5230\u5468\u4e94\u768418:00-21:00\u4e0a\u7f51\r\n6\u3001\u7981\u6b62\u5ba2\u6237\u673a\u4e0b\u8f7d*.mp3\u3001*.exe\u3001*.zip\u548c*.rar\u7c7b\u578b\u7684\u6587\u4ef6", "content": "

\r\n\t\u5b89\u88c5\u524d\u51c6\u5907\uff1a

\r\n

1\u3001\u5173\u95edSELinux
\r\n\t    vi /etc/selinux/config
\r\n\t    #SELINUX=enforcing     #\u6ce8\u91ca\u6389
\r\n\t    #SELINUXTYPE=targeted  #\u6ce8\u91ca\u6389
\r\n\t    SELINUX=disabled  #\u589e\u52a0
\r\n\t    :wq  \u4fdd\u5b58\uff0c\u5173\u95ed\u3002
\r\n\t    shutdown -r now\u91cd\u542f\u7cfb\u7edf
\r\n\t2\u3001\u8bbe\u7f6e\u9632\u706b\u5899\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219
\r\n\t    iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128  #\u5f00\u542f\u7aef\u53e3\u8f6c\u53d1\u529f\u80fd\uff0c\u628a\u5185\u7f51eth1\u768480\u7aef\u53e3\u8f6c\u53d1\u5230\u5916\u7f51eth0\u76843128\u7aef\u53e3
\r\n\t    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  #\u5f00\u542f\u5916\u7f51eth0\u7684NAT\u7f51\u7edc\u5730\u5740\u8f6c\u6362\u529f\u80fd
\r\n\t    service iptables save  #\u4fdd\u5b58\u89c4\u5219
\r\n\t    /etc/init.d/iptables restart  #\u91cd\u542f\u9632\u706b\u5899
\r\n\t3\u3001\u4fee\u6539\u4e3b\u673a\u7684\u8def\u7531\u6a21\u5f0f
\r\n\t    vi /etc/sysctl.conf
\r\n\t    net.ipv4.ip_forward = 1    #0\u4e3a\u5173\u95ed\uff0c1\u4e3a\u5f00\u542f\u8def\u7531 \u4f7f\u7528sysctl -p \u547d\u4ee4\u67e5\u770b
\r\n\t ===========================================================================

\r\n

\r\n\t\u5b89\u88c5\u5f00\u59cb\uff1a

\r\n

1\u3001\u5b89\u88c5Squid
\r\n\t    yum install squid   #\u5b89\u88c5(Squid 2.6)
\r\n\t    service squid start #\u542f\u52a8
\r\n\t    service squid restart #\u91cd\u542f
\r\n\t    chkconfig squid on  #\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8
\r\n\t2\u3001\u914d\u7f6eSquid
\r\n\t   cp /etc/squid/squid.conf /etc/squid/squid.confbak  #\u5907\u4efd
\r\n\t   vi  /etc/squid/squid.conf  #\u7f16\u8f91\u6587\u4ef6
\r\n\t http_port 3128 transparent
\r\n\t cache_mem 128 MB
\r\n\t cache_dir ufs /var/spool/squid 4096 16 256
\r\n\t cache_effective_user squid  #\u8bbe\u7f6e\u7528\u6237
\r\n\t cache_effective_group squid  #\u8bbe\u7f6e\u7528\u6237\u7ec4
\r\n\t access_log /var/log/squid/access.log   #\u8bbe\u7f6e\u8bbf\u95ee\u65e5\u5fd7\u6587\u4ef6
\r\n\t cache_log /var/log/squid/cache.log  #\u8bbe\u7f6e\u7f13\u5b58\u65e5\u5fd7\u6587\u4ef6
\r\n\t cache_store_log /var/log/squid/store.log  #\u8bbe\u7f6e\u7f13\u5b58\u8bb0\u5f55\u6587\u4ef6
\r\n\t visible_hostname cdn.abc.com  #\u8bbe\u7f6esquid\u670d\u52a1\u5668\u4e3b\u673a\u540d
\r\n\t cache_mgr lingvven@163.com
\r\n\t acl all src 0.0.0.0/0.0.0.0  #\u8bbe\u7f6e\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff0c\u9ed8\u8ba4\u5f00\u542f
\r\n\t http_access allow all
\r\n\t acl client dstdomain -i www.abc.com    #\u627e\u5230TAG: acl\u6807\u7b7e\uff0c\u5728\u5176\u6700\u540e\u6dfb\u52a0\u4e0b\u9762\u5185\u5bb9
\r\n\t http_access deny client  #\u7981\u6b62\u6240\u6709\u5ba2\u6237\u673a\u8bbf\u95eewww.abc.com\u57df\u540d
\r\n\t acl client131 src 192.168.237.131  #\u7981\u6b62IP\u5730\u5740\u4e3a192.168.237.131\u7684\u5ba2\u6237\u673a\u8bbf\u95ee\u5916\u7f51
\r\n\t http_access deny client131
\r\n\t acl client129 dst 192.168.237.129  #\u7981\u6b62\u6240\u6709\u7528\u6237\u8bbf\u95eeIP\u5730\u5740\u4e3a192.168.237.129\u7684\u7f51\u7ad9
\r\n\t http_access deny client129
\r\n\t acl client163 url_regex -i 163.com  #\u7981\u6b62\u6240\u6709\u7528\u6237\u8bbf\u95ee\u57df\u540d\u4e2d\u5305\u542b\u6709163.com\u7684\u7f51\u7ad9
\r\n\t http_access deny client163
\r\n\t acl clientdate src 192.168.237.0/255.255.255.0  #\u7981\u6b62\u8fd9\u4e2a\u7f51\u6bb5\u6240\u6709\u7684\u5ba2\u6237\u673a\u5728\u5468\u4e00\u5230\u5468\u4e94\u768418:00-21:00\u4e0a\u7f51
\r\n\t acl worktime time MTWHF 18:00-21:00
\r\n\t http_access deny clientdate worktime
\r\n\t acl clientxiazai urlpath_regex -i \\.mp3$  \\.exe$  \\.zip$  \\.rar$
\r\n\t http_access deny clientxiazai  #\u7981\u6b62\u5ba2\u6237\u673a\u4e0b\u8f7d*.mp3\u3001*.exe\u3001*.zip\u548c*.rar\u7c7b\u578b\u7684\u6587\u4ef6
\r\n\t service squid stop  #\u505c\u6b62
\r\n\t /usr/sbin/squid  -z  #\u521d\u59cb\u5316cache\u7f13\u5b58\u76ee\u5f55
\r\n\t service squid start #\u542f\u52a8
\r\n\t service squid restart #\u91cd\u542f
\r\n\t\u5907\u6ce8\uff1a\u8bbf\u95ee\u63a7\u5236\u5e94\u7528\u5b9e\u4f8b
\r\n\t
\r\n\t acl clientall src 192.168.237.0/255.255.255.0  #\u7981\u6b62192.168.237.0\u8fd9\u4e2a\u5b50\u7f51\u91cc\u6240\u6709\u7684\u5ba2\u6237\u673a\u4e0a\u7f51
\r\n\t http_access deny clientall
\r\n\t acl urlsex url_regex -i sex   #\u7981\u6b62\u7528\u6237\u8bbf\u95ee\u57df\u540d\u5305\u542b\u6709sex\u5173\u952e\u5b57\u7684URL
\r\n\t http_access deny urlsex
\r\n\t acl client132 src 192.168.237.132  #\u9650\u5236IP\u5730\u5740\u4e3a192.168.237.132\u7684\u5ba2\u6237\u673a\u5e76\u53d1\u6700\u5927\u8fde\u63a5\u6570\u4e3a5
\r\n\t acl conn5 maxconn 5
\r\n\t http_access deny client132 conn5
\r\n\t ====================================================================

\r\n

\r\n\t\u5ba2\u6237\u673a\u8bbe\u7f6e\uff1a

\r\n

\u6253\u5f00\u5ba2\u6237\u673a\u7684\u672c\u5730\u8fde\u63a5\u8bbe\u7f6e
\r\n\tIP\uff1a192.168.237.130 \uff08\u540c\u4e00\u4e2a\u7f51\u6bb5\u7684ip\u90fd\u53ef\u4ee5\uff09
\r\n\t\u5b50\u7f51\u63a9\u7801\uff1a255.255.255.0
\r\n\t\u7f51\u5173\uff1a192.168.237.160 \uff08Squid\u4ee3\u7406\u670d\u52a1\u5668\u7684\u5185\u7f51eth1\u5730\u5740\uff09
\r\n\tDNS\uff1a8.8.8.8
\r\n\t\u5907\u7528DNS:8.8.4.4
\r\n\t\u914d\u7f6e\u5b8c\u6210\uff0c\u73b0\u5728\u5185\u90e8\u7f51\u6bb5192.168.237.0/24\u5185\u7684\u5ba2\u6237\u673a\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7406\u670d\u52a1\u5668192.168.21.160\u8bbf\u95ee\u5916\u7f51\u4e86\u3002

\r\n"}, {"title": "Tengine|nginx\u901a\u8fc7\u53cd\u5411\u4ee3\u7406\u5b9e\u73b0\u672a\u5907\u6848\u57df\u540d\u8bbf\u95ee", "desc": "\u672c\u65b9\u6cd5\u5b9e\u73b0\u524d\u63d0\u662f8123\u7aef\u53e3\uff08\u4e5f\u53ef\u4ee5\u662f\u5176\u4ed6\u7aef\u53e3\uff09\u9762\u5bf9\u4e92\u8054\u7f51\u6253\u5f00\u3002server\u91cc\u9762\u76d1\u542c80\u7aef\u53e3\uff0c\u7136\u540e\u53cd\u5411\u4ee3\u74068123\u7aef\u53e3\u3002", "content": "

1.\u5176\u4e2dserver_name\u90e8\u5206\u662f\u6211\u7684\u57df\u540d\u53ef\u4ee5\u66ff\u6362\u6210\u5176\u4ed6\u60f3\u8981\u7684\u57df\u540d

\r\n

2.8123\u662f\u6211\u6307\u5b9a\u7684\u7aef\u53e3\u53ef\u4ee5\u6539\u6210\u5176\u4ed6\u7aef\u53e3\uff0c\u6700\u540e\u8bbf\u95eehttp://zhoudl.com\u6d4f\u89c8\u5668\u4f1a\u76f4\u63a5\u76f4\u63a5\u8df3\u8f6c\u6210http://zhoudl.com:8123

\r\n

3.\u672c\u673a8123\u7aef\u53e3\u4e1a\u52a1\u4e00\u5b9a\u8981\u5148\u914d\u7f6e\u901a\u3002

\r\n

\u4e0b\u9762\u7ed9\u51faserver\u90e8\u5206\u4ee3\u7801\u3002

\r\n
\r\n\t
\r\n\r\nserver {\r\nlisten 80;\r\nserver_name www.zhoudl.com zhoudl.com;\r\nproxy_set_header X-Real-IP $remote_addr;\r\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\naccess_log off;\r\n location / {\r\nproxy_pass http://localhost:8123;\r\n}\r\n}\r\n
\r\n
\r\n"}]