VPS侦探论坛

 找回密码
 注册
查看: 7344|回复: 8

VPS 设置, 虚拟机上无法生效

[复制链接]
发表于 2011-6-8 04:57:09 | 显示全部楼层 |阅读模式

VPS设置404 , 主域名绑定IP可以实现跳转, 另域名使用虚拟机, 显示是默认404错误.
有没办法让虚拟机继承VPS的设置.

Centos 5.5 + LNMP 0.7
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-6-8 07:49:19 | 显示全部楼层


发nginx的测试信息
和配置文件
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-6-8 18:29:29 | 显示全部楼层

自定义 404 错误, 显示目录
vi /usr/local/nginx/conf/nginx.conf
更改nginx.conf在http定义区域加入:
fastcgi_intercept_errors on;
在server 区域加入:
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
error_page 404 = /404.html;

/usr/local/nginx/sbin/nginx -s reload  # 重启nginx:
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-6-8 20:41:05 | 显示全部楼层



是不是要重启的问题吗
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-6-14 12:08:00 | 显示全部楼层

重启过了..
使用是帝国CMS
多个VPS都是同样的情况. 84, chicagovps
使用完整包安装的.
Centos 32位

[ 本帖最后由 nzp7115 于 2011-6-14 12:09 编辑 ]

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

发表于 2011-6-14 12:58:04 | 显示全部楼层

/usr/local/nginx/sbin/nginx -t看看有错误没
 楼主| 发表于 2011-6-14 21:39:37 | 显示全部楼层

/usr/local/nginx/sbin/nginx -t
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful

/usr/local/nginx/conf/nginx.conf test
-bash: /usr/local/nginx/conf/nginx.conf: Permission denied

[ 本帖最后由 nzp7115 于 2011-6-14 21:41 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-6-15 14:43:48 | 显示全部楼层

如果使用lnmp一键安装包/root/vhost.sh 添加的域名可以,可以删除/usr/local/nginx/conf/vhost/要删除的域名.conf 文件,在/root/lnmp restart 即可。如果是自己手动在/usr/local/nginx/conf/nginx.conf 里添加的,直接删除其中域名 的server{}段就可以了,记得重启。

LNMP0.7 执行/root/vhost.sh  在 /usr/local/nginx/conf/nginx.conf  只找到主域名的 server{}
跟这个有关吗?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-6-15 15:15:06 | 显示全部楼层

/root/vhost.sh 添加的域名,只在/usr/local/nginx/conf/vhost/域名.conf
不在nginx.conf里
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-20 18:47 , Processed in 0.033457 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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