CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>
在完成以上步骤之后,重启 Apache 服务使配置生效。
sudo service apache2 restart 下载并安装 WordPress
现在,系统已经准备就绪,我们可以开始 WordPress 的安装了! 回到你的服务器上,切换到你的临时目录并用 wget 去下载 WordPress
cd /tmpwget http://wordpress.org/latest.tar.gz 下载完成后解压:
tar xzvf wordpress* 现在,复制解压的目录到你的 web 目录下,推荐使用 rsync 安全复制文件:
cd wordpress*
sudo rsync -avz . /var/www/html
现在,你可以进入 web 目录检查复制的文件:
cd /var/www/html
ls -lsa
确保 WordPress 目录文件可写,同时,以 www-data 用户, www-data 属组运行(用户,属组可自定义):
chown www-data:www-data -R /var/www/html/配置 WordPress 编辑 WordPress config.php 文件,
cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
vi /var/www/html/wp-config.php
找到并修改数据库名称,数据库用户名, mysql root 密码:
[...]
// ** 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', 'wordpressadmin');
/** MySQL database password */
define('DB_PASSWORD', 'wordpresspassword');
/** MySQL hostname */
define('DB_HOST', 'localhost');
[...]
完成以上配置之后,重启 Apache 服务:
service apache2 restart 安装 WordPress
通过以上操作,文件已经准备到位,软件也已配置完成。通过 web 接口就可以完成 WordPress 的安装了。 在你的浏览器中访问你的域名或者 IP 地址:
http://server_domain_name_or_IP 你将看到 WordPress 的初始安装界面,你将创建一个管理员账号:
完成站点信息,创建你的管理账号。填写完毕之后点击 Install WordPress 按钮继续。 WordPress 将确认你的安装信息,然后要求你以刚才创建的账号登录:
点击 Log In 填写账号信息:
你可以通过域名或者 IP 地址访问你的站点了!
原文链接:http://www.unixmen.com/install-wordpress-ubuntu-14-10/