настройка nginx
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
Всем привет. Пробовал настраивать nginx но у меня ничего не получилось помогите пожалуйста.
вот это окно горит всё, хоть убейся. ещё вот такая ошибка есть при перезапуске php5-fpm [FAIL] Restarting PHP5 FastCGI Process Manager: php5-fpm failed!
вот это окно горит всё, хоть убейся. ещё вот такая ошибка есть при перезапуске php5-fpm [FAIL] Restarting PHP5 FastCGI Process Manager: php5-fpm failed!
- Вложения
-
- nginx-192.168.0.121-welcome-to-nginx.png (42.48 КБ) 1866 просмотров
- nginx-192.168.0.121-welcome-to-nginx.png (42.48 КБ) 1866 просмотров
Последний раз редактировалось zanoza73 22.10.2013, 19:42, всего редактировалось 1 раз.
- NiGHt-LEshiY
- Полковник
- Сообщения: 10258
- Зарегистрирован: 13.06.2008
- Откуда: Россия
- Благодарил (а): 752 раза
- Поблагодарили: 2667 раз
- Контактная информация:
Покажи nginx.conf
Кодекс поведения участников сообщества — обязательно к прочтению.
Просьба присылать сообщения об ошибках в ЛС.
Просьба присылать сообщения об ошибках в ЛС.
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
user www-data;NiGHt-LEshiY писал(а):Покажи nginx.conf
worker_processes 2;
pid /run/nginx.pid;
events {
worker_connections 1024;
# 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-stream;
##
# 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;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateW ... ePhpScript
#
# # 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;
# }
#}
- NiGHt-LEshiY
- Полковник
- Сообщения: 10258
- Зарегистрирован: 13.06.2008
- Откуда: Россия
- Благодарил (а): 752 раза
- Поблагодарили: 2667 раз
- Контактная информация:
Покажи тогда файлы из этой папки. Там должно быть по файлу на сайт, допустим.include /etc/nginx/sites-enabled/*;
Кодекс поведения участников сообщества — обязательно к прочтению.
Просьба присылать сообщения об ошибках в ЛС.
Просьба присылать сообщения об ошибках в ЛС.
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
тут только default.NiGHt-LEshiY писал(а):Покажи тогда файлы из этой папки. Там должно быть по файлу на сайт, допустим.include /etc/nginx/sites-enabled/*;
# 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 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name 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
}
# 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/html;
#}
# 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;
# }
#}
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
делал по этому мануалу http://habrahabr.ru/post/164401/Dev писал(а):кроме apt-get install nginx, ты еще что-то делал?:)
- IIIypuk
- Сержант
- Сообщения: 38
- Зарегистрирован: 05.01.2013
- Откуда: Russia
- Благодарил (а): 5 раз
- Поблагодарили: 8 раз
- Контактная информация:
Попробуй перезапусти php-fpm.
Если FAIL, показывай логи php-fpm.
Лежат где-то в
Если FAIL, показывай логи php-fpm.
Лежат где-то в
Код: Выделить всё
/var/log/
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
[22-Oct-2013 14:25:19] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successfulIIIypuk писал(а):Попробуй перезапусти php-fpm.
Если FAIL, показывай логи php-fpm.
Лежат где-то вКод: Выделить всё
/var/log/
[22-Oct-2013 14:25:19] NOTICE: fpm is running, pid 5051
[22-Oct-2013 14:25:19] NOTICE: ready to handle connections
[22-Oct-2013 14:33:27] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
[22-Oct-2013 14:33:27] NOTICE: Finishing ...
[22-Oct-2013 14:33:27] NOTICE: exiting, bye-bye!
[22-Oct-2013 14:33:27] NOTICE: fpm is running, pid 9179
[22-Oct-2013 14:33:27] NOTICE: ready to handle connections
[22-Oct-2013 14:33:56] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
[22-Oct-2013 14:33:56] NOTICE: Finishing ...
[22-Oct-2013 14:33:56] NOTICE: exiting, bye-bye!
[22-Oct-2013 14:33:56] NOTICE: fpm is running, pid 10672
[22-Oct-2013 14:33:56] NOTICE: ready to handle connections
[22-Oct-2013 14:34:15] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
[22-Oct-2013 14:57:54] NOTICE: Finishing ...
[22-Oct-2013 14:57:54] NOTICE: exiting, bye-bye!
[22-Oct-2013 14:58:39] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
[22-Oct-2013 14:58:39] NOTICE: fpm is running, pid 3611
[22-Oct-2013 14:58:39] NOTICE: ready to handle connections
[22-Oct-2013 15:02:47] NOTICE: Finishing ...
[22-Oct-2013 15:02:47] NOTICE: exiting, bye-bye!
[22-Oct-2013 15:03:35] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 15:03:35] ERROR: failed to post process the configuration
[22-Oct-2013 15:03:35] ERROR: FPM initialization failed
[22-Oct-2013 16:52:52] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 16:52:52] ERROR: failed to post process the configuration
[22-Oct-2013 16:52:52] ERROR: FPM initialization failed
[22-Oct-2013 17:15:34] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:15:34] ERROR: failed to post process the configuration
[22-Oct-2013 17:15:34] ERROR: FPM initialization failed
[22-Oct-2013 17:15:45] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:15:45] ERROR: failed to post process the configuration
[22-Oct-2013 17:15:45] ERROR: FPM initialization failed
[22-Oct-2013 17:38:14] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:38:14] ERROR: failed to post process the configuration
[22-Oct-2013 17:38:14] ERROR: FPM initialization failed
[22-Oct-2013 17:38:14] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:38:14] ERROR: failed to post process the configuration
[22-Oct-2013 17:38:14] ERROR: FPM initialization failed
[22-Oct-2013 17:38:23] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:38:23] ERROR: failed to post process the configuration
[22-Oct-2013 17:38:23] ERROR: FPM initialization failed
[22-Oct-2013 17:38:23] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:38:23] ERROR: failed to post process the configuration
[22-Oct-2013 17:38:23] ERROR: FPM initialization failed
[22-Oct-2013 17:56:05] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:56:05] ERROR: failed to post process the configuration
[22-Oct-2013 17:56:05] ERROR: FPM initialization failed
[22-Oct-2013 17:56:05] ALERT: [pool www] no listen address have been defined!
[22-Oct-2013 17:56:05] ERROR: failed to post process the configuration
[22-Oct-2013 17:56:05] ERROR: FPM initialization failed
[22-Окт-2013 17:56:09] ALERT: [pool www] no listen address have been defined!
[22-Окт-2013 17:56:09] ERROR: failed to post process the configuration
[22-Окт-2013 17:56:09] ERROR: FPM initialization failed
[22-Окт-2013 17:56:09] ALERT: [pool www] no listen address have been defined!
[22-Окт-2013 17:56:09] ERROR: failed to post process the configuration
[22-Окт-2013 17:56:09] ERROR: FPM initialization failed
[22-Окт-2013 19:42:34] ALERT: [pool www] no listen address have been defined!
[22-Окт-2013 19:42:34] ERROR: failed to post process the configuration
[22-Окт-2013 19:42:34] ERROR: FPM initialization failed
[22-Окт-2013 22:22:42] ALERT: [pool www] no listen address have been defined!
[22-Окт-2013 22:22:42] ERROR: failed to post process the configuration
[22-Окт-2013 22:22:42] ERROR: FPM initialization failed
[23-Oct-2013 08:09:24] ALERT: [pool www] no listen address have been defined!
[23-Oct-2013 08:09:24] ERROR: failed to post process the configuration
[23-Oct-2013 08:09:24] ERROR: FPM initialization failed
- IIIypuk
- Сержант
- Сообщения: 38
- Зарегистрирован: 05.01.2013
- Откуда: Russia
- Благодарил (а): 5 раз
- Поблагодарили: 8 раз
- Контактная информация:
Создай файл такого содержимого
и положи его в /etc/nginx/sites-enabled/ под любым именем.
В папке /srv/http/test/ создай файл index.php
И попробуй в браузере открыть localhost.
Nginx у тебя работает, но работает ли php-fpm я из логов не совсем понимаю :)
Код: Выделить всё
server {
listen 80;
server_name localhost;
charset utf-8;
include ssl.conf;
keepalive_timeout 70;
root /srv/http/test/;
location / {
index index.html;
}
location ~ \.php$ {
include fastcgi.conf;
try_files $uri = 404;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
}
#error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
В папке /srv/http/test/ создай файл index.php
Код: Выделить всё
<?php phpinfo(); ?>
Nginx у тебя работает, но работает ли php-fpm я из логов не совсем понимаю :)
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
ничего не изменилось.IIIypuk писал(а):Создай файл такого содержимогои положи его в /etc/nginx/sites-enabled/ под любым именем.Код: Выделить всё
server { listen 80; server_name localhost; charset utf-8; include ssl.conf; keepalive_timeout 70; root /srv/http/test/; location / { index index.html; } location ~ \.php$ { include fastcgi.conf; try_files $uri = 404; fastcgi_pass unix:/run/php-fpm/php-fpm.sock; fastcgi_index index.php; } #error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
В папке /srv/http/test/ создай файл index.phpИ попробуй в браузере открыть localhost.Код: Выделить всё
<?php phpinfo(); ?>
Nginx у тебя работает, но работает ли php-fpm я из логов не совсем понимаю :)
Добавлено спустя 2 часа 58 минут 24 секунды:
php-fpm вроде как не работает, т.к когда я ввожу /etc/init.d/php5-fpm stop , то ничего не происходит.IIIypuk писал(а):Создай файл такого содержимогои положи его в /etc/nginx/sites-enabled/ под любым именем.Код: Выделить всё
server { listen 80; server_name localhost; charset utf-8; include ssl.conf; keepalive_timeout 70; root /srv/http/test/; location / { index index.html; } location ~ \.php$ { include fastcgi.conf; try_files $uri = 404; fastcgi_pass unix:/run/php-fpm/php-fpm.sock; fastcgi_index index.php; } #error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }
В папке /srv/http/test/ создай файл index.phpИ попробуй в браузере открыть localhost.Код: Выделить всё
<?php phpinfo(); ?>
Nginx у тебя работает, но работает ли php-fpm я из логов не совсем понимаю :)
-
- Капитан
- Сообщения: 255
- Зарегистрирован: 27.07.2010
- Благодарил (а): 1 раз
- Поблагодарили: 28 раз
- Контактная информация:
а оно тебе нужно вообще?
Поставь Isp lite на 2 недели бесплатно,настрой что надо если руками не получается и всё,дальше уже можно спокойно по примерам делать вручную.
Поставь Isp lite на 2 недели бесплатно,настрой что надо если руками не получается и всё,дальше уже можно спокойно по примерам делать вручную.
VDS хостинг от 1.5$. Защита от DDOS. Частота CPU от 3.5 МГЦ
Идеальное предложение для игрового сервера. Хостинг VDS
Идеальное предложение для игрового сервера. Хостинг VDS
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
нужно просто настроить не получается(((Non_Stop писал(а):а оно тебе нужно вообще?
Поставь Isp lite на 2 недели бесплатно,настрой что надо если руками не получается и всё,дальше уже можно спокойно по примерам делать вручную.
а сайт, сб и стату и т.д. я на твой Isp lite ставить?
- zanoza73
- Капитан
- Сообщения: 299
- Зарегистрирован: 02.09.2011
- Откуда: Россия, Выборг
- Поблагодарили: 34 раза
вроде всё есть. только ничего не работаетbir3yk писал(а):в /etc/php5/fpm/pool.d/www.conf
смотрите значение listen
2 варианта:
1)
nginx(default или свой какой то)
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
php-fpm(http://www.conf)
тогда listen = /var/run/php-fpm/php-fpm.sock;
2)
nginx
fastcgi_pass 127.0.0.1:9000;
php-fpm
тогда listen = 127.0.0.1:9000;