Linode SSD VPS最新优惠码,新用户注册冲5刀送50刀,手要快

Linode VPS 新用户注册,冲$5送$50刀,差不多可以用半年(VPS套餐最低10刀/月)
作为一个深度Linode老客户,只有艳羡的份了,老用户无此优惠。

数量有限,手快者得,慢了就可能过期了

Promo Code操作
1,在Promo Code(优惠码): BSFM50
2,我的Referral Code: e44e48dac5137097d560a696d4a5b6b28de588be (备注:点这个的链接注册,自动输入,无需手动,支持我就这么简单)

注意事项
送50美元给你的条件是你至少要充值5美元才可以!目前linode最便宜的VPS是月付10美元,如果你自己充值10美元的话,这下子可以使用半年了!
1,请勿使用QQ邮箱注册,Linode 已经屏蔽了;

2,喜大普奔,据说不需要VISA卡,国内用户会自动走银联通道。

3,Linode只有Linux操作系统可选,需要有点折腾精神Linux基础用户使用。

心动不如行动,现在就买个自己的Linode VPS吧

如果过期了,请通过奇才哥简介里的联系方式联系我,我把文章撤掉!

八卦一下:奇才哥自2011年9月6号使用Linode的VPS服务器至今,其VPS稳定型,逼格超高!真刀真枪玩Linux 也是从Linode 开始的。当然,现在的水平也就配置个VPS web服务器环境轻轻松松而已。

此外,业界良心的Linode在你使用超过一年之后,还会提供免费升级服务,比如加硬盘空间,带宽等

CentOS 6.5 64位VPS源码安装PHP 5.2.17

CentOS 6.5 64位VPS源码安装PHP 5.2.17
先添加用户及用户组

/usr/sbin/groupadd www
/usr/sbin/useradd -g www www

一、编译安装PHP 5.2.17 所需的支持库
PS, 如果已经安装过这些支持库的,不必重复安装!
按顺序依次安装如下软件:

1.1 下载LIBICONV 1.14 并安装
Libiconv URL: http://www.gnu.org/software/libiconv/ http://ftp.gnu.org/pub/gnu/libiconv/

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxvf libiconv-1.14.tar.gz && cd libiconv-1.14
./configure --prefix=/usr/local/libiconv --enable-extra-encodings && make && make install && cd ../

注:enable-extra-encodings 选项是为了能支持以下扩展字符集,详情请参考:http://www.gnu.org/software/libiconv/
主要是为了支持Magento的 ISO-2022-JP Mail for Japanese
插件所需要的 ISO-2022-JP-3 字符集

European languages
CP{437,737,775,852,853,855,857,858,860,861,863,865,869,1125}
Semitic languages
CP864
Japanese
EUC-JISX0213, Shift_JISX0213, ISO-2022-JP-3
Chinese
BIG5-2003 (experimental)
Turkmen
TDS565
Platform specifics
ATARIST, RISCOS-LATIN1

1.2, 下载 MHASH 0.9.9.9 并安装
URl: http://sourceforge.net/projects/mhash/

wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2 
tar jxvf mhash-0.9.9.9.tar.bz2 && cd mhash-0.9.9.9
./configure && make && make install && cd ../
/sbin/ldconfig

1.3,下载 MCRYPT 2.6.8 并安装
myrypt URL: http://sourceforge.net/projects/mcrypt/?source=dlpaz

wget http://hivelocity.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
tar zxf mcrypt-2.6.8.tar.gz && cd mcrypt-2.6.8
./configure && make && make install
/sbin/ldconfig
cd ../

1.4, 下载 LIBMCRYPT 2.5.8 并安装
URL: http://sourceforge.net/projects/mcrypt/files/Libmcrypt/

wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar zxf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8
./configure && make && make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install && make && make install
cd ../../

创建系统软连接

ln -s /usr/local/lib/libmcrypt.* /usr/lib/
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
ln -s /usr/local/lib/libmhash.* /usr/lib/

开始以下步骤前,请确保已经成功安装MySQL 或者 MySQL的变种如:mariadb,PHP 5.2.17 如果没有安装MySQL 是无法顺利安装的,否则安装后无法支持 MySQL,需要重新编译!

二、下载、编译、安装PHP 5.2.17
第一步,下载、编译、安装PHP 5.2.17源码
注意下文中 –with-mysql –with-mysqli 字段的路径根据自己服务器上MySQL的实际情况更改

wget http://museum.php.net/php5/php-5.2.17.tar.gz
#下载PHP 的 php-fpm 补丁
wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
tar zxvf php-5.2.17.tar.gz
#应用php-fpm 补丁
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1

#请注意一下编译参数中的 --with-mysql --with-mysqli 及 --with-iconv 参数的路径,改为你服务器中实际项目地址

