摘要
nginx 安装
安装依赖
1 | yum -y install gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel openssl openssl-devel |
下载稳定版nginx
nginx.org
创建nginx管理用户
1 | useradd nginx -s /sbin/nologin -M |
解压到/usr/local/src,进入目录,编译
1 | ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx-1.16.0/ --with-http_ssl_module --with-http_stub_status_module |
创建目录,创建软链
1 | mkdir /data/service |
创建开机启动文件
1 | vim /usr/lib/systemd/system/nginx.service |
1 | [Unit] |
创建开机自启,启动服务
1 | systemctl enable nginx.service |
注意 如果修改了service文件要执行重载命令
1 | systemctl daemon-reload |
Mariadb
安装软件
1 | yum install -y mariadb mariadb-server |
启动,设置开机启动
1 | systemctl start mariadb |
给root设置密码
1 | mysqladmin -u root password "123456" |
登录,创建论坛数据库用户和库
1 | create database bbs; |
php
## 更新PHP软件下载源
1 | rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
PHP程序相关软件下载安装
1 | yum install -y php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-gd php71w-mcrypt php71w-mbstring php71w-pdo php71w-xml php71w-fpm php71w-mysqlnd php71w-opcache php71w-pecl-memcached php71w-pecl-redis php71w-pecl-mongodb |
PHP启动,设置开机自启动
1 | systemctl start php-fpm |
搭建论坛
下载安装包,解压
1 | https://addon.dismall.com/ |