Press "Enter" to skip to content

centos7安装最新lnmp

零、前置依赖

yum -y install libxml2-devel openssl-devel sqlite-devel libcurl-devel libicu-devel gcc-c++ oniguruma oniguruma-devel libxslt-devel libpng-devel libjpeg-devel freetype-devel

一、Nginx

1.下载:https://nginx.org/en/download.html (建议稳定版)

2.自定义编译参数:

./configure \
--prefix=/usr/local/nginx \
--conf-path=/usr/local/nginx/conf/nginx.conf \
--pid-path=/usr/local/nginx/conf/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi

3.安装

make && make install

4.添加系统命令

https://www.nginx.com/resources/wiki/start/topics/examples/redhatnginxinit/

5.添加权限和开机启动:

chmod 755 /etc/init.d/nginx
chkconfig --add nginx

二、Mysql 8.0

1.下载rpm源

https://dev.mysql.com/downloads/repo/yum/

2.安装mysql8.0

yum -y install mysql80-community-release-el7-2.noarch.rpm
yum -y install mysql-community-server

3.启动并修改密码

service mysqld start
#查找密码
grep "password" /var/log/mysqld.log
#登录
mysql -u root -p
#修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword';

三、PHP 7.1.12

1.下载并解压

https://www.php.net/downloads.php#v7.4.12

2.自定义编译参数

可能会遇到libzip 依赖问题:

#卸载老版本的libzip
yum remove libzip
#下载安装libzip-1.2.0
wget https://libzip.org/download/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

其他问题:https://www.xstnet.com/article-152.html

四、Redis 6.x

https://blog.csdn.net/u022812849/article/details/108021517

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Captcha Code