|
You last visited: Today at 04:40
Advertisement
Nginx Problem Debian 7
Discussion on Nginx Problem Debian 7 within the Unix/Linux forum part of the Technical Support category.
08/04/2013, 21:09
|
#1
|
elite*gold: 0
Join Date: Apr 2011
Posts: 15
Received Thanks: 0
|
Nginx Problem Debian 7
Guten Tag, ich kämpfe seit paar Std mit Nginx, alle Lösungen die ich im Internet gefunden habe, haben mir nicht weiter geholfen.
Im Error Log steht folgendes:
2013/08/04 14:20:46 [error] 2456#0: *7 connect() failed (111: Connection refused) while connecting to upstream, ....
2013/08/04 14:58:53 [error] 2456#0: *13 connect() failed (111: Connection refused) while connecting to upstream,
...
Wenn ich auf irgendeine Seite von mir gehe kommt immer:
502 Bad Gateway
Meine config
Code:
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;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-ffastream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# 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/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
#fdshuigfhs
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#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;
# }
#}
Ich hoffe mir kann jemand und bin für jede hilfreiche Antwort dankbar.
mfg
|
|
|
08/04/2013, 21:12
|
#2
|
elite*gold: 57
Join Date: Jun 2011
Posts: 2,220
Received Thanks: 865
|
Ich nehme mal an, dass du nichts mit der vHosts Datei angestellt hast?
Poste den Inhalt von "/etc/nginx/sites-enabled/default", dann kann ich dir sagen wieso das nicht läuft.
Außerdem kannst du mal einen Blick in meine Signatur werfen.
Grüße
|
|
|
08/04/2013, 21:17
|
#3
|
elite*gold: 0
Join Date: Apr 2011
Posts: 15
Received Thanks: 0
|
Ja, ist bisschen viel, arbeite ich mich nachher mal durch, schon mal danke für den Tipp und deine Antwort.
Code:
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /var/www/webroot;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name http://localhost/;
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 off;
allow 127.0.0.1;
allow ::1;
deny all;
}
location ~ \.php {
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_pass 127.0.0.1:9000;
}
# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
#location /RequestDenied {
# proxy_pass http://127.0.0.1:8080;
#}
#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 /usr/share/nginx/www;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# root html;
# index index.html index.htm;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
#
# root html;
# index index.html index.htm;
#
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
#
# ssl_session_timeout 5m;
#
# ssl_protocols SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
# ssl_prefer_server_ciphers on;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
|
|
|
08/04/2013, 21:19
|
#4
|
elite*gold: 1
Join Date: May 2011
Posts: 203
Received Thanks: 50
|
Quote:
Originally Posted by SEZonk
Ja, ist bisschen viel, arbeite ich mich nachher mal durch, schon mal danke für den Tipp und deine Antwort.
Code:
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /var/www/webroot;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name http://localhost/;
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 off;
allow 127.0.0.1;
allow ::1;
deny all;
}
location ~ \.php {
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_pass 127.0.0.1:9000;
}
# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
#location /RequestDenied {
# proxy_pass http://127.0.0.1:8080;
#}
#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 /usr/share/nginx/www;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# root html;
# index index.html index.htm;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
#
# root html;
# index index.html index.htm;
#
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
#
# ssl_session_timeout 5m;
#
# ssl_protocols SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
# ssl_prefer_server_ciphers on;
#
# location / {
# try_files $uri $uri/ =404;
# }
[COLOR="Red"]#}[/COLOR]
|
Kann es sein das die letzte "#}" das # zu viel ist ?
|
|
|
08/04/2013, 21:27
|
#5
|
elite*gold: 0
Join Date: Apr 2011
Posts: 15
Received Thanks: 0
|
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# root html;
# index index.html index.htm;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
Eigentlich nicht, weil 2 Klammer sind ja offen, dann müssen auch 2 wieder zu gemacht werden.
mfg
|
|
|
08/04/2013, 21:36
|
#6
|
elite*gold: 57
Join Date: Jun 2011
Posts: 2,220
Received Thanks: 865
|
Du brauchst eigentlich nur den Punkt [#3 LEMP] aus dem Tutorial, je nachdem was du da benötigt.. oder du hälst dich einfach an den nginx Part.
Hast du denn die A-Records korrekt gesetzt? Jedenfalls muss die vHosts Datei bearbeitet werden, sonst wird da auch nichts laufen.
Grüße
|
|
|
08/04/2013, 22:06
|
#7
|
elite*gold: 0
Join Date: Apr 2011
Posts: 15
Received Thanks: 0
|
Habe sie nun bearbeitet, wie soll ich den A-Rekord setzen, habe noch keine Domain, ich wollte erstmal das alle von der IP ausgeht.
Habe es nach dein "TuT" gemacht und der Fehler ist immer noch.
mfg
|
|
|
08/04/2013, 22:12
|
#8
|
elite*gold: 57
Join Date: Jun 2011
Posts: 2,220
Received Thanks: 865
|
Post mir mal die vHosts Datei, läuft nur nginx oder hast du davor Apache2 gehabt? Oder hast du ein minimal Image installiert?
Grüße
|
|
|
08/04/2013, 22:39
|
#9
|
elite*gold: 0
Join Date: Apr 2011
Posts: 15
Received Thanks: 0
|
Appache 2 war schon vorher drauf.
PHP Code:
server {
listen IPzensiert:80 default;
server_name IPzensiert *.IPzensiert;
access_log /var/www/log/access.log combined;
error_log /var/www/log/error.log error;
root /var/www/htdocs/;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ @rewrites;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php5-fpm.socket;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
error_page 404 /index.php;
autoindex off;
## Only allow these request methods ##
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
## Block download agents ##
if ($http_user_agent ~* (libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) ) {
return 403;
}
## Deny certain Referers ##
if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) ) {
return 403;
}
## Directory Protection ##
location ~ /\. {
deny all;
}
## sample ##
#location /zbblock/ {
#deny all;
#return 404;
#}
## RESSOURCES ##
location ~ \.(?:ico|png|jpe?g|css|js)$ {
expires 31d;
add_header Pragma "public";
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location ~ \.(php~|php.bak)$ {
deny all;
return 404;
}
## REWRITES ##
location ~ ^/(\d+)/$ {
return 301 /?p=$1;
}
location @rewrites {
rewrite ^ /index.php last;
}
}
|
|
|
08/04/2013, 22:49
|
#10
|
elite*gold: 57
Join Date: Jun 2011
Posts: 2,220
Received Thanks: 865
|
Dann stört dich Apache noch, du musst es löschen:
Suchen kannst du nach allen Apache2 Paketen wie folgt:
Code:
dpkg -l | grep apache
Anschließend kannst du jedes Paket mit folgendem Befehl löschen:
Code:
aptitude purge PAKETNAME
Lösch einfach alles, was nach apache aussieht. Anschließend kannst du nginx starten:
Code:
service nginx start
Grüße
|
|
|
08/04/2013, 23:18
|
#11
|
elite*gold: 0
Join Date: Apr 2011
Posts: 15
Received Thanks: 0
|
Habe ich gemacht, alles entfernt.
Aber der Fehler trifft immer noch auf.
"502 Bad Gateway"
mfg
|
|
|
08/04/2013, 23:22
|
#12
|
elite*gold: 57
Join Date: Jun 2011
Posts: 2,220
Received Thanks: 865
|
Hast du PHP-FPM installiert? Wenn du die Config von mir 1:1 übernommen hast, brauchst du das..
Bei dir steht nämlich:
fastcgi_pass unix:/var/run/php5-fpm.socket;
Lies dir Punkt #3.3 PHP nochmal genauer durch.
Grüße
|
|
|
08/05/2013, 00:13
|
#13
|
elite*gold: 0
Join Date: Apr 2011
Posts: 15
Received Thanks: 0
|
Ich habe es mir angeguckt, ich müsste jetzt alles gleich haben.
Neugestartet habe ich auch, sehe aber keine Veränderung.
Haben sie vielleicht Teamviewer und können einmal rüber schauen ?.
mfg
|
|
|
 |
