How to configure wordpress in centos7 based on lnmp
wget http://wordpress.org/latest.zip #下载WordPress安装文件 unzip latest.zip #解压安装文件
由于我的主机装有discuz 所以会有点问题 先把discuz的文件全删了研究下WordPress 后面再研究两个共存的事
rm -rf var/www/html #删除 mkdir -p /var/www/html #创建网站根目录 cp -rf wordpress/* /var/www/html/ #复制安装文件到网站根目录 chmod -R 777 /var/www/html #更改根目录权限
mysql -u root -p >create database wordpress; >grant all privileges on wordpress.* to wordpress@'localhost' identified by 'password'; >flush privileges; >exit
cd /var/www/html #进入目录 cp wp-config-sample.php wp-config.php #复制一个文件 vi wp-config.php #编辑配置文件
#修改如下内容
/** The name of the database for WordPress */ define('DB_NAME', 'wordpress'); #数据库名称 /** MySQL database username */ define('DB_USER', '#你的用户'); #数据库用户 /** MySQL database password */ define('DB_PASSWORD', '#你的密码'); #数据库密码 /** MySQL hostname */ define('DB_HOST', 'localhost'); #主机 可改可不改 systemctl restart nginx systemctl restart mariadb #重启服务
在浏览器中打开 192.168.100.13/wordpress 登陆wordpress界面
vi /etc/nginx/nginx.conf #在server{ }里添加以下内容 if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } rewrite /wp-admin$ $scheme://$host$uri/ permanent; systemctl restart nginx systemctl restart mariadb #重启服务 打开网址 192.168.100.13/wordpress 登陆开始配置WordPress
The above is the detailed content of How to configure wordpress in centos7 based on lnmp. For more information, please follow other related articles on the PHP Chinese website!

Artificial Intelligence (AI) is a term that’s been buzzing around for a while now, from self-driving cars to voice assistants like Siri and Alexa, AI is becoming a part of our everyday lives. But what exactly is AI, and why should Linux users care ab


For someone new to Linux, using it can still feel challenging, even with user-friendly distributions like Ubuntu and Mint. While these distributions simplify many tasks, some manual configuration is often required, but fully harnessing the power of L

In the previous article, we introduced the basics of AI and how it fits into the world of Linux. Now, it’s time to dive deeper and set up your Linux system to start building your first AI model. Whether you’re a complete beginner or have some exper

If you’re looking to manage your server with ease, Kloxo is a great option, as it is free and open-source web hosting control panel that allows you to manage your server and websites with a simple, user-friendly interface. In this guide, we’ll walk

If you’ve ever found yourself in a situation where you’re trying to move a bunch of files and folders, only to be stumped by spaces in the folder names, you’re not alone. Spaces in filenames or folder names can quickly become a frustrat

The KDE Plasma desktop is renowned for its sleek design, extensive customization options, and impressive performance. For users who appreciate a polished, modern interface with the flexibility to tweak every detail, Plasma is a dream come true. But w


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
