WordPress 安装记录
Installed WordPress 6.5.3 on Centos 8
This is to recording the process of my installation, also want to be as simple as possible.
Login as root
Install MariaDB which is database MySQL’s community’s version
#yum install ImageMagick
#dnf install mariadb
#systemctl enable mariadb
#systemctl start mariadb
Install nginx which is http server
#dnf install nginx
modify /etc/nginx/nginx.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name domainname.com;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
#pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#systemctl enable nginx
#systemctl start nginx
Install php and all the php related software
#dnf install php*
modify /etc/php-fpm.d/www.conf , enable php-fpm to use nginx user
user = nginx
group = nginx
#systemctl start php-fpm
#systemctl enable php-fpm
create database and user
#mysql
CREATE DATABASE wordpress;
CREATE USER 'user'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON wordpress.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
\q
#cd /usr/share/nginx/html
#wget https://wordpress.org/latest.zip
#unzip latest.zip
#chown -R nginx.nginx wordpress
//you can change folder wordpress to yourname now or move all the content directly under html //folder, (this means there do not have context url)
#rm -rf latest.zip
access 3 of below link as set previously
http://domainname.com/wordpress
http://domainname.com/yourname
then follow instruction on page to add wp-config.php file at /usr/share/nginx/html/wordpress,
and do other settings.
And then , welcome your wordpress