• 欢迎访问我的个人博客网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 如果您觉得本站对您有用,那么赶紧使用Ctrl+D收藏吧!
  • 相关内容持续完善中......

LNMP安装

服务安装 hubin 1年前 (2018-01-24) 361次浏览 0个评论 扫描二维码

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

 

 

 


本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:LNMP安装
喜欢 (1)
hubin
关于作者:
头像
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

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