Licess是一个开源爱好者,关注Linux、Linux系统管理、NginxLighttpd、Apache等服务器应用、VPS、MySQLPHP Web开发。喜欢捣鼓一下Linux下各种软件的测试,喜欢Shell写一些脚本,虽然写的很菜;喜欢捣鼓服务器却没钱,只能弄个VPS测试;喜欢PHP的高效、简洁、函数的丰富...,但是写的项目却不多;喜欢......

如果你也喜欢,可以通过右边栏订阅 我的博客

交换链接前请务必添加本站链接:

名字:Licess's Blog
描述:关注Linux、Nginx、PHP、VPS相关,分享技巧心得。
地址:http://blog.licess.com/

100 Responses to 留言本

  1. 关于nginx的问题 says:

    那请问下我的这个tomcat的虚拟主机配置有什么问题呢,nginx语法也正确,但是就是无法把jsp请求转给tomcat.麻烦再我看看吧

  2. 关于nginx的问题 says:

    你好我按照你的方法试验了,每个虚拟机的server_name都去掉www,访问的时候不加www,域名能自动补全,但是所有虚拟主机访问的还是第一个虚拟主机的内容,请再帮我看看

  3. 文广 says:

    安装完nmp0.4-full/

    http://www.lnmp.org/phpinfo.php

    打不开

    显示内容为
    No input file specified.

    licess Reply:

    @文广, 你访问错了,你访问到我这边了。肯定没有这个文件。
    用http://你的ip/phpinfo.php

  4. Ronald says:

    请问最近会计划把LNMP一键安装的NginX的版本升到Nginx 0.8.46版本吗?
    我看张宴的测试里说Nginx 0.8.46已经很稳定了。

    licess Reply:

    @Ronald, 不急还是等官网的stable吧。

  5. UGG says:

    我来留言啦

  6. 小邪 says:

    求助,在 swap 为0,基础内存128,burst内存256的vps上面安装,出现 ERROR: Cannot allocate memory。

    licess Reply:

    @小邪, 内存不够用了。

  7. 云仙小筑 says:

    我用lnmp安装drupal,结果提示不支持简洁链接。我改如何修改Nginx配置文件。
    Nginx刚入门,求助。

    licess Reply:

    @云仙小筑, /usr/local/nginx/conf/nginx.conf或者vhost/域名.conf include 伪静态.conf;

  8. 云仙小筑 says:

    最近怎么安装lnmp0.5老出错?
    我在photonvps和vpsyou的每个系统的试了一下。
    发现最后都是
    Nginx is stop!
    /root/lnmp: line 88: /etc/init.d/mysql: No such file or directory
    Active Internet connections (only servers)
    的错误。郁闷。

    licess Reply:

    @云仙小筑, 安装是执行./centos.sh | tee lnmp.log 把lnmp.log 这个文件上传到bbs.vpser.net,并注明你的环境相关信息。

  9. bing says:

    博主你好:在lnmp安装后会出现两个账户,www和mysql,想问下两个用户有没有远程登录操作的权限,默认密码是多少,是否需要修改两个账户的密码,将网站目录chown全归为www用户的安全性如何?

  10. 主要是安装好像成功了,但是
    mysql dir: /usr/local/mysql
    php dir: /usr/local/php
    没有这两个文件夹!!

    代码如下:

    ===========================phpMyAdmin install completed=================================
    ============================add nginx and php-fpm on startup============================
    ===========================add nginx and php-fpm on startup completed====================
    ===================================== Check install ===================================
    /usr/local/nginx [found]
    Error: /usr/local/php not found!!!
    Error: /usr/local/mysql not found!!!
    ========================== Check install ================================
    Install lnmp 0.5 completed! enjoy it.
    =========================================================================
    LNMP V0.5 for CentOS/RadHat Linux VPS Written by Licess
    =========================================================================

    For more information please visit http://www.lnmp.org/

    lnmp status manage: /root/lnmp {start|stop|reload|restart|kill|status}
    default mysql root password:19800211
    phpinfo : http://192.168.37.128/phpinfo.php
    phpMyAdmin : http://192.168.37.128/phpmyadmin/
    Prober : http://192.168.37.128/p.php
    Add VirtualHost : /root/vhost.sh

    The path of some dirs:
    mysql dir: /usr/local/mysql
    php dir: /usr/local/php
    nginx dir: /usr/local/nginx
    web dir : /home/wwwroot

    =========================================================================
    =========================================================================
    Manager for LNMP V0.5 , Written by Licess
    =========================================================================
    LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
    This script is a tool to Manage status of lnmp
    For more information please visit http://www.lnmp.org

    Usage: /root/lnmp {start|stop|reload|restart|kill|status}
    =========================================================================
    Nginx is runing!
    /root/lnmp: line 88: /etc/init.d/mysql: No such file or directory
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
    tcp 0 0 :::22 :::* LISTEN

    licess Reply:

    @502 Bad Gateway错误请教, php、mysql都没有安装成功,到http://bbs.vpser.net/forum-25-1.html 提交一下错误日志看看

  11. 冰古 says:

    lnmp應該要更新一下了,nginx的版本太低了,還有就是在ubuntu上安裝我沒有成功過的。

  12. 向光明 says:

    军哥好,终于发现整合了ftp,上次我用lnmp的时候因为没有ftp,害的我好惨,只好用了挨冻网的fnmp。现在看到整合了ftp,急忙下了去,但发现还要联网升级。因为我是在一个巨型内部网中使用,由于保密问题,坚决不允许连接互联网,没办法,只好在这里给您提个建议,看能否发布一个整合好所有依赖软件的完全版?这样就不需要在连接互联网进行升级了。我们在安装服务器的时候也可以进行最小化安装,以减少其他不必要的软件,为服务器减负。

  13. IT不倒翁 says:

    速度真快啊。dia的真好

  14. 羽飞 says:

    给你的LNMP一键安装包的,关于debian上安装脚本提个改进的建议。
    今天在本地的虚拟机测试了一下,发现安装过程中有问题,最后检查发现,是apt-get源的问题,所以我给的建议是:
    cp /etc/apt/sources.list /etc/apt/sources.list.bak
    echo "deb http://http.us.debian.org/debian/ stable main" >> /etc/apt/sources.list
    apt-get update
    apt-get remove -y apache2 apache2-doc apache2-utils apache2.2-common mysql-client mysql-server php
    和这下面的
    apt-get install -y apt-spy
    apt-spy -d stable -a $area -t 5
    cp /etc/apt/sources.list.d/apt-spy.list /etc/apt/sources.list
    apt-spy update
    这样我觉得更好点,不对之处,还请见谅!

  15. huage.org says:

    在的VPS服务器环境是用lnmp0.5搭建的,所有的网站程序都放在/home/wwwroot/下,其中有一个WP博客放在/home/wwwroot/tpimage下。
    我在VPS上用命令安装虚拟主机时,已天际wordpress.conf,但是当我的博客安装好后,我进入后台设置固定链接时,却多了一个index.php,例如/index.php/%year%/%monthnum%/%postname%/ ,我想把这个/index.php去掉,我尝试了许多方法都没有解决问题,是路径设置问题吗?还是其它?

    问题补充:
    我的WP博客放在home/wwwroot/tpimage下,其中这个网站的conf是

    server

    {

    listen 80;

    server_name http://www.tpimage.net;

    index index.html index.htm index.php default.html default.htm default.php;

    root /home/wwwroot/tpimage;

    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;

    }

    access_log off;

    }

    另外wordpress.conf是

    location / {

    if (-f $request_filename/index.html){

    rewrite (.*) $1/index.html break;

    }

    if (-f $request_filename/index.php){

    rewrite (.*) $1/index.php;

    }

    if (!-f $request_filename){

    rewrite (.*) /index.php;

    }

    }

    licess Reply:

    @huage.org, include /wordpress.conf; 多了一个斜杠,去掉重启就像了。

  16. zcc says:

    Reload LNMP...
    Reload Nginx configure...
    the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    configuration file /usr/local/nginx/conf/nginx.conf test is successful
    /root/lnmp: line 67: kill: (2955) - No such process
    Nginx program is reloding!
    Shutting down MySQL. [ OK ]
    Starting MySQL. [ OK ]
    Shutting down php_fpm . done
    Starting php_fpm done

    Licess出现这个问题是什么原因

    licess Reply:

    @zcc, 没有错误,/root/lnmp: line 67: kill: (2955) - No such process 显示的是之前没有运行那个程序。

  17. mrcuix says:

    我LNMP 0.6 完全版来装在CentOS5.5上,能成功运行,但有个很大的问题:
    非本机访问网页第一次可以访问,刷新2下就会导致服务器重启了,而本机访问页面多少次都不会出现该问题,当前内存只用到20%多

  18. Dogge says:

    你好,LNMP一键安装包确实使用方便,但是我想自己手动编译安装LNMP平台,能告诉我各个源码包的configure的选项吗?谢谢?
    PS:网上虽然有很多教程,但是总是报错。

    licess Reply:

    @Dogge, 查看脚本里面都有

  19. xmlijian says:

    请问如何升级mysql?

  20. crusher says:

    请教一个问题,我已经看了这里的所有留言,但感觉我的问题没有解决。按你的方法安装的lnmp 后来添加虚拟主机,但是wordpress固定链接不行,只有把wordpress放在/home/wwwroot/下才行,如果我把网站放在 /home/wwwroot/mysite.com/下 include wordpress.conf 加上也没有作用。 请问是怎么回事。 我是在一个IP下添加许多虚拟主机。

    licess Reply:

    @crusher, 用/root/vhost.sh 直接添加域名,提示伪静态的时候输入wordpress即可。

  21. oldfox126 says:

    军哥你好,我一直用你的LNMP装VPS,从0.4用到0.7,挺方便的,谢谢。

    在用的过程中,我发现 /root/vhost.sh 这个脚本有些不方便的地方,就是只能添加网站,不能显示现有的网站也不能删除。
    我尝试着按照你的脚本修改了一个,现在可以显示、添加和删除网站。删除的时候也不用自己输入域名,只要按数字编号就行了。
    我把代码都发在这里,你看看有没有能用的代码。

    再次感谢军哥及你创建的LNMP一键安装包。

    /root/vhost.sh
    显示、添加及删除LNMP上的网站:

    #!/bin/bash

    get_char() {
    SAVEDSTTY=`stty -g`
    stty -echo
    stty cbreak
    dd if=/dev/tty bs=1 count=1 2> /dev/null
    stty -raw
    stty echo
    stty $SAVEDSTTY
    }

    addVhost() {
    domain="www.lnmp.org"
    echo "Please input domain:"
    read -p "(Default domain: http://www.lnmp.org):" domain
    if [ '' == "$domain" ]; then
    domain="www.lnmp.org"
    fi

    if [ ! -f "/usr/local/nginx/conf/vhost/$domain.conf" ]; then
    echo "==========================="
    echo "domain=$domain"
    echo "==========================="
    else
    echo "==========================="
    echo "$domain is exist!"
    echo "==========================="
    fi

    moredomainame=''
    echo "Do you want to add more domain name? (y/n)"
    read add_more_domainame
    if [ 'y' == "$add_more_domainame" ]; then
    echo "Type domainname,example(bbs.vpser.net forums.vpser.net luntan.vpser.net):"
    read moredomain
    echo "==========================="
    echo "domain list=$moredomain"
    echo "==========================="
    moredomainame=" $moredomain"
    fi

    vhostdir="/home/wwwroot/$domain"
    echo "Please input the directory for the domain:$domain :"
    read -p "(Default directory: /home/wwwroot/$domain):" vhostdir
    if [ '' == "$vhostdir" ]; then
    vhostdir="/home/wwwroot/$domain"
    fi
    echo "==========================="
    echo "Virtual Host Directory=$vhostdir"
    echo "==========================="

    echo "==========================="
    echo "Allow Rewrite rule? (y/n)"
    echo "==========================="
    read allow_rewrite

    if [ 'n' == "$allow_rewrite" ]; then
    rewrite="none"
    else
    rewrite="other"
    echo "Please input the rewrite of program :"
    echo "wordpress,discuz,typecho,sablog,dabr rewrite was exist."
    read -p "(Default rewrite: other):" rewrite
    if [ '' == rewrite ]; then
    rewrite="other"
    fi
    fi
    echo "==========================="
    echo "You choose rewrite=$rewrite"
    echo "==========================="

    echo "==========================="
    echo "Allow access_log? (y/n)"
    echo "==========================="
    read access_log

    if [ 'n' == "$access_log" ]; then
    al="access_log off;"
    else
    echo "Type access_log name(Default access log file:$domain.log):"
    read al_name
    if [ '' == "$al_name" ]; then
    al_name="$domain"
    fi

    al="log_format $al_name '\$remote_addr - \$remote_user [\$time_local] "\$request" '
    '\$status \$body_bytes_sent "\$http_referer" '
    '"\$http_user_agent" \$http_x_forwarded_for';
    access_log $al_name.log $al_name;"
    fi
    echo "==========================="
    echo You access log file="$al_name.log"
    echo "==========================="

    echo ""
    echo "Press any key to start create virtul host..."
    char=`get_char`

    if [ ! -d /usr/local/nginx/conf/vhost ]; then
    mkdir /usr/local/nginx/conf/vhost
    fi

    echo "Create Virtul Host directory......"
    mkdir -p $vhostdir
    echo "set permissions of Virtual Host directory......"
    chmod -R 755 $vhostdir
    chown -R www:www $vhostdir

    if [ ! -f /usr/local/nginx/conf/$rewrite.conf ]; then
    echo "Create Virtul Host ReWrite file......"
    touch "/usr/local/nginx/conf/$rewrite.conf"
    echo "Create rewirte file successful,now you can add rewrite rule into /usr/local/nginx/conf/$rewrite.conf."
    else
    echo "You select the exist rewrite rule:/usr/local/nginx/conf/$rewrite.conf"
    fi

    cat >/usr/local/nginx/conf/vhost/$domain.conf<<eof
    server
    {
    listen 80;
    server_name $domain$moredomainame;
    index index.html index.htm index.php default.html default.htm default.php;
    root $vhostdir;

    include $rewrite.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;
    }

    $al
    }
    eof

    echo "Test Nginx configure file......"
    /usr/local/nginx/sbin/nginx -t
    echo "...Done!"

    echo "Restart Nginx......"
    kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
    echo "...Done!"

    echo ""
    echo "========================================================================="
    echo "Your domain:$domain"
    echo "Directory of $domain:$vhostdir"
    echo "Add $domain Ok!"
    echo "========================================================================="
    }

    deleteVhost() {
    echo "Type 1...$vhostCount to delete domain:"
    read -p "type other Cancel delete:" domainIndex

    case "$domainIndex" in
    [0-9] ) ;;
    [0-9][0-9] ) ;;
    * ) {
    echo "Cancel delete domain,Exit!"
    echo ""
    exit 0
    };;
    esac

    echo ""
    domain=${vhosts[$domainIndex]}

    if [ 0 == ${#domain} ]; then
    echo "you select a domain that not exists"
    echo "Cancel delete domain,Exit!"
    echo ""
    exit 0
    fi

    vhostfile="/usr/local/nginx/conf/vhost/$domain.conf"
    if [ ! -f "$vhostfile" ]; then
    echo "domain [$domain=vhostfile] din't exists , Exit !"
    exit 1
    fi

    echo "Do you realy want delete domain [$domain]:"
    read -p "Type y/n(Default not,cancel detele and exit),y/n:" confirm
    if [ 'y' != "$confirm" ]; then
    echo "Cancel delete domain [$domain],Exit!"
    exit 1
    fi

    echo "delete domain [$domain] ..."
    rm -rf "$vhostfile"
    echo "... OK!"

    echo "Restart Nginx......"
    kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
    echo "... Done!"
    echo ""

    domaindir="/home/wwwroot/$domain"
    if [ ! -d "$domaindir" ]; then
    exit 1
    fi

    echo "Delete domain dir [$domaindir]?"
    read -p "Default not delete, y/n:" deleteDomainDir
    if [ 'y' != "$deleteDomainDir" ]; then
    echo "Cancel delete domain dir [$domaindir],Exit!"
    exit 1
    fi

    echo "Do you realy want delete domain dir [$domaindir]? the files will lost !"
    read -p "Type y/n(Default not,cancel detele and exit),y/n:" confirm
    if [ 'y' != "$confirm" ]; then
    echo "Cancel delete domain dir [$domaindir],Exit!"
    exit 1
    fi

    echo "delete domain dir [$domaindir] ..."
    rm -rf "$domaindir"
    echo "... OK!"
    echo ""
    }

    doVhost() {
    exit 0
    }

    showVhost() {
    vhostlist=`ls /usr/local/nginx/conf/vhost`
    vhostlist=${vhostlist//\.conf/}

    echo ""
    echo "========================================================================="
    echo "some domains on your server:"

    vhostCount=1
    for vhost in $vhostlist
    do
    echo "[$vhostCount] $vhost"
    vhosts[$vhostCount]=$vhost
    let vhostCount=$vhostCount+1
    done
    let vhostCount=$vhostCount-1

    return 0
    }

    # Check if user is root
    if [ $(id -u) != "0" ]; then
    echo "Error: You must be root to run this script, use sudo sh $0"
    exit 1
    fi

    declare -a vhosts
    vhostCount=0

    clear
    echo "========================================================================="
    echo "Virtual Host Manager for LNMP V0.4 , Written by oldfox126@foxmail.com "
    echo "========================================================================="
    echo "LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux "
    echo "This script is a tool to add virtual host for nginx "
    echo "For more information please visit http://www.lnmp.org/&quot;
    echo ""
    echo "========================================================================="

    case "$1" in
    add)
    addVhost
    ;;
    update)
    addVhost
    ;;
    delete)
    deleteVhost
    ;;
    do)
    doVhost
    ;;
    *)
    showVhost
    echo ""
    echo "Usage: /root/vhost {add|delete|update}"
    read -p "Please Type add,delete,update! or Type Other to Exit:" action

    if [ 'add' == "$action" ]; then
    addVhost
    exit 1
    fi

    if [ 'update' == "$action" ]; then
    addVhost
    exit 1
    fi

    if [ 'delete' == "$action" ]; then
    deleteVhost
    exit 1
    fi

    if [ 'do' == "$action" ]; then
    doVhost
    exit 1
    fi

    echo "Cancel do domain,Exit!"
    esac
    exit

  22. jack says:

    licess ,您好
    我装的是一键安装包。在启动php-fpm的时候遇到了

    Starting php_fpm Failed loading /usr/local/ioncube/ioncube_loader_lin_5.3.so: /usr/local/ioncube/ioncube_loader_lin_5.3.so: undefined symbol: zend_resolve_path

    这种错误,请问有什么解决办法么?

    licess Reply:

    @jack, php -v 看一下php是哪个版本
    可能是脚本判断版本错误。

  23. 买vps是linux的好还是windows的好?

    licess Reply:

    @Quarry Equipments, php程序的话linux最合适

  24. 巢筑枝头 says:

    博主,我刚才在盛大云主机安装好了lnmp包,最后面是显示如下,但是phpMyAdmin无法显示,mysql数据库怎么弄,鄙人代码盲,硬是按照你的教程走到安装完这一步的:
    Install LNMP V0.7 completed! enjoy it.
    =========================================================================
    LNMP V0.7 for Ubuntu VPS , Written by Licess
    =========================================================================

    For more information please visit http://www.lnmp.org/

    lnmp status manage: /root/lnmp {start|stop|reload|restart|kill|status}
    default mysql root password:12345678
    phpinfo : http://vm-192-168-10-207.shengyun.grandcloud.cn/phpinfo.php
    phpMyAdmin : http://vm-192-168-10-207.shengyun.grandcloud.cn/phpmyadmin/
    Prober : http://vm-192-168-10-207.shengyun.grandcloud.cn/p.php

    The path of some dirs:
    mysql dir: /usr/local/mysql
    php dir: /usr/local/php
    nginx dir: /usr/local/nginx
    web dir : /home/wwwroot

    =========================================================================
    =========================================================================
    Manager for LNMP V0.7 , Written by Licess
    =========================================================================
    LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
    This script is a tool to Manage status of lnmp
    For more information please visit http://www.lnmp.org

    Usage: /root/lnmp {start|stop|reload|restart|kill|status}
    =========================================================================
    Nginx is runing!
    php-fpm is runing!
    * MySQL is not running
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
    tcp6 0 0 :::22 :::* LISTEN

  25. 老妖 says:

    现在博客放在什么主机上啊?很快啊。

    licess Reply:

    @老妖, linode的vps上。

  26. 夕月木 says:

    军哥你好
    请问有什么支持IPV6的VPS推荐吗?
    我现在用着YardVPS,很不稳定,22端口经常连不上。网站也常常打不开,但ping的话是可以的,延迟是200ms。
    就是希望能有一个速度快、稳定点的空间,硬盘可以小点,因为我就是准备拿来做代理的。
    谢谢军哥!

  27. 请问在云服务器上部署lnmp效果如何,比如亚马逊的ec2?

  28. yaxin says:

    主机打开VMware中的网站很慢,这是什么问题?VMWare中的系统是CentOS6,LNMP。主机用win7。NAT

  29. 东东 says:

    军哥,能不能提供一个phpwind伪静态的配置文件?

  30. Patrick says:

    Licess 你好,

    本人是新手,我現在建立一個WEB SERVER,並需要安裝MEGENTO。最近從網絡上找到你的LNMP安裝包,附合MEGENTO的要求,成功安裝你的LNMP安裝後,再安裝MAGENTO。可是瀏覧器未能夠顯示MAGENTO旳畫面。能否提無供一些方案給我呢

    謝謝
    PATRICK

  31. 皇家元林 says:

    ubuntu桌面版安装lnmp,不能启动php和mysql,怎么回事?

    licess Reply:

    @皇家元林, 请到http://bbs.vpser.net/index.php 上传安装错误日志

  32. aaa103439 says:

    我自己在虚拟机上弄了个wordpress(root路径是/home/wwwroot/wordpress)
    我在nginx的配置文件中,加入了
    server{
    ****
    location /download/
    {
    alias /home/wwwroot/download/;
    autoindex on;
    autoindex_localtime on;
    }
    ****
    }
    但是我在访问http://***/download的时候,依然访问的是download下的页面,而不是列表

    请问,这个是什么问题?日志中也没有相关错误信息。

    licess Reply:

    @aaa103439, 重启nginx了没

  33. aaa103439 says:

    @licess

    我用kill -HUP 重载了配置文件,但没有重启。

  34. 草啦 says:

    军哥,建议 lnmp 以后的版本尽量使用最新稳定的服务器软件,那些需要旧版环境的用户大可以使用旧版的lnmp。
    还有就是可以把 MySql 替换为 MariaDB 数据库,后者占用的资源相对要少一些,且完全兼容前者。

  35. 点点滴滴 says:

    我是从淘宝搜索过来看看的

发表评论

(required)