Ubuntu 14.04 搜狐更新源及安装软件
sudo vim /etc/apt/source.list
# 将软件源改为 sohu 的
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
2. 更新并升级已有软件,并安装一些基础依赖库
apt-get update
apt-get upgrade
apt-get install libcurl3-dbg curl libpcre3 libpcre3-dev libcurl4-openssl-dev libyaml-dev
3. 安装软件
•Nginx/MySQL/Redis/Git/SVN
apt-get install nginx mysql-server redis-server git subversion
•PHP 及核心扩展
apt-get install php5
# 中途出现 apache 相关的警告和错误,说明系统默认安装了 Apache,卸载之
apt-get remove apache2
apt-get autoremove
# 安装核心扩展
apt-get install php5-dev php5-cgi php5-cli php5-fpm php5-common php5-mysql php5-curl php5-dbg php5-json php5-gd php5-mcrypt php5-redis
•Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
•PHP 在 PECL 上的扩展 Yaf/Yar 等扩展
pecl install yaml
pecl install yaf
pecl isntall yar
•Phalcon
# 下载的源码放在 /source 目录下
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
配置
sudo vim /etc/php5/mods-available/private.ini
extension=yaml.so
extension=yaf.so
extension=yar.so
extension=phalcon.so
extension=swoole.so
ln -s /etc/php5/mods-available/private.ini /etc/php5/fpm/conf.d/30-private.ini
ln -s /etc/php5/mods-available/private.ini /etc/php5/cli/conf.d/30-private.ini
ln -s /etc/php5/mods-available/private.ini /etc/php5/cgi/conf.d/30-private.ini