赞
踩
用下面这个命令可以直接安装
sudo apt-get install apache2 mysql-server php5 libapache2-mod-php5 php5-gd php5-curl libssh2-php
mysql -u root -p
CREATE DATABASE wordpress;
#这里我将数据库名称命为 wordpress,可以自己定义。但请记住数据库名称,在后面的安装中将会用到。
CREATE USER wordpressadmin@localhost IDENTIFIED BY 'wordpresspassword';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressadmin@localhost;
FLUSH PRIVILEGES;
exit
sudo service mysql restart
sudo vim /etc/php5/apache2/php.ini
[...]
expose_php = Off
[...]
allow_url_fopen = Off
[...]
sudo a2enmod rewrite
sudo vim /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin admin@your-domain.com
DocumentRoot /var/www/html/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>
#ServerAdmin 设置了在所有返回给客户端的错误信息中包含的管理员邮件地址
#ServerName 代表你的域名
#ServerAlias 代表别名,别的url指向这个WordPress
#DocumentRoot WordPress的根路径
#3个Server都可以不用管
sudo service apache2 restart
cd ~/temp
wget http://wordpress.org/wordpress-4.3.1.tar.gz
tar xzvf wordpress*
cd wordpress*
sudo rsync -avz . /var/www/html
cd /var/www/html
ls -lsa
chown www-data:www-data -R /var/www/html/
cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
vim /var/www/html/wp-config.php
[...]
// ** 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');
[...]
service apache2 restart
访问http://你的域名or你的IP
在网页上配置
如果登陆进去是Apache的欢迎页则把/var/www/html/index.html删除掉,但是不能删除其他的!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。