Home > Article > Backend Development > Detailed steps to install WordPress on CentOS 7 centos7 forgets centos7 pxe centos7 plus
1. Requirements for building a WordPress server environment:
php 5.2.4 或者更高版本、MySQL 5.0 或者更高版本。
2. Building a WordPress platform:
The following takes WordPress 3.92 version as an example. If you want to install the latest version, after the installation is completed, the management interface can automatically upgrade and install the latest version. .
1. Create a temporary folder and download the latest version of WordPress 3.92, both Chinese and English:
mkdir /tmp/wp cd /tmp/wp wget http://wordpress.org/latest.zip
2. Unzip it to the root directory of the website: Since I installed LAMP using the LAMP one-click installation package, so The default website root directory is /data/www/default. Please pay attention to your own root directory during the actual installation process.
unzip -q latest.zip -d /data/www/default/
3. Change the owner and permissions of the wordpree folder
chown -R apache:apache /data/www/default/wordpresschmod -R 755 /data/www/default/wordpress
4. Create a directory upload that can be uploaded, and change the owner to apache
mkdir -p /data/www/default/wordpress/wp-content/uploads chown -R :apache /data/www/default/wordpress/wp-content/uploads
5. Modify the configuration file so that you can access the database
cd /data/www/default/wordpress/ cp wp-config-sample.php wp-config.php vim wp-config.php 修改部分分别为数据库名称、数据库用户名、数据库用户密码,大家根据实际修改: define('DB_NAME', 'wp_database'); define('DB_USER', 'root'); define('DB_PASSWORD', 'root'); 修改完成后 :wq!
6 , Browser installation
浏览器输入http://http://127.0.0.1/wordpress/wp-admin/install.php 后就可以进行最后的登陆安装: 输入站点名称,登陆户名,密码,邮箱就可以完成Wordpress的安装。 由于我是本地搭建的,所以是127.0.0.1,如果申请了域名,这里就是域名了。
7. Enable support for website fixed link modification and redirection functions. Edit the main configuration file:
vi /etc/httpd/conf/httpd.conf AllowOverride None 修改为: AllowOverride All 然后重启服务: systemctl restart httpd.service 创建.htaccess文件: touch /data/www/default/wordpress/.htaccess 编辑.htaccess文件: vim /data/www/default/wordpress/.htaccess 看是否有以下内容,没有自己添加,有可能网站会自动生成。 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L]</IfModule> 修改.htaccess文件权限: chmod 664 /data/www/default/wordpress/.htaccess 修改为664可以让网站支持自动更新,也可以修改为644。
At this point, WordPress has been fully installed on Centos7, and you can use it to build any website you want.
This article is reproduced from: http://www.linuxprobe.com/centos7-install-wordpress-detail-steps/
Provide the latest Linux technology tutorial books for free, and strive to do more for open source technology enthusiasts Better: http://www.linuxprobe.com/
The above introduces the detailed steps for installing WordPress on CentOS 7, including the content of wordpress and centos 7. I hope it will be helpful to friends who are interested in PHP tutorials.