VPS侦探论坛

 找回密码
 注册
查看: 15991|回复: 5

连接Phpmyadmin就显示404 not found

[复制链接]
发表于 2015-2-19 12:19:58 | 显示全部楼层 |阅读模式

ip/phpmyadmin 就404, 我看过了, phpmyadmin 是在/home/wwwroot/default/,其他在/home/wwwroot/default/下的都可以用IP来访问,比如p.php, 就是phpmyadmin不行。上网搜了很多教程,没有一个可以解决这个问题。只能来麻烦军哥你了, 下面是配置:

server

{

listen 80;

server_name 1.1.1.1;

index index.html index.htm index.php default.html default.htm default.php;

root  /home/wwwroot/default/;


#error_page   404   /404.html;



location ~ [^/]\.php(/|$)

{

# comment try_files $uri =404; to enable pathinfo

try_files $uri =404;

fastcgi_pass  unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

include fastcgi.conf;

#include pathinfo.conf;

}


location / {

allow 2.2.2.2;

deny all;

# comment try_files $uri =404; to enable pathinfo

try_files $uri =404;

fastcgi_pass  unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

include fastcgi.conf;

#include pathinfo.conf;

}


location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

{

expires      30d;

}


location ~ .*\.(js|css)?$

{

expires      12h;

}


}

[ 本帖最后由 rapwaydown 于 2015-2-19 22:02 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-2-20 20:46:04 | 显示全部楼层


  1. location / {

  2. allow 2.2.2.2;

  3. deny all;

  4. # comment try_files $uri =404; to enable pathinfo

  5. try_files $uri =404;

  6. fastcgi_pass  unix:/tmp/php-cgi.sock;

  7. fastcgi_index index.php;

  8. include fastcgi.conf;

  9. #include pathinfo.conf;

  10. }
复制代码

去掉,重启
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-2-21 03:59:07 | 显示全部楼层

原帖由 licess 于 2015-2-20 20:46 发表
location / {

allow 2.2.2.2;

deny all;

# comment try_files $uri =404; to enable pathinfo

try_files $uri =404;

fastcgi_pass  unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

include fastcgi.conf ...

这段代码哪里错了吗, 我只想让我自己的IP可以访问phpmyadmin。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-2-21 17:20:11 | 显示全部楼层

回复 3# 的帖子




不是指定目录的话
allow 2.2.2.2;
deny all;
直接加到
server段root下面就行

指定目录参考:https://www.vpser.net/build/nginx-htpasswd.html 将里面的auth_basic相关的去掉,提供成allow和deny就行了。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-2-24 02:06:54 | 显示全部楼层

原帖由 licess 于 2015-2-21 17:20 发表
不是指定目录的话
allow 2.2.2.2;
deny all;
直接加到
server段root下面就行

指定目录参考:https://www.vpser.net/build/nginx-htpasswd.html 将里面的auth_basic相关的去掉,提供成allow和deny就行了。 ...


server

{

listen 80;

server_name 1.1.1.1;

index index.html index.htm index.php default.html default.htm default.php;

root  /home/wwwroot/default/;

allow 2.2.2.2;

deny all;

error_page 403 http://a.com/;


#error_page   404   /404.html;


location ~ [^/]\.php(/|$)

{

# comment try_files $uri =404; to enable pathinfo

try_files $uri =404;

fastcgi_pass  unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

include fastcgi.conf;

#include pathinfo.conf;

}


location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

{

expires      30d;

}


location ~ .*\.(js|css)?$

{

expires      12h;

}}

现在改成这样, phpmyadmin可以访问了, 但是p.php,phpinfo.php还有xcache就都404了

[ 本帖最后由 rapwaydown 于 2015-2-24 02:27 编辑 ]

军哥运维代购:http://shop63846532.taobao.com/

发表于 2015-2-24 09:03:08 | 显示全部楼层

回复 5# 的帖子


看4楼,我已经说过了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-27 12:15 , Processed in 0.026411 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表