新手请教几点疑问
1.重启NGINX的时候有个提示:Reload LNMP...
Reload Nginx configure...
: "server" directive is not allowed here in /usr/local/nginx/conf/123.conf:12
configuration file /usr/local/nginx/conf/nginx.conf test failed
Nginx program is reloding!
Shutting down MySQL. [确定]
Starting MySQL. [确定]
Shutting down php_fpm . done
Starting php_fpmdone
NGINX:
userwww www;
worker_processes 2;
error_log/home/wwwlogs/nginx_error.logcrit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include mime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zonecrawler$binary_remote_addr10m;
server
{
listen 80;
server_name www.1234.com;
index index.html index.htm index.php;
root/home/wwwroot;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log/home/wwwlogs/access.logaccess;
}
include vhost/*.conf;
}
123.conf:
server
{
listen 80;
server_name www.123.com 123.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/123;
include 123.conf;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}
第2个问题是:
DZX后台看到上传许可是2M.这个要如何修改?
测试过.修改PHP.INI.里UPMAX和POSTMAX.
和NGINX.CONF里的client_max_body_size
重启LNMP.发现后台还是显示2M.
第3个问题是:
LNMP的环境.怎么实现123.COM跳转到WWW.123.COM?
WIN+IIS的时候是在伪静态规则的页面添加代码实现.
LNMP的环境下.如何实现这个301呢?
添加什么代码.添加到哪个文件哪一段代码里面?
PS:我的站点是用的后来自己添加的虚拟主机.是123.CONF.不是用的默认站点.麻烦L大帮忙看看. 本来你虚拟主机就是123.conf你里面再include 123.conf 肯定会报错。
php的上传大小默认是50M,php.ini 中的post_max_size
301代码,直接用论坛搜索功能搜索301就能搜到。
回复 2# 的帖子
不好意思.上面发的有点错误.上面的123.conf应该是www.123.com.conf.新添加的虚拟主机配置文件.这个配置文件里面的include 123.conf.是/usr/locall/nginx/conf/123.conf.也就是伪静态的配置文件.里面的内容和默认的discuzx.conf是一样的.
在www.123.com.conf里的代码include 123.conf;这个不是设置虚拟主机的伪静态文件吗.?
我看了PHP.INI.默认是50M没错...但是在DZX后台看.怎么修改都是显示2M的上传许可.难道是DZX的问题吗?
301我搜索过了..不知道那段代码要放在哪个配置文件.是nginx.conf还是www.123.com.conf还是伪静态文件123.conf?
还有.添加需要注意什么格式不.?
[ 本帖最后由 4822740 于 2010-10-29 22:16 编辑 ] PHPINFO.PHP里看到
upload_max_filesize 2M 2M
但是我PHP.INI已经修改过了.不是2M啊.晕死了..
页:
[1]