买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。
& r" Q/ b* e9 z1 I& \ 昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:+ x1 H( e+ f/ K& \7 \ s
7 S% ^' [' |+ d- p" C0 I. c1 T
) X- I! B: @+ u% i' w- q% v
Hi,$ \4 ^4 J! y' E
Z5 X1 _$ |4 h! N D Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly:
" J0 w! _8 ^0 d8 _/ g/ Y1 V# G$ \9 N 9 D9 c: U( [2 ~# s
Just replace root /home/forge/default/public; with path to the script on your server.
8 Y: {) @4 }& ?! K. K, Z + V# k7 J. ^8 @, t' Z! c
server {" |8 _, ~2 N6 U# H& b4 x3 w, \
listen 80 default_server;
" E- V; {) g8 T. [ server_name default;0 M7 r% j3 U( y- g' c4 f: d! J
root /home/forge/default/public;
3 D; K2 I* @. y8 a$ Z 3 t) R, G$ J' s" W. r5 ]- W, n
index index.html index.htm index.php;$ [6 `; f4 k- T# E+ H
( N8 Z4 z+ x- b. U! }; X: ]
charset utf-8;& V9 @) f: f' [- W% p; l' L$ G
" b S+ U) C+ w5 l& h$ ~
location / {9 Y O. F7 _ s# H" r
try_files $uri $uri/ /index.php?$query_string;
" }# J* [/ A+ V4 \1 \$ y$ ? }
1 F6 Q' F8 G8 q% Y$ n, z) s# [, D / {" w2 S9 n4 N9 f
location = /favicon.ico { access_log off; log_not_found off; }+ |0 C1 I4 H, J- I7 k: J7 c
location = /robots.txt { access_log off; log_not_found off; }
5 Q" H* R. y. Y # a& p# Q. u- J, b' |7 }9 l* b
access_log off;
% [. \' v ^6 `" X# k error_log /var/log/nginx/default-error.log error;
0 h/ i) B! o! ]% V" R
$ B0 Y9 p/ [* b9 A9 A error_page 404 /index.php;8 s$ V* J% j% }1 E% y
5 @; o- o8 H0 x4 U% y location ~ \.php$ {
6 M. \8 B# Z8 u, O9 I fastcgi_split_path_info ^(.+\.php)(/.+)$;
3 `. c! P+ y/ z# r' c) [+ k9 i1 Z fastcgi_pass unix:/var/run/php5-fpm.sock;4 e9 [- d. M! j7 R
fastcgi_index index.php;% M C/ \$ _( R. d+ T7 {
include fastcgi_params;
0 k+ g8 Z1 T! `& c" j) E7 w$ D }; p- q4 L+ d* q+ S* x
8 x# i- g5 ]+ h% l0 _ location ~ /\.ht {
+ [; O4 x( B+ d! s deny all;
b) H' {2 k6 i; b; V2 O+ q: O }1 Z/ N# [ B5 c; _' r6 b
} 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。
, ?% P) B8 \ L) C4 o " x. [ @3 v9 }5 e& p; ^6 }
在线等,谢谢!!!
* x" B$ ~7 b# {$ L, e
相关帖子