买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。
1 r4 Y0 e+ t0 k0 P; ]; f 昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:
" R2 u( _. _9 n8 M2 u, R; r% r$ o: a' w / y k8 K' f' u/ T& Z. F3 R
1 J* p4 u4 H" x
Hi,
* }2 H+ |' a7 k1 u9 }6 d ) m; k, s. Y2 v! F9 h1 l
Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly:
9 Z C0 k" L" p# H, w. z 9 t; k" K0 R/ `* _$ L/ }' ~
Just replace root /home/forge/default/public; with path to the script on your server.' x* ]/ o9 K: O& l
- q6 u' Q. K0 L" g
server {
% c7 c; j3 Y+ E/ V* v listen 80 default_server;
! B. Z( A% H8 |" Z4 z/ Q$ ~ server_name default;7 C9 q" g2 i, R# R
root /home/forge/default/public;
) ?# p& n7 i( }; C6 V8 f% ~ ! p# U6 e; H) l, L- [* g$ l
index index.html index.htm index.php;
5 `6 e4 K3 @ V7 n9 ^- n. _, x2 Z
% E) N; D m6 v ]& ]( Q; k charset utf-8;
& o6 U7 K9 C+ Y: e. p! s + h+ k# s6 ~, z# ~+ ]$ x! L6 S
location / {
1 W: G( j' q% ~0 g9 ^# ^ try_files $uri $uri/ /index.php?$query_string;5 Z, w, z4 ?7 |
}
# ?( N& B' I( c% ?
& h/ @1 v l7 f% I9 n location = /favicon.ico { access_log off; log_not_found off; }
+ F# o. }6 P4 H6 i0 h y/ x! Z3 Q location = /robots.txt { access_log off; log_not_found off; } `# u6 `$ S& k$ c" T* w
) _% ^9 B$ I1 z! e9 v
access_log off;
# g9 _. o& k/ j4 i* l/ Q) t8 X error_log /var/log/nginx/default-error.log error;
- l! Z$ R+ Y5 Z- i! e # d$ E& A! P! @- b8 U# F
error_page 404 /index.php;" x" G8 z1 I- Y2 J7 G/ j! u
1 x1 k& V2 d( A8 Z6 v8 r
location ~ \.php$ {7 Y: W8 e' H3 U* L0 \5 K
fastcgi_split_path_info ^(.+\.php)(/.+)$;
" A4 I4 P( R3 s; q) f$ E$ Q& Y) R fastcgi_pass unix:/var/run/php5-fpm.sock;, p% h1 L8 P( p1 ~4 {' Z( ~1 x: _
fastcgi_index index.php;8 I; a2 B4 P9 u( V; w. m, _
include fastcgi_params;/ ~( j' M1 o. X R; C
}: W1 ^( y8 E( @( V; K
' i; P- f+ D5 ~) R! U location ~ /\.ht {
3 B* R, F! c7 g& m/ B) K deny all;
$ K2 o) C, w$ X1 y! ~ }) Y/ @7 w" E8 F) X
} 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。
6 i& Q7 y* }! |: D' r ' {, ]( A8 w, e
在线等,谢谢!!!
- {, p: c `0 K
相关帖子