Blog

  • nginx安装| lnmp | apache换为nginx | 禁用apache

    办公室的电脑,拿来用用,试试nginx的特性
    初步觉得要是卸载可能比较麻烦,反正电脑空间也大

     

    • 采取不卸载,停止apache服务,并禁止其开机启动的方法

    先查看apache服务

    #ps -ef | grep apache2

    root 1243 1 0 19:50 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 1264 1243 0 19:50 ? 00:00:00 /usr/sbin/apache2 -k start
    www-data 1265。。。。。。apache2 -k start
    root 3154 2796 0 20:30 pts/0 00:00:00 grep –color=auto apache2
    停止apache2

    #service apache2 stop

    * Stopping web server apache2 … waiting [ OK ]
    重启了果真又出现了,那么说明要在启动上下手

    It works!
    This is the default web page for this server.

    网上查找例子(其他都类似):
    删除apache2随机器启动的服务

    #update-rc.d -f apache2 remove

    Removing any system startup links for /etc/init.d/apache2 …
    /etc/rc0.d/K09apache2
    /etc/rc1.d/K09apache2
    /etc/rc2.d/S91apache2
    /etc/rc3.d/S91apache2
    /etc/rc4.d/S91apache2
    /etc/rc5.d/S91apache2
    /etc/rc6.d/K09apache2
    奏效

    接下来想安装nginx
    也不知道是从源里直接安装好还是编译安装好
    编译了后没成功,缺少格物致知精神
    后来用的lnmp 脚本
    nginx是起来了,但是还是有权根问题
    对各个文件目录不太熟
    导致还是请ihipop来帮忙
    经过多次实验,完整安装过程如下(以下内容 added at 2011-8-7):

    以下安装在debian下进行(ubuntu下自己有php,不需要,ubuntu的安装方法http://wiki.ubuntu.org.cn/Nginx)

    安装基本环境:

    apt-get install build-essential
    • 编译安装nginx:

    先下载好最新版本的nginxhttp://nginx.org/en/download.html

    wget http://nginx.org/download/nginx-0.8.54.tar.gz
     tar vxzf nginx-0.8.54.tar.gz
     cd nginx-0.8.54
     ./configure --with-http_ssl_module
     make && make install

    下面为编译里遇到的问题,缺少了某些库,apt-get以后就没有问题了:

    ./configure: error: the HTTP rewrite module requires the PCRE library.
    这时要执行下面命令(因为rewrite模块需要)
    apt-get install libpcre3-dev

    ./configure: error: the HTTP gzip module requires the zlib library.
    这时要执行下面命令(因为gzip模块需要)
    apt-get install zlib1g-dev

    在./configure –with-http_ssl_module时提示如下信息
    ./configure: error: SSL modules require the OpenSSL library.
    这时要执行下面命令(因为OpenSSL模块需要)
    apt-get install libssl-dev

    • 安装mysql:

    apt-get install mysql-server  php5-mysql

    过程中会提示输入mysql根用户密码

    • 安装php:

    php5-fpm的源

    deb http://packages.dotdeb.org stable all
    deb-src http://packages.dotdeb.org stable all
    deb http://php53.dotdeb.org stable all

    为省力执行下面命令:

    echo "deb http://packages.dotdeb.org stable all" >> /etc/apt/sources.list;echo "deb-src http://packages.dotdeb.org stable all" >> /etc/apt/sources.list;echo "deb http://php53.dotdeb.org stable all" >> /etc/apt/sources.list

    加入后apt-get update出现以下提示

    正在读取软件包列表… 完成
    W: GPG 错误:http://packages.dotdeb.org stable Release: 由于没有公钥,无法验证下列签名: NO_PUBKEY E9C74FEEA2098A6E
    W: GPG 错误:http://php53.dotdeb.org stable Release: 由于没有公钥,无法验证下列签名: NO_PUBKEY E9C74FEEA2098A6E

    故通过下面命令导入公钥

    wget http://www.dotdeb.org/dotdeb.gpg
    cat dotdeb.gpg | apt-key add -

    apt-get update

    apt-get install php5-fpm

    至此,lnmp安装完成。

    要想成功解译出php,在nginx.conf 里相应 server 部分做如下修改:

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

    location ~ \.php$ {
    root           /web/;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /web/$fastcgi_script_name;
    include        fastcgi_params;
    }

    :)EOT

  • Foxit注册信息

    1、Foxit Reader Pro的Key信息

    [Foxit Reader Pro]
     SN=FRPFZ22452
     Modules=
     Users=1
     Licensee=VDOWN 2010
     LicenseDate=2010/03/10
     Sign=2EFBFC947FA2C5DDF237DAF2358F4B4B77529BD0249CA69A649DD6B23BC43909783CAFF5EAAF2784
     Restrictions=

    2、Foxit虚拟打印机的key信息

    [Foxit License]
    SN=PCRFZINT
    Modules=
    Users=10
    Licensee=Foxit Software Internal
    LicenseDate=2006/08/11
    Sign=349AFC742821803EE5614BF1C39713F07B13464062FF6C48AE0F30AF7251DAEB67A85C886F96AAD7

    3、foxit pdf editor的key信息

    [PDF Editor]
    SN=PED1367473821
    Modules=
    Users=9001
    Licensee=tRiST // CORE
    LicenseDate=2010/06/12
    Sign=A6468C277B37332E1662597CD5AB70626FA1694429D7DE743E8EE3E7B4B6D63024B55C98200B3AA0
    Restrictions=

    具体使用方法:

    注意:到www.foxitsoftware.com下载安装英文版,检查更新安装foxit pdf editor和虚拟打印机foxit pdf creator
    1.lang_zh_cn放到foxit reader目录下,此为中文语言包
    2.frpkey为foxit reader注册文件(对应上面Key信息的1号key)
    3.pcrkey为虚拟打印机注册文件(对应上面Key信息的2号key)
    4.pedkey为foxit pdf editor注册文件(对应上面Key信息的3号key)
    5.如果注册码不能用可自己用注册机算号
    6.注册后再把英文改为中文

  • 在ubuntu下自动pppoe拨号

    原理是当网络不通时,自动拨号

    #!/bin/bash
    #This program dial via pppoe
    #History jpuyy 2011/01/20
    # add ip / hostname separated by white space
    
    HOSTS="g.cn"
    
    # no ping request
    
    COUNT=1
    
    for myHost in $HOSTS
    do
    count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
    if [[ $count -eq 0 ]]; then
    # 100% failed
    poff
    pon dsl-provider
    fi
    done
  • 回家啦

    高兴高兴高兴

  • 紧张了

    5号6号各有一门考试
    又要连夜看书了
    早知今日
    每次都是这样拖拖拖

  • 燃烧记忆取暖的日子

    竟想不到你的一点不好了
    脑子里都是你的好
    没有觉得你的任何不好
    这是为什么