./configure --prefix=/usr/local/php \
--enable-fastcgi \
--enable-fpm \
--with-config-file-path=/usr/local/php/etc \
--with-mysql=/usr/local/mariadb \
--with-mysqli=/usr/local/mariadb/bin/mysql_config \
--with-iconv-dir=/usr/local \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-gd \
--enable-gd-native-ttf \
--with-zlib \
--enable-zip \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-discard-path \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-force-cgi-redirect \
--enable-mbstring \
--with-mcrypt \
--with-iconv=/usr/local/libiconv \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-ldap \
--with-ldap-sasl \
--with-xmlrpc \
--enable-soap

make ZEND_EXTRA_LIBS='-liconv'
make install

第二步:下载安装 PDO_MYSQL

wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

tar zxvf PDO_MYSQL-1.0.2.tgz && cd PDO_MYSQL-1.0.2/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mariadb

第三步:安装ZendOptimizer-3.3.9(可选)
ZendOptimizer的作用是分析,优化由Zend 编译器加密产生的代码的程序,对不是Zend编译器加密过的程序,没有必要安装这个。
64位:http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
32位:http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

cd /soft
http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
tar xzf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
cd ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/
mkdir -p /usr/local/zend/lib/
cp ZendOptimizer.so /usr/local/zend/lib

加载zendoptimizer,打开/usr/local/php/etc/php.ini文件,在配置文件的最底部加入如下代码:

[zend]
zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/lib/ZendOptimizer.so

遇到一些问题的解决办法:
1, configure: error: Cannot find ldap libraries in /usr/lib 解决办法

今天在centos 6.2 64位版本上安装LNMP,config php的时候出现下面错误而退出
configure: error: Cannot find ldap libraries in /usr/lib
解决办法:

cp -frp /usr/lib64/libldap* /usr/lib/

然后再./configure …即可

2, configure: error: libpng.(a|so) not found, libjpeg.(a|so)not found 的解决办法
http://blog.csdn.net/alexdream/article/details/7408438

解决configure: error: libpng.(a|so) not found. libjpeg.(a|so)not found

yum install libpng libpng-devel libjpeg libjpeg-deve

# ln -s /usr/lib64/libjpeg.so /usr/lib/
# ln -s /usr/lib64/libpng.so /usr/lib/

CentOS 下源码安装Varnish

一、下载源码编译安装 https://www.varnish-cache.org/

wget http://repo.varnish-cache.org/source/varnish-3.0.5.tar.gz
tar zxvf varnish-3.0.5.tar.gz && cd varnish-3.0.5
./autogen.sh
./configure --prefix=/usr/local/varnish PKG_CONFIG_PATH=/usr/lib/pkgconfig

make && make install

安装成功后,安装的目录是 /usr/local/varnish/

cd /usr/local/varnish/sbin

./varnishd -V

查看版本,看是否安装成功

Varnish启动脚本
1.在安装源文件目录下

cp redhat/varnish.initrc /etc/init.d/varnish
cp redhat/varnish.sysconfig /etc/sysconfig/varnish
cp redhat/varnish_reload_vcl /usr/bin/varnish_reload_vcl
chmod 755 /etc/init.d/varnish
#添加服务
chkconfig varnish on
vi /etc/sysconfig/varnish
#更改后的配置文件如下:
NFILES=131072
MEMLOCK=82000
DAEMON_OPTS="-a 0.0.0.0:80 \
             -T 127.0.0.1:6082 \
             -f /usr/local/varnish/sbin/varnishd -f /usr/local/varnish/etc/varnish/vcl.conf \
             -u www -g www \
             -p thread_pool_max=2048 \
             -p thread_pools=4 \
             -p client_http11=on \
             -s file,/data/cache/varnish_cache.data,1G"

测试varnish

先编辑配置文件

vi /etc/init.d/varnish
#配置文件如下:
#! /bin/sh
#
# varnish Control the Varnish Cache
#
# chkconfig: - 90 10
# description: Varnish is a high-perfomance HTTP accelerator
# processname: varnishd
# config: /etc/sysconfig/varnish
# pidfile: /var/run/varnishd.pid

### BEGIN INIT INFO
# Provides: varnish
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start:
# Default-Stop:
# Should-Start: $syslog
# Short-Description: start and stop varnishd
# Description: Varnish is a high-perfomance HTTP accelerator
### END INIT INFO

# Source function library.
. /etc/init.d/functions

retval=0
pidfile=/var/run/varnish.pid

exec="/usr/local/varnish/sbin/varnishd" #此处需修改成您当前服务器上的 varnish 安装路径
reload_exec="/usr/bin/varnish_reload_vcl"
prog="varnishd"
config="/etc/sysconfig/varnish"
lockfile="/var/lock/subsys/varnish"

