nginx + phpmyadmin |
Здравствуйте, гость Вход | Регистрация
Наши новости:
|
|
|
nginx + phpmyadmin |
3aB}{o3
|
23.10.2012, 4:42
Сообщение
|
![]() |
Centos 5.5 nginx/0.8.55
Ребят, помогите настроить nginx.conf так чтобы заработал phpmyadmin, сам phpmyadmin находится /usr/share/phpMyAdmin nginx.conf ####################################################################### # # This is the main Nginx configuration file. # # More information about the configuration options is available on # * the English wiki - http://wiki.nginx.org/Main # * the Russian documentation - http://sysoev.ru/nginx/ # ####################################################################### #---------------------------------------------------------------------- # Main Module - directives that cover basic functionality # # http://wiki.nginx.org/NginxHttpMainModule # #---------------------------------------------------------------------- user nginx; worker_processes 1; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; pid /var/run/nginx.pid; #---------------------------------------------------------------------- # Events Module # # http://wiki.nginx.org/NginxHttpEventsModule # #---------------------------------------------------------------------- events { worker_connections 1024; } #---------------------------------------------------------------------- # HTTP Core Module # # http://wiki.nginx.org/NginxHttpCoreModule # #---------------------------------------------------------------------- http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; # # The default server # server { listen 80; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/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; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } } |
|
|
|
Isset
|
23.10.2012, 5:25
Сообщение
|
![]() |
Можно просто сделать симлинк: ln -s /usr/share/phpMyAdmin /путь/до/www/myadmin42
http://ip/myadmin42 |
Поблагодарили 1 раз
|
|
330863
|
23.10.2012, 5:43
Сообщение
|
![]() |
3aB}{o3,
как подключаешь обычный сайт на пхп также и подключаешь пхпмойадмин! |
|
|
|
3aB}{o3
|
23.10.2012, 7:22
Сообщение
|
![]() |
Я так и думал что меня не поймут, я не могу правильно отредактировать nginx.conf, для работы phpmyadmin.
Отредактировал: 3aB}{o3, - 23.10.2012, 7:23
|
|
|
|
jesuspunk
|
23.10.2012, 7:47
Сообщение
|
![]() |
3aB}{o3,
вроде : конфиг server { listen 80; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/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; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } } пишется тут: /etc/nginx/sites-available/default у тебя код пхп выводится как текст или предлагается скачать? ты про это?
Отредактировал: jesuspunk, - 23.10.2012, 7:48
|
|
|
|
3aB}{o3
|
23.10.2012, 13:14
Сообщение
|
![]() |
3aB}{o3, нет php у меня нормально обрабатывается, у меня просто phpmyadmin не открывает а не открывает он его потому как нужно настроить nginx.conf, указать локейшен и всякую приблуду. Знал бы что так все сложно, поставил бы Apache и не парился бывроде : конфиг server { listen 80; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/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; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } } пишется тут: /etc/nginx/sites-available/default у тебя код пхп выводится как текст или предлагается скачать? ты про это? 3aB}{o3, вот ты правильно говоришь, я вот только не знаю как правильно этот локейшен написать, всю ночь редактировал этот nginx.conf и не фига, после рестарта nginx он мне говорит что ошибка в конфиге и ругается на строку
А может, просто скрипты переместить/скопировать ..? :) Можно также добавить несколько локейшнов (в данном случае - придется добавить два), либо в существующие два небольшую проверку для подстановки нужного document_root
Отредактировал: 3aB}{o3, - 23.10.2012, 13:09
|
|
|
|
3aB}{o3
|
23.10.2012, 14:19
Сообщение
|
![]() |
Можно просто сделать симлинк: ln -s /usr/share/phpMyAdmin /путь/до/www/myadmin42 http://ip/myadmin42 ln -s /usr/share/phpMyAdmin /usr/share/nginx/html/phpmyadmin при попытки зайти, пишет: 403 Forbidden 3aB}{o3, ну я так и думал в принципе =)
как подключаешь обычный сайт на пхп также и подключаешь пхпмойадмин! |
|
|
|
330863
|
23.10.2012, 15:08
Сообщение
|
![]() |
3aB}{o3,
скопировать сложно угу |
|
|
|
f1nik
|
23.10.2012, 15:40
Сообщение
|
![]() ![]() |
|
|
|
|
330863
|
23.10.2012, 16:28
Сообщение
|
![]() |
3aB}{o3,
я понимаю тебе же нужно ставить 100 копий phpmyadmin |
|
|
|
Isset
|
23.10.2012, 16:38
Сообщение
|
![]() |
3aB}{o3
chown -R root:root /usr/share/phpMyAdmin chmod 755 /usr/share/phpMyAdmin Обрати внимание что chmod без -R |
|
|
|
3aB}{o3
|
23.10.2012, 16:45
Сообщение
|
![]() |
|
|
|
|
Isset
|
23.10.2012, 16:48
Сообщение
|
![]() |
3aB}{o3
Пропиши в конфиг nginx.conf после server_name _; index index.php; |
|
|
|
3aB}{o3
|
23.10.2012, 16:54
Сообщение
|
![]() |
|
|
|
|
330863
|
23.10.2012, 18:55
Сообщение
|
![]() |
3aB}{o3,
может покажешь конфиг без коментариев? |
|
|
|
3aB}{o3
|
23.10.2012, 19:33
Сообщение
|
![]() |
|
|
|
|
Isset
|
23.10.2012, 20:14
Сообщение
|
![]() |
Про логи что то совсем забыли.
3aB}{o3 Покажи логи nginx |
|
|
|
![]() ![]() |