AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[phusion-passenger](server)

Martin Hope
Jerome
Asked: 2020-11-02 03:20:56 +0800 CST

拒绝规则没有完全过滤

  • 2

下面的块

    location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
        return 404;
    }

处理en/blog/wp-includes/wlwmanifest.xml不当。目的是处理任何包含 stringwp-includes等的请求。

我希望 nginx 返回 404 错误,而访问是访问应用程序服务器。

语法错误在哪里?

更新 nginx -T 文件的内容

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 130s;
        client_max_body_size 10M;
    types_hash_max_size 2048;
    # server_tokens off;
        ## Block spammers and other unwanted visitors  ##
        include blockips.conf;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

# Security headers
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Frame-Options "SAMEORIGIN";
}

#mail {
#   # See sample authentication script at:
#   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#   # auth_http localhost/auth.php;
#   # pop3_capabilities "TOP" "USER";
#   # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#   server {
#       listen     localhost:110;
#       protocol   pop3;
#       proxy      on;
#   }
#
#   server {
#       listen     localhost:143;
#       protocol   imap;
#       proxy      on;
#   }
#}

# configuration file /etc/nginx/modules-enabled/10-mod-http-ndk.conf:
load_module modules/ndk_http_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-auth-pam.conf:
load_module modules/ngx_http_auth_pam_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-cache-purge.conf:
load_module modules/ngx_http_cache_purge_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-dav-ext.conf:
load_module modules/ngx_http_dav_ext_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-echo.conf:
load_module modules/ngx_http_echo_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-fancyindex.conf:
load_module modules/ngx_http_fancyindex_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-geoip.conf:
load_module modules/ngx_http_geoip_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-headers-more-filter.conf:
load_module modules/ngx_http_headers_more_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-image-filter.conf:
load_module modules/ngx_http_image_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-lua.conf:
load_module modules/ngx_http_lua_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-passenger.conf:
load_module /usr/lib/nginx/modules/ngx_http_passenger_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-perl.conf:
load_module modules/ngx_http_perl_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-subs-filter.conf:
load_module modules/ngx_http_subs_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-uploadprogress.conf:
load_module modules/ngx_http_uploadprogress_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-upstream-fair.conf:
load_module modules/ngx_http_upstream_fair_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-xslt-filter.conf:
load_module modules/ngx_http_xslt_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-mail.conf:
load_module modules/ngx_mail_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-nchan.conf:
load_module modules/ngx_nchan_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-stream.conf:
load_module modules/ngx_stream_module.so;

# configuration file /etc/nginx/blockips.conf:
deny 185.213.20.172;
deny 104.129.18.6;
deny 185.224.91.73;
deny 176.126.83.15;
deny 69.49.102.227;
deny 60.191.38.77;
deny 209.17.96.66;
deny 80.82.77.139;
deny 184.105.247.194;
deny 184.105.247.195;
deny 104.131.133.207;
deny 80.82.77.33;
deny 151.239.67.109;
deny 77.246.234.70;
deny 213.85.3.11;
deny 45.227.253.36;
deny 185.82.216.97;
deny 185.222.211.54;
deny 82.118.242.240;
deny 97.177.247.162;
deny 118.138.101.236;
deny 213.183.146.74;
deny 5.188.211.15;
deny 85.93.20.58;
deny 203.172.211.4;
deny 77.161.231.173;
deny 35.175.132.238;
deny 45.227.255.149;

# configuration file /etc/nginx/mime.types:

