centos7-server config

centos7.2 64bit
nginx version: nginx/1.12.2
sqlite 3.7.17-8.el7

使用 docker 搭建生产环境

安装nginx

yum -y update
yum install epel-release
yum install nginx

systemctl start nginx
systemctl enable nginx
systemctl status nginx

the configuration file /etc/nginx/nginx.conf

配置防火墙

firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --zone=public --permanent --add-service=https
firewall-cmd --reload

测试

http://SERVER_DOMAIN_NAME_OR_IP

配置文件和路径

默认web服务路径/etc/nginx
主配置文件 /etc/nginx/nginx.conf
虚拟主机配置文件可以添加到 /etc/nginx/conf.d
默认文档 /usr/share/nginx/html

sqlite3

sudo yum install sqlite-devel
sqlite3 -version

php5

配置yum源

sudo yum install epel-release
sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

查看可安装的包

sudo yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
sudo yum install yum-utils