lnmp環(huán)境安裝詳細

yum -y install gcc gcc-c++ autoconf automake make
yum -y install pcre*
yum -y install openssl*
cd /usr/local/

#安裝nginx
curl http://nginx.org/download/nginx-1.7.8.tar.gz >> ./nginx-1.7.8.tar.gz
tar -xvf  nginx-1.7.8.tar.gz 
mv nginx-1.7.8 nginx
cd nginx

./configure --prefix=/usr/local/nginx-1.7.8 \
--with-http_ssl_module --with-http_spdy_module \
--with-http_stub_status_module --with-pcre

make
make install

vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/nginx-1.7.8/sbin
source ~/.bash_profile

/usr/local/nginx-1.7.8/sbin/nginx
/usr/local/nginx-1.7.8/sbin/nginx -s reload
/usr/local/nginx-1.7.8/sbin/nginx -s stop


yum -y install libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel curl curl-devel php-mcrypt libmcrypt libmcrypt-devel openssl-devel gd

#安裝加解密擴展庫,centos下會出現(xiàn)yum安裝不上的情況,需要手動安裝擴展
cd  /usr/local/src
curl http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz  >> ./libmcrypt-2.5.8.tar.gz
tar zxvf ./libmcrypt-2.5.8.tar.gz
cd cd libmcrypt-2.5.8
./configure
make
make install

#安裝php5.4
cd  /usr/local
curl http://cn.php.net/distributions/php-5.4.40.tar.gz  >> ./php-5.4.40.tar.gz
tar -xvf ./php-5.4.40.tar.gz
mkdir  /usr/local/php5.4

./configure --prefix=/usr/local/php5.4 --with-config-file-path=/usr/local/php5.4/etc  --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pear --with-gettext --enable-session --with-mcrypt --with-curl --with-libxml-dir=/usr/lib64 

make && make install

cp /usr/local/php-5.4.40/php.ini-production /usr/local/php5.4/lib/php.ini
cp /usr/local/php5.4/etc/php-fpm.conf.default /usr/local/php5.4/etc/php-fpm.conf 
/usr/local/php5.4/sbin/php-fpm
ps axu |fgrep php-fpm

vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/nginx-1.7.8/sbin:/usr/local/php5.4/bin
source ~/.bash_profile



#安裝mysql
#創(chuàng)建用戶組
groupadd mysql
#創(chuàng)建用戶
useradd -g mysql mysql


#安裝cmake,mysql5.1以上需要使用cmake編譯
yum install cmake ncurses-devel bison
cd /usr/local/
curl  http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.50.tar.gz >> ./mysql-5.5.50.tar.gz
tar -xvf mysql-5.5.50.tar.gz
cd mysql-5.5.50


#設(shè)置mysql用戶權(quán)限
chown -R mysql:mysql /usr/local/mysql5.5
mkdir /data/mysql/
chmod 777 /data/mysql/

#安裝數(shù)據(jù)庫
wget -O mysql5.5.tar.gz  http://mirrors.sohu.com/mysql/MySQL-5.5//mysql-5.5.55-linux2.6-x86_64.tar.gz
tar -xvf mysql5.5.tar.gz
 cd /usr/local/src/mysql-5.5.55 && cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5 -DMYSQL_DATADIR=/data/mysql5.5 -DSYSCONFDIR=/etc \
&& make && make install

#初始化數(shù)據(jù)庫
cd /usr/local/mysql5.5/scripts
./mysql_install_db --user=mysql --basedir=/usr/local/mysql5.5 --datadir=/data/mysql/

vi ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/php5.4/bin:/usr/local/nginx-1.7.8/sbin:/usr/local/mysql5.5/bin
source ~/.bash_profile
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容