types {
    text/html                             html htm shtml;
    text/css                              css;
    text/xml                              xml;
    image/gif                             gif;
    image/jpeg                            jpeg jpg;
    application/javascript                js;
    application/atom+xml                  atom;
    application/rss+xml                   rss;

    text/mathml                           mml;
    text/plain                            txt;
    text/vnd.sun.j2me.app-descriptor      jad;
    text/vnd.wap.wml                      wml;
    text/x-component                      htc;

    image/png                             png;
    image/tiff                            tif tiff;
    image/vnd.wap.wbmp                    wbmp;
    image/x-icon                          ico;
    image/x-jng                           jng;
    image/x-ms-bmp                        bmp;
    image/svg+xml                         svg svgz;
    image/webp                            webp;

    application/font-woff                 woff;
    application/java-archive              jar war ear;
    application/json                      json;
    application/mac-binhex40              hqx;
    application/msword                    doc;
    application/pdf                       pdf;
    application/postscript                ps eps ai;
    application/rtf                       rtf;
    application/vnd.apple.mpegurl         m3u8;
    application/vnd.ms-excel              xls;
    application/vnd.ms-fontobject         eot;
    application/vnd.ms-powerpoint         ppt;
    application/vnd.wap.wmlc              wmlc;
    application/vnd.google-earth.kml+xml  kml;
    application/vnd.google-earth.kmz      kmz;
    application/x-7z-compressed           7z;
    application/x-cocoa                   cco;
    application/x-java-archive-diff       jardiff;
    application/x-java-jnlp-file          jnlp;
    application/x-makeself                run;
    application/x-perl                    pl pm;
    application/x-pilot                   prc pdb;
    application/x-rar-compressed          rar;
    application/x-redhat-package-manager  rpm;
    application/x-sea                     sea;
    application/x-shockwave-flash         swf;
    application/x-stuffit                 sit;
    application/x-tcl                     tcl tk;
    application/x-x509-ca-cert            der pem crt;
    application/x-xpinstall               xpi;
    application/xhtml+xml                 xhtml;
    application/xspf+xml                  xspf;
    application/zip                       zip;

    application/octet-stream              bin exe dll;
    application/octet-stream              deb;
    application/octet-stream              dmg;
    application/octet-stream              iso img;
    application/octet-stream              msi msp msm;

    application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;
    application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;

    audio/midi                            mid midi kar;
    audio/mpeg                            mp3;
    audio/ogg                             ogg;
    audio/x-m4a                           m4a;
    audio/x-realaudio                     ra;

    video/3gpp                            3gpp 3gp;
    video/mp2t                            ts;
    video/mp4                             mp4;
    video/mpeg                            mpeg mpg;
    video/quicktime                       mov;
    video/webm                            webm;
    video/x-flv                           flv;
    video/x-m4v                           m4v;
    video/x-mng                           mng;
    video/x-ms-asf                        asx asf;
    video/x-ms-wmv                        wmv;
    video/x-msvideo                       avi;
}

# configuration file /etc/nginx/conf.d/mod-http-passenger.conf:
### Begin automatically installed Phusion Passenger config snippet ###
passenger_ruby /home/deploy/.rbenv/shims/ruby; # If you use rbenv
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
# passenger_ruby /usr/bin/passenger_free_ruby;
### End automatically installed Phusion Passenger config snippet ###

# configuration file /etc/nginx/sites-enabled/default:
server {

        server_name testing.sportstours.net sportstours.net www.sportstours.net sportstours.me www.sportstours.me iwanttogoto.com www.iwanttogoto.com muse.iwanttogoto.com reflektor.tv www.reflektor.tv;
#        server_name api.sportstours.net www.sportstours.net www.sportstours.me sportstours.me sportstours.net testing.sportstours.net;
        passenger_enabled on;
        rails_env         production;
        root              /home/deploy/v4/current/public;

        error_page 404 /404.html;
          location  /404.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
            return 404;
        }
        location ~ \.php$ {
            return 404;
        }
        location ~ \.aspx$ {
            return 404;
        }
        location ~ \.env$ {
            return 404;
        }
        location ~ \.production$ {
            return 404;
        }
        location ~ \.git$ {
            return 404;
        }
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/reflektor.tv/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/reflektor.tv/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = www.reflektor.tv) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


       listen 80;

        server_name testing.sportstours.net sportstours.net www.sportstours.net sportstours.me www.sportstours.me iwanttogoto.com www.iwanttogoto.com muse.iwanttogoto.com reflektor.tv www.reflektor.tv;
    return 404; # managed by Certbot


}
# configuration file /etc/letsencrypt/options-ssl-nginx.conf:
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.

ssl_session_cache shared:le_nginx_SSL:1m;
ssl_session_timeout 1440m;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;

ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";

