Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build WordPress on CentOS system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you "how to build WordPress on the CentOS system", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how to build WordPress on the CentOS system" this article.

Environment

Server operating system: CentOS 7.0

Blog deployment server: Apache

Background language: PHP

Database: MySql

Front-end framework: WordPress

Steps

First, install Apache

Installing Apache is easy, as long as you type the following command on the terminal:

Sudo yum install httpd

Sudo means what to do with root users, yum install is installed online; then type yes to confirm that the download is installed.

After the installation, we need to start the service:

Sudo service httpd start

After starting the server, don't worry about it. You can enter the ip address of the server directly into the browser, and you should be able to see the welcome page of Apache.

This page is used to test the operation of the Apache HTTP server after it has been installed... Wait

If your ip address has been bound to the domain name, then enter your domain name in the browser can also be accessed, is not cool, it is as simple as that, let's continue.

Second, install MySql

Install MySql and start MySql

Sudo yum install mysql-server sudo service mysqld start

You can install and start mysql through the above command. When you install mysql, you will be asked for some simple configuration. Type enter and yes to OK along the way.

Install PHP and related PHP components

Install PHP first

Sudo yum install php php-mysql

Install PHP related components

Yum install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

I installed these components first, and for future use, if you want to know all the PHP components, you can use the following command to search:

Yum search php-

4. Start Apache and Mysql services by default when booting

You can choose to boot Apache and Mysql using the following command:

Sudo chkconfig http onsudo chkconfig mysql on

5. Test whether PHP is installed successfully

Create an info.php file:

Sudo vim / var/www/html/info.php

Then enter I to enter edit mode and write the following PHP command in the file:

Then press the esc key to enter command mode, press the Shift key and z key twice, and exit the save file.

Enter the IP address / info.php in the browser, for example, enter 123.56.183.34/info.php, and you can see the information of PHP.

Download WordPress

You can browse it on the https://wordpress.org/ website or download it with the following command:

Wget http://cn.wordpress.org/wordpress-3.9-zh_CN.zip

7. Decompression

Use unzip to extract the file:

Unzip wordpress-3.8-zh_CN.zip

Create a new database in Mysql

Mysql-u root-p

Enter the database through the above command and enter the password: password

Then create a database called wordpress

Create database wordpress

IX. Modify the wp-content.php file

Modify the wp-content.php file as follows

/ * * MySQL database name: wordpress * / define ('DB_NAME',' wordpress'); / * * MySQL database user name: root*/define ('DB_USER',' root'); / * * MySQL database password: password*/define ('DB_PASSWORD',' password'); / * * MySQL host (no modification) * / define ('DB_HOST',' localhost')

Copy the files to the / var/www/html directory

Cp-rf wordpress/* / var/www/html/

11. Testing

Enter the ip of the server in the browser to see your home page.

The above is all the content of the article "how to build WordPress on CentOS system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report