Mac 本地搭建 问题

技术问题 · penny · 于 3年前 发布 · 1243 次阅读

一直卡在 【Fecmall界面安装】 这一步

nginx.conf 配置文件内容如下:

#user  nobody;
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;

    #gzip  on;
    include /usr/local/etc/nginx/myconf/*.conf;
    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  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  /scripts$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;
        #}
    }

    server {
        listen       80;
        server_name  appfront.fecshoptest.com;
        root  /Users/pengye/fecmall/appfront/web;
        server_tokens off;
        index index.php index.html index.htm;
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            include fcgi.conf;
        }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
            }
        }
        location /fr/ {
            index index.php;
            if (!-e $request_filename){
                rewrite . /fr/index.php last;
            }
        }
        location /cn/ {
            index index.php;
            if (!-e $request_filename){
                rewrite . /cn/index.php last;
            }
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
        }
        location ~ .*\.(js|css)?$ {
            expires      12h;
        }
    }

    server {
        listen     80  ;
        server_name apphtml5.fecshoptest.com;
        root  /Users/pengye/fecmall/apphtml5/web;
        server_tokens off;
        index index.php index.html index.htm;
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            include fcgi.conf;
        }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
            }
        }
        location /fr/ {
            index index.php;
            if (!-e $request_filename){
                rewrite . /fr/index.php last;
            }
        }
        location /cn/ {
            index index.php;
            if (!-e $request_filename){
                rewrite . /cn/index.php last;
            }
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
        }
        location ~ .*\.(js|css)?$ {
            expires      12h;
        }
    }

    server {
        listen     80  ;
        server_name img.fecshoptest.com;
        root  /Users/pengye/fecmall/appimage/common;
        server_tokens off;
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
        }
    }

    server {
        listen     80  ;
        server_name appserver.fecshoptest.com;
        root  /Users/pengye/fecmall/appserver/web;
        server_tokens off;
        index index.php index.html index.htm;
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            include fcgi.conf;
        }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
            }
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
        }
        location ~ .*\.(js|css)?$ {
            expires      12h;
        }  
    }

    server {
        listen     80  ;
        server_name appadmin.fecshoptest.com;
        root  /Users/pengye/fecmall/appadmin/web;
        server_tokens off;
    	index index.php index.html index.htm;
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
            }
        }
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            include ./fcgi.conf;
        }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
        }
        location ~ .*\.(js|css)?$ {
            expires      12h;
        }
    }

    server {
        listen     80  ;
        server_name appapi.fecshoptest.com;
        root  /Users/pengye/fecmall/appapi/web;
        server_tokens off;
        index index.php index.html index.htm;
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            include fcgi.conf;
        }
        location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
            rewrite ^(.*.php)/ $1 last;
        }
        location / {
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
            }
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
        }
        location ~ .*\.(js|css)?$ {
            expires      12h;
        }
    }


# 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;
#    }
#}
    include servers/*;
}

/etc/hosts 内容如下

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
127.0.0.1       www.fecshoptest.com
127.0.0.1       appadmin.fecshoptest.com
127.0.0.1       img.fecshoptest.com
127.0.0.1       m.fecshoptest.com
127.0.0.1       appserver.fecshoptest.com
127.0.0.1       appapi.fecshoptest.com
127.0.0.1       appbdmin.fecshoptest.com
127.0.0.1       appfront.fecshoptest.com

网页打开

localhost

www.fecshoptest.com #appbdmin.fecshoptest.com

m.fecshoptest.com

www.fecshoptest.com

都显示了nginx默认页面

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

其他地址都是502

软件版本如下:

php版本7.4

nginx版本 nginx/1.19.1

mysql 5.7

共收到 5 条回复
Fecmall#13年前 1 个赞

卡在这一步,什么是卡在这一步? 到底是怎么个卡法?

描述问题也是一种能力!

penny#23年前 0 个赞

@Fecmall #1楼 就是在卡在 【Fecmall界面安装】本地打开网页 http://appfront.fecshoptest.com/install 报错502

Fecmall#33年前 0 个赞

@penny #2楼 我看不出来具体的问题,您自己调试看看吧

实在不行,就用 宝塔吧

wangwei#43年前 0 个赞

@penny #2楼 重启一下nginx就好了

penny#53年前 0 个赞

@wangwei #4楼 已经好了,这个mac 的 php-fpm 启动失败的问题,配置文件需要重置下路径

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics