2016年4月22日 星期五

Install the latest Nginx and PHP in Ubuntu 16.04 with OpenCC, GeoIP and Imagick

#Install Aptitude
apt-get update
apt-get install aptitude

#Install Ubuntu Essential
aptitude update
aptitude dist-upgrade
aptitude install dstat build-essential fail2ban git
aptitude install python-software-properties

#Install the Latest Nginx:
add-apt-repository ppa:nginx/development
aptitude update
aptitude install nginx

#Install the Latest PHP7.0:
add-apt-repository ppa:ondrej/php
aptitude update
aptitude install php7.0-fpm php7.0-cli php7.0-curl php7.0-mysql php7.0-dev php7.0-cli php7.0-common php7.0-mbstring php7.0-intl

#Install the Latest GeoIP:
aptitude install libgeoip-dev
aptitude install git
git clone https://github.com/Zakay/geoip.git
cd geoip
phpize
./configure --with-php-config=/usr/bin/php-config
make
make install
echo "extension=geoip.so" > /etc/php/7.0/mods-available/geoip.ini
ln -s /etc/php/7.0/mods-available/geoip.ini /etc/php/7.0/cli/conf.d/20-geoip.ini
ln -s /etc/php/7.0/mods-available/geoip.ini /etc/php/7.0/fpm/conf.d/20-geoip.ini

#Install the Latest Imagick:
aptitude install libmagickwand-dev libmagickcore-dev
git clone https://github.com/mkoppanen/imagick.git
cd imagick
phpize
./configure --with-php-config=/usr/bin/php-config
make
make install
echo "extension=imagick.so" > /etc/php/7.0/mods-available/imagick.ini
ln -s /etc/php/7.0/mods-available/imagick.ini /etc/php/7.0/cli/conf.d/20-imagick.ini
ln -s /etc/php/7.0/mods-available/imagick.ini /etc/php/7.0/fpm/conf.d/20-imagick.ini

#Install the Latest OpenCC
aptitude install cmake doxygen
git clone https://github.com/BYVoid/OpenCC.git
cd OpenCC
make
sudo make install
git clone https://github.com/NauxLiu/opencc4php
cd opencc4php
phpize
./configure --with-php-config=/usr/bin/php-config
make
sudo make install
echo "extension=opencc.so" > /etc/php/7.0/mods-available/opencc.ini
ln -s /etc/php/7.0/mods-available/opencc.ini /etc/php/7.0/cli/conf.d/20-opencc.ini
ln -s /etc/php/7.0/mods-available/opencc.ini /etc/php/7.0/fpm/conf.d/20-opencc.ini


#Install Railgun
echo 'deb http://pkg.cloudflare.com/ wily main' | sudo tee /etc/apt/sources.list.d/cloudflare-main.list
curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add -
aptitude update
aptitude install memcached railgun-stable

沒有留言:

張貼留言