买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。3 V& C: V: H4 }8 X4 J
昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:
5 \& u$ m/ ^+ y+ h7 q1 I$ X& {6 x8 q
, p+ E% b0 X2 L! E }8 R # u* @! n" ]- l# n+ O* K3 w
Hi,
& v4 m+ T9 n0 I8 v # D9 j6 Y9 t. \$ _# ?
Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly: 0 H1 H, I* V* _: c6 U* I, V& g3 c
) n2 l4 x, s& w6 {& a: ^3 S9 x8 n- k
Just replace root /home/forge/default/public; with path to the script on your server.2 s* q) B! J- U' S; {4 z
" S% g2 Q) n: }6 h4 X. N" R0 ` server {
1 s% m5 D& R( ?+ A0 R; E listen 80 default_server;4 Y6 i/ E3 j1 q3 ^0 A
server_name default;+ ]" `8 t9 W$ Y: I0 N( o
root /home/forge/default/public;
) k- e, ^ Q+ R, r y l
3 ]& {/ ~0 T( Q" w: e index index.html index.htm index.php;
9 h7 l. S4 Z4 V2 g' N) n/ G
x8 Z8 N1 d7 |/ k charset utf-8;
0 ^) E. ^3 r9 R* |3 ~; b. k$ q
% ^# G5 D% r/ ?: ?; i location / {
3 o7 H% y9 P: y try_files $uri $uri/ /index.php?$query_string;" J ]- q: x: ~7 |
}% Y7 K9 B2 `5 Y: k
$ T, y) }' y( H5 V8 |
location = /favicon.ico { access_log off; log_not_found off; }
9 n, M& [* J% y+ a location = /robots.txt { access_log off; log_not_found off; }
* I0 t9 d# X9 G; Q2 O 0 Q X* z9 G+ s; O% n
access_log off;. B6 b5 ^+ H! x, q
error_log /var/log/nginx/default-error.log error;
- i) F% J- b; v; Y X5 x* p- n' R $ m% l( I9 T5 ^* b3 e U) n* L, K
error_page 404 /index.php;
8 v e/ X! S0 Q5 u; J4 U! L
* p6 p1 C. q; W7 l9 ~, f: {% @) E location ~ \.php$ {
' X1 I1 l2 [$ r6 `# m3 |- @ fastcgi_split_path_info ^(.+\.php)(/.+)$;" f; f% P" I) f) T
fastcgi_pass unix:/var/run/php5-fpm.sock;* h7 U, w/ T" o4 o# ^, W- H
fastcgi_index index.php;
; g7 S ^7 j# n- d( ^* J include fastcgi_params;
6 |% T) f9 B( ^; S4 @ }
3 A7 b5 ]0 ?0 f/ \9 e# F
0 u6 _; ?: p$ w; b( j7 x' j' {6 f location ~ /\.ht {4 s8 h& U, P% P
deny all;
+ S9 m( b1 i% R# Z9 t2 p }
2 Y3 {7 r9 z% @* L0 ^ } 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。
4 D# f4 T( \# b
0 n5 z& F0 d3 g- S. d% J 在线等,谢谢!!!$ ?/ x- n& @' w8 a/ m7 u
相关帖子