shjchen 发表于 2012-11-24 11:51:44

lnmp 设置虚拟主机后如何访问phpmyadmin

请各位大侠帮忙解决下问题。
我使用的阿里云主机CentOS 5.4 32位系统,安装了lnmp0.9full版本,安装后使用IP地址,都能成功访问phpmyadmin和探针。
但是后来我建设了虚拟主机,并且把域名指向了自己的IP,现在无法访问phpmyadmin了。

自己是这方面的新手,以前做.NET这方面,初次涉及这方面,菜鸟一个,忘大家见谅,帮忙解决一下。

1. /home/wwwroot下的目录结构:
文件夹:phpmyadmin
文件夹:www.jingliangXX.com
文件:index.html    p.phpphpinfo.php

2. /usr/local/nginx/conf/vhost 下包含www.jingliangXX.com.conf   虚拟机配置文件。文件内容如下:
server
{
listen80 default;
server_name www.jingliangXX.com;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/www.jingliangXX.com;
   
include wordpress.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;
    }
   
    log_formatwww.jingliangXX.com'$remote_addr - $remote_user [$time_local] $request '
               '$status $body_bytes_sent $http_referer '
               '$http_user_agent $http_x_forwarded_for';
    access_log/home/wwwlogs/www.jingliangXX.com.logwww.jingliangXX.com;
}

3./usr/local/nginx/conf/nginx.conf 配置文件的内容:我特意指向了自己的IP地址。

server
    {
      listen       80;
      server_name 42.121.132.79;
      index index.html index.htm index.php;
      root/home/wwwroot;

      location ~ .*\.(php|php5)?$
            {
                try_files $uri =404;
                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;
            }

      access_log/home/wwwlogs/access.logaccess;
    }
include vhost/*.conf;

[ 本帖最后由 shjchen 于 2012-11-24 11:55 编辑 ]

bobofan1995 发表于 2012-11-24 11:59:44

再绑定一个域名映射phpmyadmin就行了,就像这样:http://db.loghen.com

shjchen 发表于 2012-11-24 12:05:01

回复 2# 的帖子

hi,您好,请教下,
我再用一个二级域名指向我这个IP地址,然后建立一个虚拟目录文件,指向phpmyadmin文件夹即可?

我能用别的端口吗?主域名下别的端口,该如何配置?

licess 发表于 2012-11-24 16:45:01

回复 3# 的帖子

/root/vhost.sh 添加


用其他端口就添加完后再改配置文件里的listen就行

id886 发表于 2012-11-27 17:45:44

把phpmyadmin 文件移到你网站目录下不就成了。很简单
页: [1]
查看完整版本: lnmp 设置虚拟主机后如何访问phpmyadmin