VPS侦探论坛

 找回密码
 注册
查看: 6196|回复: 5

LNMP阿里云为什么能访问phpmyadmin就不能我的域名网站,就会出现lnmp安装成功页面

[复制链接]
发表于 2014-12-13 21:19:54 | 显示全部楼层 |阅读模式

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 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-12-15 10:08:04 | 显示全部楼层


发一下配置,及举例说明
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-12-17 21:22:04 | 显示全部楼层

回复 2# 的帖子


user  www www;

worker_processes auto;

error_log  /home/wwwlogs/nginx_error.log  crit;

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_type  application/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_length  1k;
                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 [1-6].";

                #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_format  access  '$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_pass  unix:/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.log  access;
        }
include vhost/*;

}
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-12-18 08:36:11 | 显示全部楼层



你这个肯定不行,phpmyadmin的目录在/home/wwwroot/default/下,你改了主目录肯定找不到phpmyadmin,你可以自己下一个放到你心的主目录下面
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-12-18 10:59:13 | 显示全部楼层

回复 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 编辑 ]

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

发表于 2014-12-18 13:11:57 | 显示全部楼层

回复 5# 的帖子


include已经include进去不能重复include,会报错
server_name也不能一样有多个也会报错
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-17 13:40 , Processed in 0.027109 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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