Similar Threads
|
[TUTORIAL DEBIAN] NGINX WebServer STACK
07/22/2013 - Metin2 PServer Guides & Strategies - 11 Replies
Ich hab euch mal mein Tutorial aus dem Xertonia kopiert wer möchte kann sich das ganze mal anschauen die Performance ist top im vergleich zu Apache mit einem Debian Server getrennt vom Root sollte das alles also stabil laufen :)
//Englisch-English//
Dear EPVP,
its really important for a good running project, to have a fast operating and stable website, but what to do if you have problems with memory leaks and high CPU usage ?
Maybe you should think what kind of software you´re using...
|
Debian Wheezy Problem
07/16/2013 - Unix/Linux - 5 Replies
Ich habe versucht nginx zu installieren und seit dem ist es mir nicht mehr möglich apt-get zu verwenden um Programme zu installieren, upzudaten etc.
Wenn ich apt-get -f install eingebe passiert folgendes.
root@45144:~# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
libgd2-noxpm
|
[H] Debian vps phpmyadmin problem
08/04/2012 - Web Development - 4 Replies
Hey leute,
ich hab gerade das mega Problem das zu installieren könnte mir da vielleicht jemand helfen -.- ?
Gruß
|
All times are GMT +1. The time now is 04:43.
|
|