配置站点后不生效,仍然是lnmp的初始界面
搬瓦工,系统centOS 6.8 32位用搬瓦工的面板安装全新系统后,全新安装lnmp1.3,成功。配置虚拟主机也成功。查看虚拟主机的结果如下:
# lnmp vhost list
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| http://lnmp.org |
+-------------------------------------------+
Nginx Virtualhost list:
domain.com
wordpress也全部上传到home/wwwroot/domain.com下,域名也解析到了对应的ip地址。重启nginx和php服务,访问域名还是到了lnmp的初始页面。
附上nginx.conf的内容:
userwww www;
worker_processes auto;
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;
multi_accept on;
}
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 50m;
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.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE \.";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
server_tokens off;
access_log off;
server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name www.lnmp.org;
index index.html index.htm index.php;
root/home/wwwroot/default;
#error_page 404 /404.html;
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/access.log;
}
include vhost/*.conf;
}
vhost下domain.com.conf的内容:
server
{
listen 80;
#listen [::]:80;
server_name domain.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/domain.com;
include wordpress.conf;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/domain.com.log;
}
重复安装lnmp多次后都不行,有次突然把wordpress文件放到default目录下是可以的。默认安装的nginx、php和mysql版本,是lnmp的默认页面。手动升级nginx到1.11,php到5.6,mysql到5.6后并重新加载后也还是不行。论坛搜索,猜测是nginx.conf有问题。nginx -t的结果:
# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
#
求助军哥指点。
[ 本帖最后由 vinclancs 于 2017-1-23 11:10 编辑 ] C:\Users\Administrator>curl -IL xfengshui.com
HTTP/1.1 301 Moved Permanently
Cache-Control: max-age=900
Content-Length: 0
Content-Type: text/html
Location: http://104.128.89.146
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 23 Jan 2017 00:38:51 GMT
Age: 1
Connection: keep-alive
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 23 Jan 2017 00:38:51 GMT
Content-Type: text/html
Content-Length: 2502
Last-Modified: Sun, 22 Jan 2017 10:14:52 GMT
Connection: keep-alive
Vary: Accept-Encoding
ETag: "5884861c-9c6"
Accept-Ranges: bytes
明显是你自己域名解析的问题,你设置的是域名301到ip,而不是a记录,既然是301到ip肯定是访问的lnmp默认界面 谢谢军哥,从301改成A解析顺利解决问题。
页:
[1]