目前小站状态有四个站,两个node,两个php
以及一堆不会用的工具。

部署图如下

问题

小站目前问题很多,例如nginx配置不正确,导致反向代理有问题,等等

配置文件

nginx配置文件

nginx配置文件如下,这个配置文件应该是最重要的

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  3000;
    accept_mutex on;
    multi_accept on;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    tcp_nopush     on;

    keepalive_timeout  65;

    gzip  on;

    include /etc/nginx/conf.d/*.conf;

   client_max_body_size 5m;

   upstream iming_info {
      server 47.94.95.84:4000 weight=5;
      server 139.199.225.229:4000 weight=10;
   }

   upstream wordpress_info {
      server 47.94.95.84:32808 weight=10;
      server 47.94.95.84:32810 weight=10;
   }

   upstream ghost_info {
      server 47.94.95.84:8080 weight=10;
      server 139.199.225.229:8080 weight=5;
   }

   upstream typecho_info {
      server 139.199.225.229:32843 weight=10;
      server 139.199.225.229:32845 weight=10;
   }

    server {
       listen 449;
       server_name iming.info;
       return 301 http://www.iming.info$request_uri;
    }

    server {
       listen    449;
       server_name www.iming.info;

       location /oldTypecho {
           proxy_pass  http://typecho_info;
           rewrite /oldTypecho/(.*) /$1 break;
           proxy_set_header  host  www.iming.info;
           proxy_redirect    http://www.iming.info/oldTypecho/ /oldTypecho/;
           proxy_set_header  X-Real-IP   $remote_addr;
           proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
       }

       location /oldTypecho2 {
           proxy_pass http://typecho_info;
           proxy_set_header host www.iming.info;
           proxy_redirect  off;
           proxy_set_header X-Real-IP  $remote_addr;
           proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;

       }
       
       location /page {
           
           proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
           proxy_set_header X-Real-IP  $remote_addr;
           proxy_redirect  off;
           proxy_set_header host www.iming.info;
           proxy_pass http://typecho_info;
       }


       location /oldWordpress {
           rewrite /oldWordpress/(.*) /$1 break;
           proxy_pass http://wordpress_info;
       }

       location /oldHexo {
           proxy_pass  http://iming_info;
           proxy_redirect     off;
           proxy_set_header   Host             $host;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
       }


       location / {
           proxy_pass http://47.94.95.84:8080;
           proxy_redirect   off;
           proxy_set_header  host    $host;
           proxy_set_header  X-Real-IP   $remote_addr;
           proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for; 
       }

       
   }
}

apache

apache和php联合使用,配置有域名重写,即rewrive,加载了域名重写的so模块。

so 是动态链接库哦

nfs

系统是centos,配置文件如下

[root@VM_29_131_centos ~]# cat /etc/exports
/root/data/  47.94.95.84(rw,sync,no_root_squash,no_all_squash)
/root/data/  127.0.0.1(rw,sync,no_root_squash,no_all_squash)
/root/data/  10.135.29.131(rw,sync,no_root_squash,no_all_squash)
/root/data/  139.199.225.229(rw,sync,no_root_squash,no_all_squash)
/root/data/  localhost(rw,sync,no_root_squash,no_all_squash)

mysql

mysql的配置文件目前没有进行修改

docker

全部都已经docker化了

最后

小站目前状态稳定。