CentOS7LNMP environment install wordpress
Foreword
Previous article configured the LNMP environment, now and install wordpress data before migration.
Need to use the tools xshell6, xftp.
build database
mysql -uroot -p # 用之前设置的密码登陆mysql
mysql>create database wordpress; # 创建wordpress数据库
mysql>use wordpress; #切换到wordpress数据库
mysql>exit # 退出mysql
Install wordpress
New folder wp
mkdir wp
cd wp
yum -y install wget unzip net-tools
wget http://wordpress.org/latest.zip
Download the latest version here, in order to prevent incompatible with PHP version, you can go here to choose the right download their own version of wordpress
Create a wordpress installation directory
mkdir /var/www/wordpress
Extracting and copy it to / var / www / wordpress directory
unzip -q latest.zip
cp -rf wordpress/* /var/www/wordpress/
This directory is not unique, and requires root of the site nginx configuration to be consistent
Configuration wordpress
Modify the configuration wordpress
cd /var/www/wordpress
cp wp-config-sample.php wp-config.php
vi wp-config.php
After opening the file, press the i button or insert key to enter the edit mode, modify the following format (which wordpressdb database name, wordpressuser for the database user name and password for the database 123456)
// * MySQL settings - You can get this info from your web host * //
/* The name of the database for WordPress /
define(‘DB_NAME’, ‘wordpressdb’);
/* mysql database username /
define(‘DB_USER’, ‘wordpressuser’);
/* MySQL database password /
define(‘DB_PASSWORD’, ‘123456’);
Modify folder permissions
chown -R nginx:nginx /var/www/wordpress/
chmod -R 755 /var/www/wordpress/
mkdir -p /var/www/wordpress/wp-content/uploads
chown -R :nginx /var/www/wordpress/wp-content/uploads
You can simply point chmod 777 wordpress
Restart related services
systemctl restart php-fpm.service
systemctl restart nginx.service
service mysqld restart
Wordperss personal configuration
Well, now your wordpress already configured, you can continue your wordpress installation by domain logon htttp: // xxxx / visit your blog (xxxx is your server public IP), in accordance with their own preferences related settings.
Migrating data
Migrating data we have to wait again after Wordpress installation was successful migration, before you want to migrate site data backup.
What backup?
- backup database. In the original backup server database, stored in the database is we write articles, so be sure to back up!
- Back up server data. The server does not need all the backup data, as long as you can back up important data.
wp-content \ themes are stored under the theme directory
wp-content \ plugins are stored under the plugins directory
stored under wp-content \ uploads is an accessory catalog (including pictures)
need only these three backup directory can be!
How to restore?
Installation WordPress: WordPress is installed on the new server.
File recovery site: After the installation of three backup folder themes, plug-ins and accessories to resume next wp_content directory. Xftp tool can be used here. (Note! This is not directly covered , I direct coverage on the tragedy, not open the site, Xin loss I have a backup, the selection of the content needed to restore the past)
Database recovery: Restore the database backup file to the new database.
Welcome to reprint, please indicate the source!
Independent domain name blog: flywill.com
welcome attention to the public micro signal: Java town of V
share their learning & learning materials & living
friend wants to communicate can also be added into the group Micro Signal Note: EscUpDn