# configuration file /etc/nginx/sites-enabled/gdpr:
server {
        # Make site accessible from http://localhost/
        server_name gdpr.reflektor.tv gdpr.sportstours.net gdpr.sportstours.me gdpr.onereededizioni.eu gdpr.perfectcut.glass gdpr.ellci.net;
# gdpr.sipi.it  has dropped off the face of the earth ?
        passenger_enabled on;
        rails_env         development;
        root              /home/deploy/gdpr/current/public;

        # redirect server error pages to the static page /50x.html
        error_page 404 /404.html;
          location  /404.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
            return 404;
        }
        location ~ \.php$ {
            return 404;
        }
        location ~ \.aspx$ {
            return 404;
        }
        location ~ \.env$ {
            return 404;
        }
        location ~ \.production$ {
            return 404;
        }
        location ~ \.git$ {
            return 404;
        }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/gdpr.onereededizioni.eu/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/gdpr.onereededizioni.eu/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = gdpr.sportstours.me) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = gdpr.sportstours.net) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = gdpr.reflektor.tv) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = gdpr.perfectcut.glass) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = gdpr.onereededizioni.eu) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = gdpr.ellci.net) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        server_name gdpr.reflektor.tv gdpr.sportstours.net gdpr.sportstours.me gdpr.onereededizioni.eu gdpr.perfectcut.glass gdpr.ellci.net;
    listen 80;
    return 404; # managed by Certbot

}

# configuration file /etc/nginx/sites-enabled/hf:
server {
        server_name hf.iwanttogoto.com;

       passenger_enabled on;
       rails_env         development;
       root              /home/deploy/hf/current/public;

        error_page 404 /404.html;
          location  /404.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
            return 404;
        }
        location ~ \.php$ {
            return 404;
        }
        location ~ \.aspx$ {
            return 404;
        }
        location ~ \.env$ {
            return 404;
        }
        location ~ \.production$ {
            return 404;
        }
        location ~ \.git$ {
            return 404;
        }

}

# configuration file /etc/nginx/sites-enabled/ialbum:
server {
        # Make site accessible from http://localhost/
        client_max_body_size 20M;
        server_name ialbum.iwanttogoto.com;
        passenger_enabled on;
        rails_env         development;
        root              /home/deploy/fur/current/public;
        # redirect server error pages to the static page /50x.html
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
          root html;
        }
        error_page 404 /404.html;
          location  /404.html {
        }
        location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
            return 404;
        }
        location ~ \.php$ {
            return 404;
        }
        location ~ \.aspx$ {
            return 404;
        }
        location ~ \.env$ {
            return 404;
        }
        location ~ \.production$ {
            return 404;
        }
        location ~ \.git$ {
            return 404;
        }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/ialbum.iwanttogoto.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/ialbum.iwanttogoto.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = ialbum.iwanttogoto.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        server_name ialbum.iwanttogoto.com;
    listen 80;
    return 404; # managed by Certbot


}
# configuration file /etc/nginx/sites-enabled/marchesi:
server {
        # Make site accessible from http://localhost/
        server_name marchesi.reflektor.tv marchesi.iwanttogoto.com;
        passenger_enabled on;
        rails_env         development;
        root              /home/deploy/marchesi/current/public;

        # redirect server error pages to the static page /50x.html
        error_page 404 /404.html;
          location  /404.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
            return 404;
        }
        location ~ \.php$ {
            return 404;
        }
        location ~ \.aspx$ {
            return 404;
        }
        location ~ \.env$ {
            return 404;
        }
        location ~ \.production$ {
            return 404;
        }
        location ~ \.git$ {
            return 404;
        }



    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/marchesi.iwanttogoto.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/marchesi.iwanttogoto.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}
server {
    if ($host = marchesi.iwanttogoto.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = marchesi.reflektor.tv) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        server_name marchesi.reflektor.tv marchesi.iwanttogoto.com;
    listen 80;
    return 404; # managed by Certbot
}

