LNMP阿里云为什么能访问phpmyadmin就不能我的域名网站,就会出现lnmp安装成功页面
LNMP阿里云为什么能访问phpmyadmin就不能我的域名网站,就会出现lnmp安装成功页面,如果我修改Nginx配置文件,能访问域名网站了,就不能访问phpmyadmin了,都会出现404,这是怎么回事呢,帮忙,谢谢, 如果我想访问phpmyadmin,我就得去修改一个nginx配置,然后就能访问,但网站就会出现404页面错误,每次都这样手动修改,不能两个同时都访问!每次都修改nginx配置文件中的server_name xxxx;root/home/wwwroot/xxxx;(如果想访问网站就是域名,如果想访问phpmyadmin就修改成default)
[ 本帖最后由 cmwl999 于 2014-12-13 21:33 编辑 ] 发一下配置,及举例说明
回复 2# 的帖子
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.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
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;
#log format
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80 default;
#listen [::]:80 default ipv6only=on;
server_name test.com;
index index.html index.htm index.php;
root/home/wwwroot/test.com;
#error_page 404 /404.html;
location ~ [^/].php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 12h;
}
access_log/home/wwwlogs/default.logaccess;
}
include vhost/*;
} 你这个肯定不行,phpmyadmin的目录在/home/wwwroot/default/下,你改了主目录肯定找不到phpmyadmin,你可以自己下一个放到你心的主目录下面
回复 4# 的帖子
那我修改好phpmyadmin的目录在/home/wwwroot/default/下,我把test.com放到test.com.conf中在nginx.conf包含test.com.conf这个可以吗,就是nginx.conf里的这句include vhost/*;还要我要在nginx里面把server{}这个再来一个,修改里面的server_name和root路径呢
[ 本帖最后由 cmwl999 于 2014-12-18 11:00 编辑 ]
回复 5# 的帖子
include已经include进去不能重复include,会报错server_name也不能一样有多个也会报错
页:
[1]