--------------------------------------------------------------------
Ubuntu安装Apache:
sudo apt-get install apache2
sudo /etc/init.d/apache2 restart
apache默认的http根目录:
ls /var/www/
--------------------------------------------------------------------
Ubuntu安装mysql,根据提示设置管理用户和密码root/123456:
sudo apt-get install mysql-server mysql-client
-----------------
输入密码,操作mysql:
mysql -u root -p
-----------------
为wordpress创建数据库,用户和密码wordpress/123456:
CREATE DATABASE blog;
GRANT ALL PRIVILEGES ON blog.* TO "wordpress"@"localhost"
IDENTIFIED BY "123456";
FLUSH PRIVILEGES;
EXIT
-----------------
启动MySql服务:
sudo /etc/init.d/mysql start
--------------------------------------------------------------------
修改wordpress配置文件,设置Mysql DB的数据库名/用户名/密码:
cp wordpress/wp-config-sample.php wordpress/wp-config.php
vi wordpress/wp-config.php
在根目录下确定http目录为blog:
mv wordpress blog
原文:https://www.cnblogs.com/ruanchao2012/p/10125561.html