这是我第三次尝试发布这个问题后,不正确张贴到超级用户和堆栈溢出。 希望这是现在正确的地方!
我接pipe了公司的networking托pipe服务,这是一个运行亚马逊自己版本的Linux和Nginx的AWS服务器。
我对Nginx没有多less经验,但是我需要创build一个运行网站开发版本的子域。 已经有一个现有的“分段”虚拟主机,但它连接到主站点数据库没有用处。
我已经从/etc/nginx/conf.d/staging.conf中将staging conf文件复制到/etc/nginx/conf.d/dev.conf,并将文件中的所有“staging”实例更改为“dev”。
这是这个文件的样子:
upstream php-dev-backend { server unix:/tmp/php-fpm-dev.sock weight=1; } server { server_name dev.groundlevel.co.uk; listen 80; root /var/www/vhosts/dev.groundlevel.co.uk/web-root; index index.html index.htm index.php; access_log /var/log/nginx/dev.groundlevel.co.uk_access_log; error_log /var/log/nginx/dev.groundlevel.co.uk_error_log; location @handler { rewrite / /index.php; } location / { index index.php index.html; try_files $uri $uri/ @handler; expires 30d; } include magento_security; include fastcgi_params; location ~ \.php$ { if (!-e $request_filename) { rewrite / /index.php last; } include fastcgi_params; fastcgi_pass php-dev-backend; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }
但是,这是导致502错误/tmp/php-fpm-dev.sock不存在,我不知道如何创build它。 或者,如果我可以更改conf文件,不需要套接字。
有人可以请解释如何让套接字运行? 谢谢!
如果您没有运行多个php-fpm,请将您的虚拟主机指向相同的php-fpm套接字。
检查PHP-FPM是否已经以service php-fpm status运行,如果没有启动service php-fpm start (并检查日志文件中是否有可能的错误)。 要在启动时启用PHP-FPM,请运行chkconfig php-fpm on