yum -y update yum install nginx 证书上传到 /etc/nginx都改名为cert.xxx rm -rf /etc/nginx//nginx.conf vim /etc/nginx//nginx.conf
user nginx;
worker_processes auto;
error_log / var / log/ nginx/ error. log;
pid / run/ nginx. pid;
include / usr/ share/ nginx/ modules/* . conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"' ;
access_log / var / log/ nginx/ access. log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include / etc/ nginx/ mime. types;
default_type application/ octet- stream;
include / etc/ nginx/ conf. d/* . conf;
server {
listen 80 default_server;
index index. html index. htm index. php;
rewrite ^( . * ) https:/ / $host $1 permanent;
server_name _;
root / usr/ share/ nginx/ html;
include / etc/ nginx/ default. d/* . conf;
location ~ . php$ {
fastcgi_pass 127. 0. 0. 1:9000;
fastcgi_index index. php;
fastcgi_param SCRIPT_FILENAME $document_root $fastcgi_script_name ;
include fastcgi_params;
}
location / {
}
error_page 404 / 404. html;
location = / 40x. html {
}
error_page 500 502 503 504 / 50x. html;
location = / 50x. html {
}
}
server {
listen 443 ssl http2 default_server;
index index. html index. htm index. php;
server_name _;
root / usr/ share/ nginx/ html;
ssl_certificate cert. pem;
ssl_certificate_key cert. key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:! aNULL:! MD5;
ssl_prefer_server_ciphers on;
include / etc/ nginx/ default. d/* . conf;
location ~ . php$ {
fastcgi_pass 127. 0. 0. 1:9000;
fastcgi_index index. php;
fastcgi_param SCRIPT_FILENAME $document_root $fastcgi_script_name ;
include fastcgi_params;
}
location / {
}
}
}
systemctl restart nginx systemctl enable nginx.service rm -rf /var/lib/mysql yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm yum repolist enabled | grep "mysql.*-community.*"
yum -y install mysql-community-server install mysql-community-devel systemctl start mysqld systemctl enable mysqld.service 9.grep 'temporary password' /var/log/mysqld.log
mysql -u root -p set global validate_password_policy=0; set global validate_password_mixed_case_count=0; set global validate_password_number_count=3; set global validate_password_special_char_count=0; set global validate_password_length=3; ALTER USER 'root'@'localhost' IDENTIFIED BY 'Yourpassword';
update user set host="%" where user="root";
quit systemctl restart mysqld rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum -y install php71w php71w-fpm php71w-mbstring php71w-common php71w-gd php71w-mcrypt php71w-mysql php71w-xml php71w-cli php71w-devel php71w-pecl-memcached php71w-pecl-redis php71w-opcache systemctl start php-fpm systemctl enable php-fpm.service