时间:2021-07-01 10:21:17 帮助过:40人阅读
sudo apt-get update apt-get install mysql server mysql-client apt-get install nginx apt-get install php7.2 php-mysql php7.2-fpm php-pear php7.2-curl php7.2-json php7.2-cgi php7.2-mysql
sudo scp filepath root@serverhost:~解压证书放到/etc/ssl/wordpress/下(按照你的需求选择,这里的演示将使用该路径) 解压命令
zip文件解压 sudo unzip youfile.zip -d /etc/ssl/wordpress/ tar文件解压 tar -zxvf youfile.tar -c /etc/ssl/wordpress
修改nginx配置文件 路径一般在:vi /etc/nginx/sites-available/default 修改内容如下:
server { #监听80http端口 #listen 80 default_server; #listen [::]:80 default_server; # SSL configuration #SSL配置 监听443SSL端口 https listen 443 ssl; listen [::]:443 ssl; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don‘t use them in a production server! # # include snippets/snakeoil.conf; #网站路径。 root /var/www/wordpress; #SSL证书配置 注意 这里要填写你证书的路径里的两个文件,这里是我的pem和key文件 ssl_certificate /etc/ssl/wordpress/fechain.pem; ssl_certificate_key /etc/ssl/wordpress/private.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; # Add index.php to the list if you are using PHP #网站主页配置 php主页记得加index.php index index.html index.htm index.php; #填写你的服务器 server_name hhxblog.ml; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } # pass PHP scripts to FastCGI server #启用php,fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;对应你的php-fpm版本 location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; } # deny access to .htaccess files, if Apache‘s document root # concurs with nginx‘s one # #location ~ /\.ht { # deny all; #} }
重启nginx service nginx start (这里报错可能是上面的配置错误了)
$ mysql -u adminusername -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5340 to server version: 3.23.54 Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the buffer. mysql> CREATE DATABASE databasename; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname" -> IDENTIFIED BY "password"; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.01 sec) mysql> EXIT Bye $
在服务器上搭建wordpress个人博客 php7.2+nginx+mysql+wordperss
标签:lan 一个 php clear decode 报错 host nginx配置 star