你的位置:首页 > 操作系统

[操作系统]初始化 Ubuntu Trusty 14.04


1. 软件源

sudo vim /etc/apt/source.list# 将软件源改为 sohu 的deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

2. 更新并升级已有软件,并安装一些基础依赖库

apt-get update apt-get upgradeapt-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 apache2apt-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 | phpsudo mv composer.phar /usr/local/bin/composer

  • PHP 在 PECL 上的扩展 Yaf/Yar 等扩展
    pecl install yamlpecl install yaf pecl isntall yar

  • Phalcon
    # 下载的源码放在 /source 目录下git clone --depth=1 git://github.com/phalcon/cphalcon.gitcd cphalcon/buildsudo ./install

    配置

    sudo vim /etc/php5/mods-available/private.iniextension=yaml.soextension=yaf.soextension=yar.soextension=phalcon.soextension=swoole.soln -s /etc/php5/mods-available/private.ini /etc/php5/fpm/conf.d/30-private.iniln -s /etc/php5/mods-available/private.ini /etc/php5/cli/conf.d/30-private.iniln -s /etc/php5/mods-available/private.ini /etc/php5/cgi/conf.d/30-private.ini