环境:centos7+php+mysql+openresty,目前测试 systemctl status openresty ,systemctl status php-fpm,systemctl status mysql 都 active,正常的状态。
目前:
root 3348 1 0 00:13 ? 00:00:05 php-fpm: master process (/etc/php-fpm.conf) apache 3351 3348 0 00:13 ? 00:00:00 php-fpm: pool www apache 3352 3348 0 00:13 ? 00:00:00 php-fpm: pool www apache 3353 3348 0 00:13 ? 00:00:00 php-fpm: pool www apache 3354 3348 0 00:13 ? 00:00:00 php-fpm: pool www apache 3355 3348 0 00:13 ? 00:00:00 php-fpm: pool www apache 3356 3348 0 00:13 ? 00:00:00 php-fpm: pool www apache 3357 3348 0 00:13 ? 00:00:00 php-fpm: pool www apache 3358 3348 0 00:13 ? 00:00:00 php-fpm: pool www root 18518 18497 0 23:32 pts/1 00:00:00 grep --color=auto php-fpm
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 28071 /var/lib/mysql/mysql.sock
unix 3 [ ] STREAM CONNECTED 11800
unix 3 [ ] STREAM CONNECTED 11801 /run/systemd/journal/stdout
贴出自己的 nginx.conf 和 error.log 粘贴如下:
#user root; worker_processes 1;
#error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;
#pid logs/nginx.pid;
events { worker_connections 1024; }
http { include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
client_max_body_size 8m; #允许客户端请求的最大单文件字节数
client_body_buffer_size 2m; #缓冲区代理缓冲用户端请求的最大字节
gzip on;
#WAF
lua_shared_dict limit 50m;
lua_shared_dict guard_dict 100m;
lua_shared_dict dict_captcha 70m;
lua_package_path "/usr/local/openresty/nginx/conf/waf/?.lua";
init_by_lua_file "/usr/local/openresty/nginx/conf/waf/init.lua";
access_by_lua_file "/usr/local/openresty/nginx/conf/waf/access.lua";
server {
listen 127.0.0.1;
server_name mywebsitedomain.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.php index.html index.htm;
}
#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 html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
/usr/local/openresty/nginx/logs/error.log
2018/06/26 21:27:10 [alert] 740#740: *7927 open socket #10 left in connection 12
2018/06/26 21:27:10 [alert] 740#740: *7926 open socket #3 left in connection 13
2018/06/26 21:27:10 [alert] 740#740: aborting
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.