这几天手痒,随便到处看网页,看到张工的博客换成了budgetvm的一款vps,就研究研究了budgetvm的vps,发现似乎ping延迟、打开速度还行,然后看了一些网上的介绍,觉得可以整一个玩玩;就也跟随入手了一个,我选择的这款如下图所示:
选择的洛杉矶(Los Angeles, CA)的机房,据说洛杉矶机房针对天朝进行了线路优化,所以相对而言天朝访问速度还行。我所选的这款与张工一致,若需要测试速度可以点击刘工的博客自己整整看,个人认为米国的机房能达到这个速度就ok~
budgetvm地址:去瞧瞧
笔者是个偏执狂,不太喜欢已经集成好的web环境,一键安装太没意思,故而把本次安装配置过程记录如下:
一、安装约定
鄙人选择的64位centos6系统。
在根目录/下新建server目录,用于web环境安装,/server/libs是一些依赖库文件,/server/src下放置下载的软件包文件,/server/apps/下放置安装的软件文件,例如nginx,则在/server/apps/nginx下
cd /
mkdir server
cd /server
mkdir apps
mkdir src
mkdir libs
二、软件准备
cd /server/src
wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.33-linux2.6-x86_64.tar.gz
wget http://cn2.php.net/distributions/php-5.4.19.tar.gz
wget http://nginx.org/download/nginx-1.4.2.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.gz
wget http://www.ijg.org/files/jpegsrc.v9.tar.gz
wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.2.tar.gz
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
wget "https://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?big_mirror=0"
wget "https://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?big_mirror=0"
wget http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
三、软件安装
3.1、yum方式更新系统基本库文件
yum install wget
yum install pcre
yum install openssl*
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers make mhash
yum -y install gd gd2 gd-devel gd2-devel
3.2、安装nginx的正则匹配pcre库
cd /server/src
tar zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure --prefix=/server/libs
make && make install
cd ../
3.3、安装nginx服务器
groupadd nginx
useradd -g nginx nginxl -s /bin/false
tar zxvf nginx-1.5.2.tar.gz
cd nginx-1.5.2
./configure --user=nginx --group=nginx --prefix=/server/apps/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=//pcre-8.32 --with-http_realip_module --with-http_image_filter_module
make
make install
cd ../
3.4、安装mysql
tar zxvf mysql-5.5.33-linux2.6-x86_64.tar.gz
mv mysql-5.5.33-linux2.6-x86_64 /server/apps/mysql
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
mkdir -p /server/data/mysql/data
yum install libaio
/server/apps/mysql/scripts/mysql_install_db --basedir=/server/apps/mysql --datadir=/server/data/mysql/data --user=mysql
sed -i "s#/usr/local/mysql#/server/apps/mysql#g" /server/apps/mysql/bin/mysqld_safe
##处理mysql并更改mysql初始化账号密码
/server/apps/mysq/bin/mysqladmin -u root -p ##连续两次回车后会要求输入新密码 重复两次
3.5、安装PHP
3.5.1、安装php的依赖库
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-9/
./configure --prefix=/server/libs --enable-shared --enable-static --prefix=/server/libs
make
make install
cd ../
tar zxvf libpng-1.6.2.tar.gz
cd libpng-1.6.2/
./configure --prefix=/server/libs
make
make install
cd ../
tar zxvf freetype-2.4.12.tar.gz
cd freetype-2.4.12/
./configure --prefix=/server/libs
make
make install
cd ../
wget "https://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?big_mirror=0"
wget "https://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?big_mirror=0"
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure --prefix=/server/libs
make
make install
cd libltdl/
./configure --prefix=/server/libs --enable-ltdl-install
make
make install
cd ../../
3.5.2、安装php的加密模块mcrypt
vi /etc/ld.so.conf
#在该文件中添加 /server/libs
ldconfig
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
export LDFLAGS="-L/server/libs/lib -L/usr/lib"
export CFLAGS="-I/server/libs/include -I/usr/include"
touch malloc.h
./configure --prefix=/server/libs --with-libmcrypt-prefix=/server/libs
make
make install
cd ../
5.5.3、编译安装php
tar zxvf php-5.4.19.tar.gz
--prefix=/usr/local/php --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-config-file-path=/server/apps/php/etc --with-config-file-scan-dir=/server/appsl/php/etc/ini --with-mysql=/server/apps/mysql --with-mysqli=/server/apps/mysql/bin/mysql_config --with-mcrypt=/server/libs --with-pcre-regex=/server/libs --with-zlib --enable-zip --with-zlib-dir=/usr --enable-bcmath --with-curl=/server/libs --with-pcre-dir=/server/libs --with-libxml-dir=/usr --enable-ftp --with-openssl --with-openssl-dir=/usr --with-png-dir=/server/libs --with-jpeg-dir=/server/libs --with-freetype-dir=/server/libs --with-gd --with-xmlrpc --enable-soap --enable-mbstring --enable-sockets --enable-pcntl --enable-mysqlnd --with-mhash --with-pear
make
make install
cp php.ini-development /Data/apps/php/etc/php.ini
cd ../
5.6、编译安装php的其他扩展则依据不同的需求自我编译安装,此处不再赘述
四、安装pptpd用于vpn代理fanqiang
此处安装较为麻烦,从网上找到了一个一键安装sh脚本,测试可用。
可以参考如下地址的文章:https://www.cnidc.in/2012/12/1205.html
不过要提醒的是安装vpn前先得在vps的控制台开启tun、ppp,如下图所示:
至于上述文章中提到的一键安装vpn后,添加账号的问题,可以如下操作:
vi /etc/ppp/chap-secrets ##然后依据已有的格式添加自己的vpn拨号账号即可
至于在天朝的电脑如何使用vpn拨号则更简单了,如下不再文字介绍,直接图片(按图片顺序依次进行各步骤操作)
最后打开桌面上的vpn链接,输入您的账号、密码即可fanqiang了
这家很垃圾,欺诈客户。并且服务态度非常不好。。当心啊~~~