# Include varnish defaults
[ -e /etc/sysconfig/varnish ] && . /etc/sysconfig/varnish


start() {

        if [ ! -x $exec ]
        then
                echo $exec not found
                exit 5
        fi

        if [ ! -f $config ]
        then
                echo $config not found
                exit 6
        fi
        echo -n "Starting Varnish Cache: "

        # Open files (usually 1024, which is way too small for varnish)
        ulimit -n ${NFILES:-131072}

        # Varnish wants to lock shared memory log in memory.
        ulimit -l ${MEMLOCK:-82000}

        # Maximum number of threads (default in CentOS is 1024, which
        # is often too small for varnish)
        ulimit -u ${NPROCS:-unlimited}

        # $DAEMON_OPTS is set in /etc/sysconfig/varnish. At least, one
        # has to set up a backend, or /tmp will be used, which is a bad idea.
        if [ "$DAEMON_OPTS" = "" ]; then
                echo "\$DAEMON_OPTS empty."
                echo -n "Please put configuration options in $config"
                return 6
        else
                # Varnish always gives output on STDOUT
                daemon --pidfile $pidfile  $exec -P $pidfile "$DAEMON_OPTS" > /dev/null 2>&1
                retval=$?
                if [ $retval -eq 0 ]
                then
                        touch $lockfile
                        echo_success
                        echo
                else
                        echo_failure
                        echo
                fi
                return $retval
        fi
}

stop() {
        echo -n "Stopping Varnish Cache: "
        killproc -p $pidfile $prog
        retval=$?
        echo
        [ $retval -eq 0 ] && rm -f $lockfile
        return $retval
}

restart() {
        stop
        start
}

reload() {
        if [ "$RELOAD_VCL" = "1" ]
        then
                $reload_exec
        else
                force_reload
        fi
}

force_reload() {
        restart
}

rh_status() {
        status -p $pidfile $prog
}

rh_status_q() {
        rh_status >/dev/null 2>&1
}

configtest() {
    if [ -f "$VARNISH_VCL_CONF" ]; then
        $exec -f "$VARNISH_VCL_CONF" -C -n /tmp > /dev/null && echo "Syntax ok"
    else
        echo "VARNISH_VCL_CONF is  unset or does not point to a file"
    fi
}

# See how we were called.
case "$1" in
        start)
                rh_status_q && exit 0
                $1
                ;;
        stop)
                rh_status_q || exit 0
                $1
                ;;
        restart)
                $1
                ;;
        reload)
                rh_status_q || exit 7
                $1
                ;;
        force-reload)
                force_reload
                ;;
        status)
                rh_status
                ;;
        condrestart|try-restart)
                rh_status_q || exit 0
                restart
                ;;
        configtest)
                configtest
                ;;
        *)
        echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"

        exit 2
esac

exit $?

未完待续。。。。

遇到问题1, No package ‘libpcre’ found
configure: error: libpcre not found

解决办法一:
安装 pcre pcre-devel,

yum install pcre pcre-devel

其他方案:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

遇到的问题2,varnishadm.c:48:33: error: editline/readline.h: No such file or directory
解决办法,安装libedit-devel

yum install *readline-devel*
yum install libedit libedit-dev*

轻松解决Wamp Server 2.2 Windows 7 64-bit and curl无法启动的问题

Wamp Server 2.2 Windows 7 64-bit and curl not working side-by-side configuration incorrect

在本机(Wamp Server 2.2 Windows 7 64位)上安装Wampserver 2.2.e 遇到Curl库无法启动的问题
导致 Magento 1.8.1.0 安装过程中提示 PHP extension “curl” must be loaded 的错误,安装无法继续。

墙外搜索得到了解决办法: 重新下载一个 php_curl.dll 覆盖 wamp\bin\php\php5.4.3\ext文件夹中的php_curl.dll ,重启 apache 服务器,问题顺利解决。具体说明在这里;wampserver 论坛的帖子在这里

为了方便翻—墙 有障碍的童鞋,这个php_curl.dll 我打包传到服务器,链接在下面,请尽情享用。

php_curl-5.4.3-VC9-x64下载

Discuz 设置后台 ImageMagick

首先,找到ImageMagick的主程序路径
执行命令查找

find / -name convert

如果编辑ImageMagick 的时候没有指定程序安装路径则主程序默认的安装路径为

/usr/local/bin/convert

我指定了ImageMagick的安装路径为 /usr/local/ImageMagick 因此我服务器上ImageMagick路径为

/usr/local/ImageMagick/bin/convert

更新系统路径信息,使新程序生效
sudo ldconfig /usr/local/lib

进入Discuz论坛后台:
全局=>上传设置=>图片处理库类型=>ImageMagick=>ImageMagick

程序安装路径: /usr/local/ImageMagick/bin/

提交确定就OK

测试一下,效果很好!