我真的不知道從哪裡開始尋找答案:我按照說明進行操作這裡為 Debian 設定 nginx 和乘客。 ( sudo apt-get nginx-extras passenger
) 一切正常。然後我嘗試設定 ssl:
- 創建了伺服器金鑰等
- 複製 /etc/nginx/sites-available/default 並取消註解並編輯必要的行
- 在 /etc/nginx/sites-enable 中創建了符號鏈接
- 重新啟動 nginx
突然我無法再透過 Firefox 連線到伺服器。所以我撤消了上述所有步驟 - 什麼也沒做。我卸載了 nginx-extras 和乘客,並手動刪除了名為“*nginx*”的每個檔案和目錄,因為我看到整個 /etc/nginx/ 目錄仍然存在。然後我又安裝了所有東西——仍然沒有。
即使我認為它已完全刪除,ps waux | grep nginx
但還是產生了以下結果:
USERNAME 3776 0.0 0.1 11292 928 pts/0 S+ 22:15 0:00 grep nginx
有任何想法嗎?
nginx.conf:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Phusion Passenger config
##
# Uncomment it if you installed passenger or passenger-enterprise
##
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
預設
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/www;
index index.html index.htm;
# Make site accessible from http://localhost/
#server_name localhost;
server_name MYSERVERNAME.COM;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
}
}
錯誤日誌
2013/12/18 21:26:11 [info] 4051#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
[ 2013-12-18 21:26:11.5154 4052/7f52e36b2720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '4051', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 21:26:11.5256 4055/7f9d793ff720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4051/generation-0/request
[ 2013-12-18 21:26:11.5422 4060/7f356bd97740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4051/generation-0/logging
[ 2013-12-18 21:26:11.5425 4052/7f52e36b2720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
[ 2013-12-18 21:26:12.6104 4085/7fd382f9e720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '4084', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 21:26:12.6212 4088/7f366efae720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4084/generation-0/request
[ 2013-12-18 21:26:12.6372 4093/7fe9334f6740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4084/generation-0/logging
[ 2013-12-18 21:26:12.6376 4085/7fd382f9e720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
2013/12/18 21:29:14 [info] 4342#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
2013/12/18 21:43:58 [info] 3268#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
[ 2013-12-18 21:43:58.9454 3269/7ffca390a720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '3268', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 21:43:58.9565 3272/7ff05712f720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.3268/generation-0/request
[ 2013-12-18 21:43:59.0637 3277/7fd1a6566740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.3268/generation-0/logging
[ 2013-12-18 21:43:59.0641 3269/7ffca390a720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
[ 2013-12-18 21:44:00.1272 3302/7f36e741a720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '3301', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 21:44:00.1371 3305/7f39a4c0a720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.3301/generation-0/request
[ 2013-12-18 21:44:00.1516 3310/7f77ac1f2740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.3301/generation-0/logging
[ 2013-12-18 21:44:00.1519 3302/7f36e741a720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
2013/12/18 22:33:42 [info] 4446#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
[ 2013-12-18 22:33:42.5973 4447/7f9322eec720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '4446', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 22:33:42.6076 4450/7f4b5421a720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4446/generation-0/request
[ 2013-12-18 22:33:42.6231 4455/7f66ad0d7740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4446/generation-0/logging
[ 2013-12-18 22:33:42.6235 4447/7f9322eec720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
[ 2013-12-18 22:33:42.6937 4478/7f2efc258720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '4469', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 22:33:42.7052 4481/7f22f972e720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4469/generation-0/request
[ 2013-12-18 22:33:42.7225 4486/7f115cf78740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4469/generation-0/logging
[ 2013-12-18 22:33:42.7229 4478/7f2efc258720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
2013/12/18 22:55:00 [info] 4571#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
[ 2013-12-18 22:55:00.2297 4572/7fd2593b7720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '4571', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 22:55:00.2402 4575/7fc908843720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4571/generation-0/request
[ 2013-12-18 22:55:00.2552 4580/7fc3a8488740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4571/generation-0/logging
[ 2013-12-18 22:55:00.2556 4572/7fd2593b7720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
[ 2013-12-18 22:55:01.3489 4607/7fdb92fa0720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '4606', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 22:55:01.3590 4610/7fd6ff47d720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4606/generation-0/request
[ 2013-12-18 22:55:01.3746 4615/7f6beae3b740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4606/generation-0/logging
[ 2013-12-18 22:55:01.3750 4607/7fdb92fa0720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
2013/12/18 23:03:27 [info] 4735#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
[ 2013-12-18 23:03:27.9453 4736/7fb2f8b7b720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '4735', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 23:03:27.9556 4739/7f8d97b36720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.4735/generation-0/request
[ 2013-12-18 23:03:27.9710 4744/7fb89953a740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.4735/generation-0/logging
[ 2013-12-18 23:03:27.9714 4736/7fb2f8b7b720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
2013/12/18 23:36:45 [info] 5207#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
[ 2013-12-18 23:36:45.0369 5208/7f9b67fc1720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '5207', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 23:36:45.0474 5211/7fc05a851720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.5207/generation-0/request
[ 2013-12-18 23:36:45.0637 5216/7ffc716ae740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.5207/generation-0/logging
[ 2013-12-18 23:36:45.0641 5208/7f9b67fc1720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
[ 2013-12-18 23:36:46.1591 5243/7f29a6ba9720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '5242', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 23:36:46.1697 5246/7f91dc2c2720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.5242/generation-0/request
[ 2013-12-18 23:36:46.1861 5251/7f49ec0d4740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.5242/generation-0/logging
[ 2013-12-18 23:36:46.1865 5243/7f29a6ba9720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
2013/12/18 23:55:06 [info] 5645#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:73
[ 2013-12-18 23:55:06.5135 5646/7f89b653f720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '5645', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 23:55:06.5237 5649/7f25f91cc720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.5645/generation-0/request
[ 2013-12-18 23:55:06.5386 5654/7f470908c740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.5645/generation-0/logging
[ 2013-12-18 23:55:06.5390 5646/7f89b653f720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
[ 2013-12-18 23:55:07.6364 5681/7f482aa8a720 agents/Watchdog/Main.cpp:510 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.29', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.29', 'web_server_pid' => '5680', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-12-18 23:55:07.6472 5684/7fdd6c28b720 agents/HelperAgent/Main.cpp:625 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.5680/generation-0/request
[ 2013-12-18 23:55:07.6631 5689/7f5d80851740 agents/LoggingAgent/Main.cpp:318 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.5680/generation-0/logging
[ 2013-12-18 23:55:07.6634 5681/7f482aa8a720 agents/Watchdog/Main.cpp:697 ]: All Phusion Passenger agents started!
答案1
我卸載了 nginx-extras 和乘客,並手動刪除了名為“nginx”的每個檔案和目錄,因為我看到整個 /etc/nginx/ 目錄仍然存在。
這是預期的(也是可取的)。套件管理器不會刪除 /etc 中的設定檔。
即使我認為它已完全刪除 ps waux | grep nginx 產生了這個: USERNAME 3776 0.0 0.1 11292 928 pts/0 S+ 22:15 0:00 grep nginx
正確的。該 grep 正在進程清單中偵測 grep 命令本身,因為它包含「nginx」。我沒有看到任何表明 nginx 正在運行的內容。
建議:
- 重新安裝 nginx-extras 和乘客,重新執行您刪除的 /etc/nginx 中的設定。
- 運行
sudo service nginx status
以確保它仍在運行。如果不: - 運行
sudo service nginx start
或sudo service nginx restart
並發布它報告回來的任何錯誤訊息。
請隨您的問題發布(已清理的)設定檔的內容。了解已完成哪些配置很有幫助,因為我預計您的問題將在這些配置中得到解決。