VPS侦探论坛

 找回密码
 注册
查看: 11675|回复: 4

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

[复制链接]
发表于 2012-11-24 11:51:44 | 显示全部楼层 |阅读模式

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

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

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

2. /usr/local/nginx/conf/vhost 下包含www.jingliangXX.com.conf   虚拟机配置文件。文件内容如下:
server
{
listen  80 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_pass  unix:/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_format  www.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.log  www.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_pass  unix:/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.log  access;
    }
include vhost/*.conf;

[ 本帖最后由 shjchen 于 2012-11-24 11:55 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-11-24 11:59:44 | 显示全部楼层


再绑定一个域名映射phpmyadmin就行了,就像这样:http://db.loghen.com
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-11-24 12:05:01 | 显示全部楼层

回复 2# 的帖子


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

我能用别的端口吗?主域名下别的端口,该如何配置?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-11-24 16:45:01 | 显示全部楼层

回复 3# 的帖子




/root/vhost.sh 添加


用其他端口就添加完后再改配置文件里的listen就行
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-11-27 17:45:44 | 显示全部楼层

把  phpmyadmin 文件移到你网站目录下不就成了。很简单

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

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-24 01:14 , Processed in 0.026781 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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