源码安装方法
服务器最低配置4h4g
安装宝塔 只安装nginx 其他不用安装 不用创建站点
安装好Nginx 去配置文件 把以下 复制进去
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
user www www; worker_processes auto; error_log /www/wwwlogs/nginx_error.log crit; pid /www/server/nginx/logs/nginx.pid; worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; multi_accept on; } http { include mime.types; # include luawaf.conf; include proxy.conf; default_type aapplication/octet-stream; server_names_hash_bucket_size 512; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 50m; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 2; gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; gzip_vary on; gzip_proxied expired no-cache no-store private auth; gzip_disable "MSIE [1-6]\." ; limit_conn_zone $binary_remote_addr zone=perip:10m; limit_conn_zone $server_name zone=perserver:10m; server_tokens off; access_log off; # 增加server server{ listen 7002; # 图片上传访问域名 upload.xx.xx # server_name localhost; # 拒接访问html 等类型的文件避免受到脚本攻击 location ~* /\.(html|htm|jsp|php|js)$ { deny all; } location /{ root /data/www/resources; expires 4d; } } # 增加server upstream apiweb{ server 127.0.0.1:8092; } # 此次是访问web路径 server{ listen 8099; # api访问域名 api.xxx.xxx server_name localhost; #location /pages/ { # alias /data/pages/; #} location / { set $origin '*' ; if ( $http_origin ) { set $origin "$http_origin" ; } if ( $request_method = 'OPTIONS' ) { add_header 'Access-Control-Allow-Origin' "$origin" ; add_header 'Access-Control-Allow-Credentials' "true" ; add_header 'Access-Control-Max-Age' 86400; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' ; add_header 'Access-Control-Allow-Headers' 'Connection,version-secret,access-control-allow-origin,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,access_token' ; ##注意,此处的token 取决于开发,有时候是user-token or doctor-token等。 add_header 'Content-Length' 0; add_header 'Content-Type' 'text/plain, charset=utf-8' ; return 204; } 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 ; proxy_set_header Accept-Encoding 'gzip' ; proxy_pass http: //127.0.0.1:8092; } } include /www/server/panel/vhost/nginx/*.conf; } |
以下是启动服务命令
在opt目录下命令
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
cd mongodb-3.4.0 sh start.sh cd redis-4.0.1 sh start.sh cd spring-boot-imapi sh start cd upload sh start.sh cd tig-push sh start cd message-push sh start.sh cd tigase-server-7.1.3-b4482 sh start cd rocketmq-all-4.3.2-bin-release sh startBroker sh startSrv |
目前仅搭建了web 安卓 其他的苹果 pc 未搭建 测了一下 速度还挺快