我設置了nginx php5-fpm在Ubuntu 12.04LTS for wordpress和phpMyAdmin。nginx設置位置錯誤下載
我的phpMyAdmin的座落在/var/www/phpMyAdmin
,在/var/run/mysqld/mysqld.sock
我要地圖/
到WordPress,/phpmyadmin
到phpMyAdmin WordPress的在/home/user/workspace/wordpress
,MySQL的,所以我怎麼能做到這一點?
WordPress的似乎確定,但當訪問/phpmyadmin
,瀏覽器「下載」請求作爲文件...?
這是我目前nginx.conf:
server {
listen 8000;
root /home/user/workspace/wordpress;
index index.html index.htm index.php;\
location ~* /phpmyadmin { #TODO: shall here be a tailing slash??
#TODO: root or alias???
}
location ~ \..*/.*\.php$ {
return 403;
}
location/{
#TODO: show the following line be un-commented??
#try_files $uri $uri/ /index.php?q=$uri&$args;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;#TODO: could this being removed??
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
#FIXME: and how to block all access to /home/user/workspace/wordpress/server.d/*
#This doesn't work??
location /sever\.d {
autoindex on;
deny all;
}
而且,我要兩個目錄wordpress/
和phpMyAdmin/
設置什麼權限,如果所有的服務器都運行爲www-data:www-data
? 目前我將它們設置爲755 user:www-data
,是否正確?
我還沒有在linux下設置服務器,我在WinXP下使用這些服務器,所以我在嘗試。
你
所以我必須爲phpmyadmin安裝另一個cgi處理程序? – user1034937 2013-04-29 15:26:59