In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to configure WordPress in Centos". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to configure WordPress in Centos.
Before using wordpress, you need to install LEMP on your VPS. If you don't have Linux, Nginx, MySQL and PHP servers, you can find the tutorials set it here.
Once you have the users and the software you need, you can start installing wordpress!
Step 1: download WordPress
We can download Wordpress directly from their website:
Wget http://wordpress.org/latest.tar.gz
This command downloads the compressed wordpress package directly to the user's home directory. You can extract it to the next line:
Tar-xzvf latest.tar.gz step 2: create the WordPress database and users
After we unzip the wordpress files, they will be in a directory called wordpress in the home directory.
Now we need to switch gears for a while and create a new MySQL directory for wordpress.
Continue to log in to MySQL Shell:
Mysql-u root-p
Log in with your MySQL root password, then we need to create a wordpress database for the user in the database and give the user a new password. Remember that all MySQL commands must end with a semicolon.
First, let's do the database (I call my wordpress; to give it any name I want to keep it simple):
CREATE DATABASE wordpress;Query OK, 1 row affected (0.00 sec)
Then we need to create a new user. You can replace it with any database, name and password you like:
CREATE USER wordpressuser@localhost;Query OK, 0 rows affected (0.00 sec)
Set the password for the new user:
SET PASSWORD FOR wordpressuser@localhost= PASSWORD ("password"); Query OK, 0 rows affected (0.00 sec)
Complete all permissions granted to the new user. Without this command, wordpress setup will not start:
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';Query OK, 0 rows affected (0.00 sec)
Then refresh the MySQL:
FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec) exit MySQL shell:exit step 3: set WordPress configuration
The first step is to copy the sample WordPress configuration file located in the WordPress directory into the new file we are going to edit to create a new available WordPress configuration:
Cp ~ / wordpress/wp-config-sample.php ~ / wordpress/wp-config.php
Then open wordpress config:
Sudo nano ~ / wordpress/wp-config.php
Locate the section that contains the following fields and replace it with the correct name of the database, username, and password:
/ / * * MySQL settings-You can get this info from your web host * * / / * The name of the database for WordPress * / define ('DB_NAME',' wordpress'); / * * MySQL database username * / define ('DB_USER',' wordpressuser'); / * * MySQL database password * / define ('DB_PASSWORD',' password')
Save and exit.
Step 4: copy the file
We almost finished uploading Wordpress to the server. We need to create the directory where we will keep the wordpress file:
Sudo mkdir-p / var/www/wordpress
The final step is to transfer the unzipped WordPress file to the root of the site.
Sudo cp-r ~ / wordpress/* / var/www/wordpress
We can modify the permissions / var/www to make future automatic WordPress plug-ins and files with SFTP editing updates. If you do not perform these steps, you may receive the error message "connection information is required to perform the requested operation" when you try any task.
First, change to the web directory:
Cd / var/www/
Give ownership of the directory to the nginx user and replace the user name with the name of the server user.
Sudo chown nginx:nginx *-Rsudo usermod-a-G nginx username step 5: set up the Nginx server
Now we need to set up the WordPress virtual host. Although Wordpress has an extra step in the installation, the nginx website gives us a simple configuration file:
Open the default nginx default hosts file:
Sudo vi / etc/nginx/conf.d/default.conf
The configuration should include the following changes (details of the changes are under configuration information):
# # The default server#server {listen 80; server_name _; # charset koi8-r; # access_log logs/host.access.log main; location / {root / var/www/wordpress; index index.php index.html index.htm;} error_page 404 / 404.html; location = / 404.html {root / usr/share/nginx/html } # redirect server error pages to the static page / 50x.html # error_page 500 502 503 504 / 50x.html; location = / 50x.html {root / usr/share/nginx/html;} # proxy the PHP scripts to Apache listening on 127.0.0.1 error_page 80 # # location ~\. Php$ {# proxy_pass #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1 php$ 9000 # location ~\. Php$ {root / var/www/wordpress; fastcgi_pass 127.0.0.1 root 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # # location ~ /\ .ht {# deny all; #}}
Here are the details of the changes-you may already have some effects:
Add index.php to the index row.
Change the root to / var / www / wordpress
Uncomment "location~\ .php ${"
Change the root to access the actual document root, / var / www / wordpress
Change the fastcgi_param line to help the PHP interpreter find the PHP script that we stored in the document root home.
Save, exit, and restart nginx for the changes to take effect:
Sudo service nginx restart step 6 result: visit the WordPress installation
Once this is done, wordpress installs the page online and waits for you:
Access this page (such as example.com) by accessing the domain name of your website or the IP address of your virtual private server, and fill in a short online form (it should look like this).
Thank you for reading, the above is the content of "how to configure WordPress in Centos". After the study of this article, I believe you have a deeper understanding of how to configure WordPress in Centos, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.