欢迎光临,赤鹿小组
记录过程,分享经验

LNMP 环境部署安装

MySQL部署安装

[[email protected] ~] wget http://dev.mysql.com/get/mysq l57-community-release-el 7-8.noarch.rpm
[[email protected] ~] yum -y localinstall mysql 57-community-release-el 7-8.noarch.rpm
[[email protected] ~] yum repolist enabled | grep "mysql.*-community.*"
[[email protected] ~] yum -y install mysql-community-server
[[email protected] ~] systemctl start mysqld

Nginx安装部署

[[email protected] ~] wget http://nginx.org/download/nginx-1.2.0.tar.gz
[[email protected] ~] yum -y install gcc pcre-devel openssl-devel
[[email protected] ~] tar -xf nginx-1.2.0.tar.gz
[[email protected] ~] cd nginx-1.2.0/
[[email protected] nginx-1.2.0] useradd -s /sbin/nologin nginx
[[email protected] nginx-1.2.0] ./configure   \
> --prefix=/usr/local/nginx   \            # 指定安装路径
> --user=nginx                             # 指定用户
> --group=nginx  \                         # 指定组
> --with-http_ssl_module                   # 开启SSL加密功能

编译安装

[[email protected] nginx-1.2.0] make
[[email protected] nginx-1.2.0] make install

创建软连接,启动服务

[[email protected] nginx-1.2.0] ln -s /usr/local/sbin/nginx /sbin/
[[email protected] nginx-1.2.0] nginx

启用 nginx 里面 php 的配置 fastcgi_params 要改为 fastcgi.conf;

[[email protected] nginx-1.2.0]# nginx –s reload

php安装部署

由于 yum 源有 php 的安装包所以就可以直接安装 php

[[email protected] ~] yum –y install php-fpm
[[email protected]ng ~] systemctl start php-fpm

测试:

赞(0)

评论 抢沙发

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