Posted on

使用centos 7+nginx+mariadb+bedrock架設wordpress網站

1.sudo yum -y install epel-release

2.sudo rpm -Uvh



rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

yum install yum-utilsyum-config-manager –enable remi-php71



3.sudo vi /etc/yum.repos.d/nginx.repo


name=nginx repo




4.sudo yum -y update

5.sudo yum -y install nginx mariadb-server git libpng12

  1. yum -y install php-devel php-mysql php-opcache php-gd php-common php-xmlrpc php-mcrypt php-zip php-cli php-xml php-mbstring php-curl php-fpm

7.sudo firewall-cmd –permanent –zone=public –add-service=http

8.sudo firewall-cmd –permanent –zone=public –add-service=https

9.sudo firewall-cmd –permanent –zone=public –add-service=ftp

10.sudo firewall-cmd –reload

11.sudo systemctl restart nginx

12.sudo systemctl enable nginx

13.sudo vi /etc/nginx/conf.d/lab.conf

14.sudo vi /etc/opt/remi/php71/php.ini


15.sudo vi /etc /php-fpm.d/www.conf

user = nginx

group = nginx

listen.owner = nobody = nobody

16.sudo systemctl restart php-fpm

17.sudo systemctl enable php-fpm
17-1 install composer

17-2 install nodejs

17-3 install yarn


cd ~/.ssh

ssh-keygen -t rsa


git clone

mkdir /usr/share/nginx/

19.copy alter source code to /usr/share/nginx/

19-1.yum install tomcat

19-2 run ‘composer install’ in folder /usr/share/nginx/

19-3 run ‘composer install’ in folder /usr/share/nginx/

19-4 run ‘yarn” in folder /usr/share/nginx/

19-5 run ‘yarn build:production” in folder /usr/share/nginx/

19-6 chown -R nginx:nginx /usr/share/nginx/

20.sudo systemctl restart nginx

  1. sudo systemctl restart mariadb
    22.sudo systemctl enable mariadb

23. mysql_secure_installation24.mysql –u root –p25. create database alter_DB;26. grant all on alter_DB.* to ‘alter’@’localhost’ identified by ‘Aopen@1122’;27. flush privileges;28.exit