Install LNMP + wordpress on aliyun Centos7

  • 2020-05-10 23:20:26
  • OfStack

1. Install Nginx


#yum install nginx      # Configuration file in /etc/nginx
#systemctl start nginx   # Start the nginx
#systemctl enable nginx.service  #  Set to boot 

#systemctl status firewalld  # Check the firewall if it is active (running) , 
#vim /etc/firewalld/zones/public.xml   #  in zone

<zone>
 ... 
<service name= " nginx " />
<zone>
#systemctl reload firewalld

Test: http://114.215.172.90/     114.215.172.90

2. Install Mysql(not MariaDB)


#rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
#yum repolist enabled | grep  " mysql.*-community.* " 
#yum -y install mysql-community-server

#yum -y install mysql-community-server   # Install community edition 
#systemctl start mysqld                  #  Start the mysql
#mysql_secure_installation              # mysql Secure installation, enter root Password, 1 Road, y

3. Install PHP


#yum install php-fpm php-mysql
#systemctl start php-fpm        #  Start the php-fpm
#systemctl enable php-fpm      #  Set boot 

#mkdir /var/www
#chown -R apache:apache /var/www

Modify the configuration files of the Nginx: in/etc nginx/conf d directory wordpress. New conf


server {
listen 8000;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.php$ {
root /usr/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}


#systemctl reload nginx

Create phpinfo.php in the /usr/www directory


<?php echo phpinfo(); ?>

External access: http: / / 114.215.172.90:8000 / phpinfo php

4. Install wordpress

From https: / / cn. wordpress. org/download wordpress - 4.4.2 - zh_CN. tar. gz, into/usr/www
Create the wordpress database


#mysql -uroot -p
#create database wordpress

Through the http: / / 114.215.172.90:8000 / wordpress access, and installation of tips for installation, need to add the middle mysql user name and password, and formulate the wordpress related user name and password, and then create success.

http: / / 114.215.172.90:8000 / wordpress/access can be, also can click on the landing page for page setup and related management work.


Related articles: