MySQL
安全
-- 建立新用戶和密碼
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpass';
-- 修改已有用戶的密碼
SET PASSWORD FOR 'existinguser'@'localhost' = PASSWORD('existingpass');
Nginx
CentOS
vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
Ubuntu
wget https://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
vim /etc/apt/sources.list
deb http://nginx.org/packages/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx
Version Codename Supported Platforms
12.04 precise x86_64, i386
14.04 trusty x86_64, i386, aarch64/arm64
16.04 xenial x86_64, i386, ppc64el, aarch64/arm64
16.10 yakkety x86_64, i386
http {
upstream myapp1 {
server srv1.example.com;
server srv2.example.com;
server srv3.example.com;
}
server {
listen 80;
location / {
proxy_pass http://myapp1;
}
}
}
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}