开发者社区 问答 正文

一键安装WEB环境多次都出现故障

我使用的阿里云服务器为:ubuntu 16.04,64位服务器,在百度搜索了好几个SH版本,无非sh-1.4.1和sh-1.5.5,但无论哪个版本,安装的结果都如下:

---------- make dir ok ----------
---------- env ok ----------
---------- mysql-5.6.21 ok ----------
---------- nginx-1.4.4 ok ----------
---------- php-5.5.7 ok ----------
---------- php extension ok ----------
---------- vsftpd-3.0.3  ok ----------
---------- phpwind-8.7 ok ----------
---------- phpmyadmin-4.1.8 ok ----------
---------- web init ok ----------
---------- rc init ok ----------
---------- mysql init ok ----------
按以上信息来看,应该能正常使用了吧,而实际却并非如此,我通过“netstat -tunpl”命令却并未发现运行所需的“php”程序,即商品为9000的php程序。为此,当我通过http链接时无法运行php站点,只会提示“502 Bad Gateway”,我上传了一个txt文件至服务器却能通过http链接打开。我初步分析是PHP程序没有正确安装,但不知道具体问题出在哪里。求大师指教。谢谢。

展开
收起
潇湘时代 2017-05-02 23:37:07 2964 分享 版权
2 条回答
写回答
取消 提交回答
  • 回 1楼jesuiszb的帖子
    您说的是nginx.conf吧,这个文件内容如下,还请帮忙看看:
    user  www www;
    worker_processes  2;

    error_log  /alidata/log/nginx/error.log crit;
    pid        /alidata/server/nginx/logs/nginx.pid;

    #Specifies the value for maximum file descriptors that can be opened by this process.
    worker_rlimit_nofile 65535;

    events
    {
      use epoll;
      worker_connections 65535;
    }


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

        #charset  gb2312;

        server_names_hash_bucket_size 128;
        client_header_buffer_size 32k;
        large_client_header_buffers 4 32k;
        client_max_body_size 8m;

        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 128k;

        gzip on;
        gzip_min_length  1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.0;
        gzip_comp_level 2;
        gzip_types       text/plain application/x-javascript text/css application/xml;
        gzip_vary on;
        #limit_zone  crawler  $binary_remote_addr  10m;
        log_format '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
        include /alidata/server/nginx/conf/vhosts/*.conf;
    }
    我在我的服务器,无论如何也找不着php.ini等php相关核心文件。

    -------------------------

    回 3楼jesuiszb的帖子
    你好,我已经找过,并没有发现该文件夹及其文件。
    我使用一键安装(sh-1.5.5)完毕后,默认nginx,php,mysql等都位于/alidata/server/下。
    经过netstat -tunpl,发现mysql和php都没有运行,命令结果如下:
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      21827/nginx.conf
    tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      21850/vsftpd    
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1128/sshd      
    udp        0      0 0.0.0.0:68              0.0.0.0:*                           639/dhclient    
    udp        0      0 172.19.153.165:123      0.0.0.0:*                           729/ntpd        
    udp        0      0 127.0.0.1:123           0.0.0.0:*                           729/ntpd        
    udp        0      0 0.0.0.0:123             0.0.0.0:*                           729/ntpd        
    udp6       0      0 :::123                  :::*                                729/ntpd        
    我的php文件夹下只有如下文件夹一个,根目录下再无其他文件。

    -------------------------

    回 5楼jesuiszb的帖子
    有,nginx正常,因为可以通过链接访问服务器下的txt文件。
    用service php start无法启动,提示如下:
    Failed to start php.service: Unit php.service not found.
    2017-05-03 07:48:24
    赞同 展开评论
  • 看看nginx.ini里有没有吧PHP打开?

    -------------------------

    不是这个,把你ETC/NGINX/SITE-AVAIABLE/DEFAULT贴出来

    -------------------------

    那你的alidata/server下有nginx目录吗,用service php start可以一启动吗

    -------------------------

    那你的ETC目录下有PHP吗,单独重新安装一下PHP?

    2017-05-03 01:55:46
    赞同 展开评论