Environment
name | version | remark |
---|---|---|
OS | Ubuntu 18.04 | Bionic Beaver |
Nginx | 1.14.0 | |
PHP | 7.2 | |
Mysql | 8.0 | Client |
Install Nginx
1 | sudo apt install nginx |
Install MySQL
1 | # add mysql apt repo |
Install PHP7 and Modules
1 | sudo apt install php7.2 php7.2-mbstring php7.2-xml php7.2-fpm php7.2-mysql php7.2-curl |
Install Composer
Composer official site: https://getcomposer.org
Manually install
1 | # download latest snapshot |
Other Configurations
MySQL Import Tuning
At the beginning, login mysql , then run following commands:
1 | SET autocommit=0; |
then import sql files, and at the end
1 | COMMIT; |
SELinux Settings
As centos enable SELinux as default, and SELinux is preventing httpd from read access on the file and access db, we need to allow them.
Note: if cloud server disable the SELinux or allow relevant httpd services, the following commands doesn’t need, so try to see SELinux status first.
1 | # show se status |
Nginx Configuration Example
1 | server { |
Google PageSpeed Module (optional)
Official site: https://developers.google.com/speed/pagespeed/module/
Firewall Configuration
UFW: https://help.ubuntu.com/community/UFW
UFW - Uncomplicated Firewall
The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall. By default UFW is >disabled.
1 | sudo ufw status |