WordPress 本地化安装

安装好 Apache ,MySQL,PHP以后。就可以装Wordpress了,非常的简单。

要确定启动了 Apache和MySQL

# /etc/init.d/apache2 start
* Starting mysqld (/etc/mysql/my.cnf) … [ ok ]

#etc/init.d/apache2 restart
* Starting apache2 …[ ok ]
apache2: Could not determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

用Vi编辑

# vi /etc/conf.d/apache2
找到下面一行加上 粗黑字部分: APACHE2_OPTS=”-D DEFAULT_VHOST -D PHP5 -D USERDIR
现在Terminal内输入:

xxxx@localhost ~ $ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 121
Server version: 5.0.38-log Gentoo Linux mysql-5.0.38

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.

mysql> create database wordpress;

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO ‘name’@’localhost’ IDENTIFIED BY ‘up2u’;

黑字部分自己输入。

然后

mysql> exit

现在到wordpress的主页把程序下载下来,大约1M内吧。把它解压出来

tar -zxvf 文件名.tar.gz
可以直接解压到或者解压后 Copy到/var/www/localhost/htdocs/wordpress/

到/var/www/localhost/htdocs/wordpress/ 编辑 wp-config-sample.php file
如下:

// ** MySQL settings ** //
define(’DB_NAME’, ‘wordpress’); // The name of the database
define(’DB_USER’, ‘username’); // Your MySQL username
define(’DB_PASSWORD’, ‘password’); // …and password
define(’DB_HOST’, ‘localhost’);
define(’DB_HOST’, ‘localhost’); 99% chance you won’t need

把密码用户名改对了就可以了,对应这句:TO ‘name’@’localhost’ IDENTIFIED BY ‘up2u’

这样就可以让创建的用户读取写入database了。(用root进入Mysql使用mysql -u root -p, 用创建的用户使用mysql -u 名字 -p)

现在把东西改好了以后把文件wp-config-sample.php改成 wp-config.php 即可。

好了,第一次使用打开http://localhost/wordpress/wp-admin/install.php

然后根据提示一步一步进行就好了。如果打开install.php网页,看到如下:

Error establishing a database connection

This either means that the username and password information in your
wp-config.php file is incorrect or we can’t contact the database server
at localhost. This could mean your host’s database server is down.

* Are you sure you have the correct username and password?
* Are you sure that you have typed the correct hostname?
* Are you sure that the database server is running?

If you’re unsure what these terms mean you should probably contact
your host. If you still need help you can always visit the WordPress
Support Forums.

说明Mysql没设置好。最好找资料来读一下。

全部弄好,随机会给一个密码,千万别丢了。用这个密码登录,然后进去修改就好了。

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s