# configuration file /etc/nginx/sites-enabled/mssaccounting:
server {
        # Make site accessible from http://localhost/
        server_name contabilita.sportstours.net;
        passenger_enabled on;
        rails_env         development;
        root              /home/deploy/mssaccounting/current/public;
        # redirect server error pages to the static page /50x.html
        error_page 404 /404.html;
          location  /404.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
            return 404;
        }
        location ~ \.php$ {
            return 404;
        }
        location ~ \.aspx$ {
            return 404;
        }
        location ~ \.env$ {
            return 404;
        }
        location ~ \.production$ {
            return 404;
        }
        location ~ \.git$ {
            return 404;
        }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/contabilita.sportstours.net/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/contabilita.sportstours.net/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = contabilita.sportstours.net) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        server_name contabilita.sportstours.net;
    listen 80;
    return 404; # managed by Certbot


}
# configuration file /etc/nginx/sites-enabled/mssimagelib:
server {
        # Make site accessible from http://localhost/
        server_name mss.outreachit.com;
        passenger_enabled on;
        rails_env         development;
        root              /home/deploy/mssimagelib/current/public;
        # redirect server error pages to the static page /50x.html
        error_page 404 /404.html;
          location  /404.html {
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ /(wp-content|solr|jsonws|mifs|wp-includes|login.asp)/ {
            return 404;
        }
        location ~ \.php$ {
            return 404;
        }
        location ~ \.aspx$ {
            return 404;
        }
        location ~ \.env$ {
            return 404;
        }
        location ~ \.production$ {
            return 404;
        }
        location ~ \.git$ {
            return 404;
        }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mss.outreachit.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mss.outreachit.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = mss.outreachit.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        server_name mss.outreachit.com;
    listen 80;
    return 404; # managed by Certbot


}
# configuration file /etc/nginx/sites-enabled/serverip:
server {
      server_name 46.111.191.173 www.46.111.191.173;
      error_page 404 /404.html;
        location  /404.html {
        internal;
      }
      location ~ / {
          return 404;
      }

}
nginx phusion-passenger
  • 1 个回答
  • 674 Views
Martin Hope
user1130176
Asked: 2020-04-03 11:30:02 +0800 CST

ubuntu 18.04,乘客错误:Phusion 乘客似乎没有运行

  • 0

我们刚刚安装了一个带有乘客的 Ubuntu 18.04 新盒子,一切都运行良好,网站已经启动,但是当我们这样做时

passenger-status

我们得到

ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be:

1. You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again.
2. The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument.

找不到解决此问题的另一个问题,它是全新安装,有什么想法吗?

谢谢,凯文

phusion-passenger apache-2.4
  • 1 个回答
  • 1379 Views
Martin Hope
drosboro
Asked: 2019-01-03 12:31:46 +0800 CST

乘客 6 未能启动 - 无法连接到 TCP 套接字

  • 0

我正在尝试在乘客 6 中使用新的通用语言支持。在开发时,我可以生成我的演示 Go 应用程序,如下所示:

passenger start --app-start-command 'env PORT=$PORT ./main'

一切正常。

在我的服务器(运行 Debian Stretch)上,当我尝试运行完全相同的命令时出现以下错误:

[ E 2019-01-02 20:17:13.7593 7371/Trage/Cor/App/Implementation.cpp:221 ]:无法为应用程序生成进程(...):准备生成一个操作系统时发生错误应用程序进程:无法连接到 TCP 套接字“127.0.0.1:5000”:无法分配请求的地址 (errno=99)

当我将命令运行为root. 但是,我可以直接运行 go 二进制文件(env PORT=5000 ./main)。

netstat -ntulp在尝试启动乘客之前和之后运行显示没有任何运行127.0.0.1:5000。启动乘客后,我的服务器正在监听:::5000. 因此,Passenger 绑定到空的 IPv4 端口似乎存在问题。

我还要提到,我能够在同一台服务器上成功地使用Passenger 启动rails 应用程序。

任何想法从哪里开始寻找?

phusion-passenger
  • 1 个回答
  • 128 Views
Martin Hope
Server Fault
Asked: 2016-09-17 08:07:42 +0800 CST

无法在 Ubuntu 14.04 上更新 Phusion Passenger:gnutls_handshake() 失败:

  • 0

几个月前,我在这里使用 HOWTO 在 Ubunut 14.04 上安装了 Phusion Passenger:https ://www.phusionpassenger.com/library/install/apache/install/oss/trusty/

最近,在更新系统包(apt-get update)时,我注意到下面关于乘客存储库的错误。此时,我必须注释掉这些条目, /etc/apt/sources.list.d/passenger.list以便在我的服务器上安装更新。我搜索了谷歌,似乎只得到了六个结果:(在我看来,Passenger repo 有一些 SSL 问题。有人知道出了什么问题以及如何解决这个问题吗?

Err https://oss-binaries.phusionpassenger.com trusty/main amd64 Packages       
  gnutls_handshake() failed: A TLS packet with unexpected length was received.
Err https://oss-binaries.phusionpassenger.com trusty/main i386 Packages        
  gnutls_handshake() failed: A TLS packet with unexpected length was received.
Ign https://oss-binaries.phusionpassenger.com trusty/main Translation-en       
Fetched 2945 kB in 12s (241 kB/s)                                              
W: Failed to fetch https://oss-binaries.phusionpassenger.com/apt/passenger/dists/trusty/main/binary-amd64/Packages  gnutls_handshake() failed: A TLS packet with unexpected length was received.

W: Failed to fetch https://oss-binaries.phusionpassenger.com/apt/passenger/dists/trusty/main/binary-i386/Packages  gnutls_handshake() failed: A TLS packet with unexpected length was received.

E: Some index files failed to download. They have been ignored, or old ones used instead.
phusion-passenger ubuntu-14.04
  • 2 个回答
  • 728 Views
Martin Hope
YWCA Hello
Asked: 2016-08-18 12:37:00 +0800 CST

为什么我的请求排队时间这么长?

  • 2

我正在运行 Rails 应用程序服务器。我的设置是:

  • Apache 2,对 https 和 ssl 客户端证书使用 mod_ssl
  • Phusion 乘客 5
  • 导轨 4
  • 红宝石 2.1

我使用 NewRelic 来监控正在运行的应用程序。我最近启用了对请求排队延迟的监控,主要是出于好奇。我惊讶地发现请求队列中的延迟通常与实际的 ruby​​ 代码和数据库执行时间一样长或更长。~200 毫秒似乎很高,对吧?

显着的请求队列延迟

大多数在线信息表明,当请求队列正在等待工作人员可用时会发生这种情况,但事实并非如此。如下所示,我们几乎没有使用我们预置的实例。在高峰期,我们很少会超过 30% 的利用率。

工作人员实例的利用

其他一些注意事项:

  • Apache 和Passenger 驻留在同一台服务器上,因此不会出现由于系统时钟不同步而导致的错误计时问题。
  • 关于 SSL 处理,Apache 获取客户端 SSL 证书并将其作为请求头附加。然后,rails 应用程序处理其余的处理。

这里可能是什么问题?

apache-2.2 ruby-on-rails phusion-passenger mod-ssl
  • 1 个回答
  • 1295 Views
Martin Hope
Weirdest
Asked: 2016-04-22 14:21:43 +0800 CST

乘客独立抛出 Nginx 404

  • 0

我有一个脚本,可以在启动时为我的 rails 应用程序启动乘客独立服务器。当我从命令行运行此脚本时,它按预期工作。但是,当它运行时,rc.local它crontab会产生此错误。我在任何日志文件中都找不到任何关于我一生的记录。这是怎么回事,我该如何解决?

一些规格:

Digital Ocean Droplet
Ubuntu 15.10:32bit
Passenger 版本:5.0.27
Rails 版本:4.2.6
Ruby 版本:2.3.0

这又是一个独立的服务器,没有反向代理。我正在使用 iptables 将端口 80 重定向到乘客所在的端口(高于 3000)。

任何帮助将不胜感激!

ubuntu ruby-on-rails nginx phusion-passenger
  • 1 个回答
  • 106 Views
Martin Hope
MZB
Asked: 2015-08-19 13:36:52 +0800 CST

带有Passenger Standalone 的Elastic Beanstalk:工作配置?

  • 4

我正在尝试将弹性豆茎应用程序从 Puma 迁移到 Phusion Passenger。但是,Passenger 在启动时失败并出现以下错误:

  /opt/elasticbeanstalk/support/conf/nginx_config.erb:48:in `block in write_nginx_config_file': undefined local variable or method `location_config_filename' for #<PhusionPassenger::Standalone::StartCommand:0x007f1eb35d06f0> (NameError)
    from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/erb.rb:863:in `eval'
    from /opt/rubies/ruby-2.2.2/lib/ruby/2.2.0/erb.rb:863:in `result'
    from /opt/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/standalone/start_command/nginx_engine.rb:120:in `block in write_nginx_config_file'

亚马逊堆栈名称是:

64bit Amazon Linux 2015.03 v2.0.0 running Ruby 2.2 (Passenger Standalone)

相同的应用程序使用Passenger 在本地和Heroku 上运行。(它也可以与 Puma 一起运行)。

是否有我错过的必需配置文件或配置选项?

(我使用 eb_deployer 进行蓝绿部署,而不是 AWS 控制台 - 所以它可能是某处的默认设置)。

phusion-passenger
  • 1 个回答
  • 1895 Views
Martin Hope
Mojo
Asked: 2014-08-21 15:29:21 +0800 CST

审计表示无事可做,但 puppet 无法在 SELinux 强制下运行

  • 1

我决心让我的 puppet master 运行 SELinux 设置为强制执行。如果我允许它,它运行良好。

我在 RHEL 7 上,使用 systemd、apache2、passenger 4 和 puppet 3。

我已经使用审计日志和audit2allow 完成了几次通过,以制作覆盖审计日志的semodule。(而且这是一团糟,乘客从 apache 模块运行,作为 apache 用户,执行 puppet 主代码。)

这是一个全新的配置,所以 puppet manifest 是一个默认的空节点,什么都不做。

如果我在远程机器上运行“puppet agent -t”,它会以 setenforce 0 成功。审计日志非常空。(audit2allow 报告“无事可做。”)

但是,如果我将 setenforce 设为 1,我会得到这些:

Aug 20 23:14:28 puppet002 puppet-master[1544]: Permission denied - /etc/puppet/auth.conf
Aug 20 23:14:29 puppet002 puppet-master[1544]: Permission denied - /etc/puppet/manifests/site.pp on node agentserver.example.com

我尝试更改 /etc/puppet/* 上的所有权,并且 se 上下文看起来不错:

[root@puppet002 log]# cd /etc/puppet
[root@puppet002 puppet]# ls -lZ
-rw-r--r--. apache apache system_u:object_r:puppet_etc_t:s0 auth.conf
-rw-r--r--. apache apache system_u:object_r:puppet_etc_t:s0 fileserver.conf
drwxr-xr-x. apache apache system_u:object_r:puppet_etc_t:s0 manifests
drwxr-xr-x. apache apache system_u:object_r:puppet_etc_t:s0 modules
-rw-r--r--. apache apache system_u:object_r:puppet_etc_t:s0 puppet.conf

有任何故障排除建议吗?

[编辑]:附加信息,按照关闭“dontaudit”并重复练习的建议,错误消息发生了变化。我的 $ssldir 是 /var/lib/puppet/ssl 而 $logdir 是 /var/log/puppet,这使得这些错误很有趣:

puppet-master [3210]:权限被拒绝 - /etc/puppet/ssl

puppet-master [3210]:(/File[/etc/puppet/ssl]/ensure)从不存在更改为目录失败:无法在确保上设置“目录”:权限被拒绝 - /etc/puppet/ssl

puppet-master [3210]:无法准备执行:初始化时出现 3 次失败:文件 [/etc/puppet/ssl]:从不存在更改为目录失败:无法在确保上设置“目录”:权限被拒绝- /etc/puppet/ssl;文件[/etc/puppet/manifests]:从不存在更改为目录失败:无法在确保上设置“目录”:权限被拒绝 - /etc/puppet/manifests;文件 [/var/lib/puppet/log]:从 0755 更改为 0750 失败:无法在 /var/lib/puppet/log 上设置模式 755:权限被拒绝 - /var/lib/puppet/log

当然,所有作品都在 Permissive 中。:(

phusion-passenger
  • 1 个回答
  • 1062 Views
Martin Hope
Passenger57
Asked: 2014-01-29 10:38:22 +0800 CST

使用 Ruby 2.1.0 安装 Phusion Passenger

  • 2

我正在遵循在 Ubuntu 上安装乘客的指南,但是在运行时

sudo apt-get install libapache2-mod-passenger

它尝试安装 Ruby 1.9.1。我已经有了 Ruby 2.1.0(通过 RVM 安装)。如何让Passenger 使用现有的Ruby 而不是安装新的?

phusion-passenger
  • 1 个回答
  • 1211 Views
Martin Hope
davidhq
Asked: 2013-08-01 13:18:42 +0800 CST

安装 phusion 乘客时的交换空间

  • 4

我尝试安装 Phusion Passenger 并且由于我的可用内存少于 1GB,因此建议使用以下命令临时添加交换空间:

sudo dd if=/dev/zero of=/swap bs=1M count=1024
sudo mkswap /swap
sudo swapon /swap

乘客安装成功,所以我现在必须禁用该交换空间 - 如何?它没有说任何关于恢复的内容,但我认为应该是因为它说“临时添加交换空间”。我现在如何否定这种影响?

phusion-passenger
  • 1 个回答
  • 600 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve