服務器環境搭建 v2

PHP & NGINX

sudo su
yum -y install gcc
yum -y install gcc-c++
yum -y install zip unzip
yum -y install lrzsz
yum -y install mlocate
yum -y install libtool
yum -y install zlib
yum -y install pcre-devel
yum -y install libxml2 libxml2-devel
yum -y install freetype freetype-devel
yum -y install libpng libpng-devel
yum -y install jpegsrc libjpeg-devel
yum -y install gd
yum -y install curl curl-devel
yum -y install openssl openssl-devel
yum -y install libmcrypt libmcrypt-devel
mkdir -p /data/dev
mkdir -p /data/game
mkdir -p /data/www
mkdir -p /data/log/nginx
mkdir -p /data/log/php-fpm
mkdir -p /data/config
mkdir -p /data/soft
cd /data/soft/

unzip web_install.zip
cd /data/soft/web_install/
cp php-5.6.13.tar.gz /data/soft/php-5.6.13.tar.gz
cp nginx-1.8.0.tar.gz /data/soft/nginx-1.8.0.tar.gz
cp openssl-1.0.1g.tar.gz /data/soft/openssl-1.0.1g.tar.gz
cp zlib-1.2.8.tar.gz /data/soft/zlib-1.2.8.tar.gz
cp pcre-8.35.zip /data/soft/pcre-8.35.zip
cd /data/soft/
tar zxvf php-5.6.13.tar.gz
tar zxvf nginx-1.8.0.tar.gz
tar zxvf openssl-1.0.1g.tar.gz
tar zxvf zlib-1.2.8.tar.gz
unzip pcre-8.35.zip

cd /data/soft/nginx-1.8.0/
groupadd nginx
useradd -g nginx nginx -s /bin/false
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_realip_module --with-http_ssl_module --with-pcre=/data/soft/pcre-8.35  --with-openssl=/data/soft/openssl-1.0.1g --with-zlib=/data/soft/zlib-1.2.8
make && make install

cd /data/soft/php-5.6.13/
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib --with-curl --with-gd --enable-gd-jis-conv --enable-gd-native-ttf --with-mysql --with-mysqli --enable-fpm --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-debug --enable-mbstring --enable-soap --enable-sockets --enable-zip --with-openssl-dir --with-mcrypt --with-pdo-mysql --without-pdo-sqlite --without-pear --enable-opcache
make && make install

cd /data/soft/web_install/
\cp -f php.ini /usr/local/php/lib/php.ini
\cp -f php-fpm.conf /usr/local/php/etc/php-fpm.conf
\cp -f nginx.conf /usr/local/nginx/conf/nginx.conf
\cp -f nginx.server.conf /data/config/nginx.server.conf
\cp -f nginx.location.website.conf /data/config/nginx.location.website.conf
\cp -f php-fpm /etc/init.d/php-fpm
\cp -f nignx /etc/init.d/nginx
chmod 700 /etc/init.d/php-fpm
chmod 700 /etc/init.d/nginx

echo "
syntax on
set tabstop=4
set softtabstop=4
set cindent shiftwidth=4
set enc=utf-8
set fenc=utf-8" >> /etc/vimrc
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章