centos7:搭建部署lnmp

1. 环境准备
    $ sudo yum install wget gcc*
    # 关闭selinux、firewalld等
2. nginx
1) 创建nginx账号
2) install nginx
    # 安装相关包
    $ sudo yum install pcre* zlib* openssl*
    $ cd /opt
    $ sudo wget http://nginx.org/download/nginx-1.15.2.tar.gz
    $ sudo tar xf nginx-1.15.2.tar.gz
    $ cd nginx-1.15.2
    $ sudo ./configure --prefix=/usr/local/nginx
    $ sudo make && sudo make install
3) 配置nginx文件
    $ sudo vim nginx.conf
        user nginx nginx;---> add this line to line 3
4) 设置nginx为系统服务
    $ cat /lib/systemd/system/nginx.service
        [Unit]
        Description=nginx
        After=network.target
        [Service]
        Type=forking
        ExecStart=/usr/local/nginx/sbin/nginx
        ExecStop=/usr/local/nginx/sbin/nginx -s stop
5) 启动nginx
    $ sudo systemctl start nginx.service
6) 访问
    brows:http://ip

centos7:搭建部署lnmp_第1张图片

3、编译安装mysql数据库

请参考文档:https://blog.csdn.net/qq_34889607/article/details/79975205

 

 

参考文档:https://www.cnblogs.com/wujuntian/p/8183952.html

你可能感兴趣的:(lnmp)