VPS侦探论坛

 找回密码
 注册
查看: 10250|回复: 1

discuz无法生成静态页面!(本情况已解决,看二楼!)

[复制链接]
发表于 2010-4-15 16:15:53 | 显示全部楼层 |阅读模式

vhost下的文件:

  1. server
  2.         {
  3.                 listen       80;
  4.                 server_name XXX.com;
  5.                 index index.html index.htm index.php default.html default.htm default.php;
  6.                 root  /home/wwwroot/;

  7.               include discuz.conf;

  8.                 location ~ .*\.(php|php5)?$
  9.                         {
  10.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  11.                                 fastcgi_index index.php;
  12.                                 include fcgi.conf;
  13.                         }

  14.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  15.                         {
  16.                                 expires      30d;
  17.                         }

  18.                 location ~ .*\.(js|css)?$
  19.                         {
  20.                                 expires      12h;
  21.                         }

  22.                 access_log off;
  23.         }
复制代码
nginx.conf的文件信息
  1. user  www www;

  2. worker_processes 1;

  3. error_log  /home/wwwroot/logs/nginx_error.log  crit;

  4. pid        /usr/local/nginx/logs/nginx.pid;

  5. #Specifies the value for maximum file descriptors that can be opened by this process.
  6. worker_rlimit_nofile 51200;

  7. events
  8.         {
  9.                 use epoll;
  10.                 worker_connections 51200;
  11.         }

  12. http
  13.         {
  14.                 include       mime.types;
  15.                 default_type  application/octet-stream;

  16.                 server_names_hash_bucket_size 128;
  17.                 client_header_buffer_size 32k;
  18.                 large_client_header_buffers 4 32k;
  19.                 client_max_body_size 8m;

  20.                 sendfile on;
  21.                 tcp_nopush     on;

  22.                 keepalive_timeout 60;

  23.                 tcp_nodelay on;

  24.                 fastcgi_connect_timeout 300;
  25.                 fastcgi_send_timeout 300;
  26.                 fastcgi_read_timeout 300;
  27.                 fastcgi_buffer_size 64k;
  28.                 fastcgi_buffers 4 64k;
  29.                 fastcgi_busy_buffers_size 128k;
  30.                 fastcgi_temp_file_write_size 256k;

  31.                 gzip on;
  32.                 gzip_min_length  1k;
  33.                 gzip_buffers     4 16k;
  34.                 gzip_http_version 1.0;
  35.                 gzip_comp_level 2;
  36.                 gzip_types       text/plain application/x-javascript text/css application/xml;
  37.                 gzip_vary on;

  38.                 #limit_zone  crawler  $binary_remote_addr  10m;

  39. server
  40.         {
  41.                 listen       80;
  42.                 server_name XXX.com;
  43.                 index index.html index.htm index.php;
  44.                 root  /home/wwwroot;

  45.                 location ~ .*\.(php|php5)?$
  46.                         {
  47.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  48.                                 fastcgi_index index.php;
  49.                                 include fcgi.conf;
  50.                         }

  51.                 location /status {
  52.                         stub_status on;
  53.                         access_log   off;
  54.                 }

  55.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  56.                         {
  57.                                 expires      30d;
  58.                         }

  59.                 location ~ .*\.(js|css)?$
  60.                         {
  61.                                 expires      12h;
  62.                         }

  63.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  64.              '$status $body_bytes_sent "$http_referer" '
  65.              '"$http_user_agent" $http_x_forwarded_for';
  66.                 access_log  /home/wwwroot/logs/access.log  access;
  67.         }
  68. include vhost/*.conf;
  69. }
复制代码
以上是两个文件的内容,无论如何折腾就是显示404!()

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


经过Licess的大哥的指点终于搞定了!再这里严重的谢谢了!

我的情况大致说下:(DZ在根目录下)
在安装0.4的时候,就已经绑了米!
但是又用名字把这个添加了一次虚拟主机!
(我想可能有朋友和我一样 是第一次接触)如果你的情况和我一样,那这个就能帮助你了!
到vhost目录下把你添加的虚拟主机删除掉!
然后到nginx.conf中 在

  1.   listen       80;
  2.   server_name XXXX.com;
  3.   index index.html index.htm index.php;
  4.   root  /home/wwwroot;
复制代码

下添加

  1.               include discuz.conf;
复制代码

然后执行

  1. kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
复制代码

就OK!
不放心的,可以先检查下nginx

  1. /usr/local/nginx/sbin/nginx -t
复制代码

看有没错误!
然后在执行

  1. kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
复制代码

简单的做了这个说明!谢谢vpser.net

评分

参与人数 1威望 +10 收起 理由
licess + 10

查看全部评分

Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-17 02:49 , Processed in 0.026011 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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