欢迎光临
一直在努力

LNMP安装

Nginx安装:

1)安装nginx所需要的依赖包:

yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd-devel perl perl-ExtUtils-Embed

2)解压tar包,安装nginx:

tar -zxf nginx-1.4.7.tar.gz

cd nginx/

./configure –prefix=/usr/local/nginx –with-ipv6 –with-http_ssl_module –with-http_realip_module –with-http_addition_module –with-http_dav_module –with-http_flv_modlule –with-http_mp4_module –with-http_gzip_static_module –with-http_perl_module –with-mail –with-mail_ssl_module

make && make install

Mysql安装:

1)创建用户和组:groupadd mysql;useradd -r -s /sbin/nologin -g mysql mysql

2)安装mysql需要的依赖包:

yum install -y gcc make cmake ncurses-devel libxml2-devel libtool-ltdl-devel gcc-c++ autoconf automake bison zlib-devel

3)解压tar包,安装mysql:

tar -zxf mysql-5.5.59.tar.gz

cd mysql-5.5.59/

cmake . -DENABLE_DOWNLOADS=1

make && make install

4)初始化mysql:

cd /usr/local/mysql/

scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql/ –datadir=/usr/local/mysql/data/

cp support-files/my-small.cnf /etc/my.cnf

cp support-files/mysql.server /etc/init.d/mysqld修改basedir和datadir

PHP安装:

1)创建用户和组:

groupadd nginx;useradd -r -s /sbin/nologin -g nginx nginx

2)安装所需要的依赖包:

yum -y install libcurl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel

3)解压tar包,安装php:

tar -zxf php-5.6.33.tar.gz

cd php-5.6.33/

./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc/ –enable-fpm –with-fpm-user=nginx –with-fpm-group=nginx –with-mysql=/usr/local/mysql –with-mysql-sock=/tmp/mysql.sock –with-libxml-dir –with-gd –with-jpeg-dir –with-png-dir –with-freetype-dir –with-iconv-dir –with-zlib-dir –with-mcrypt –enable-soap –enable-gd-native-ttf –enable-ftp –enable-mbstring –enable-exif –enable-zend-multibyte –disable-ipv6 –with-pear –with-curl –with-openssl

make && make install

cp php.ini-development /usr/local/php/etc/php.ini

cd /usr/local/php/etc/

cp php-fpm.conf.default php-fpm.conf

 

 

 

赞(0)
未经允许不得转载:在路上 » LNMP安装

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址