今天我们来学习制作WordPress,所需软件包有httpd,mysql,mysql-server,php,php-mysql,wordpress-2.9.2-zh_CN.zip,本地配置有YUM 源..
[root@station195 ~]# yum install httpd
[root@station195 ~]# yum install mysql
[root@station195 ~]# yum install mysql-server
[root@station195 ~]# yum install php
[root@station195 ~]# yum install mysql-mysql
[root@station195 ~]# cd /var/www/;mkdir wordpress;cd wordpress
[root@station195 wordpress]# unzip wordpress-2.9.2-zh_CN.zip
[root@station195 wordpress]# cp -rp wordpress/* ./
[root@station195 wordpress]# cp -p wp-config-sample.php wp-config.php
[root@station195 wordpress]# vim wp-config.php
define('DB_NAME', 'wordpress');
define('DB_USER', 'root');
define('DB_PASSWORD', '123456');
[root@station195 ~]# vim /etc/hosts
192.168.0.195 wordpress.example.com
由于我们这没做DNS服务器,所以临时这么修改,在客户机的hosts文件中也写入这么一条...
[root@station195 wordpress]# service mysqld restart
[root@station195 wordpress]# chkconfig mysqld on
[root@station195 wordpress]# mysqladmin -uroot password '123456'
[root@station195 wordpress]# mysql -uroot -p
Enter password:
mysql> create databases wordpress;(这儿创建数据库的名字一定要和配置文件中的名字一致,否则报错)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| wordpress |
+--------------------+
4 rows in set (0.00 sec)
mysql> \q
Bye
[root@station195 ~]# vim /etc/httpd/conf/httpd.conf
#DocumentRoot "/var/www/html" (注释中心主机项)
NameVirtualHost *:80 (做虚拟主机时需打开此项)
AddDefaultCharset GBK
Servername wordpress.example.com
DocumentRoot /var/www/wordpress
Errorlog /var/log/httpd/wordpress/err.log
Customlog /var/log/httpd/wordpress/custom.log combined
[root@station195 ~]# cd /var/log/httpd/;mkdir wordpress
[root@station195 ~]# service httpd restart
[root@station195 ~]# chkconfig httpd on(加入开机启动队列)
配置完成,下面我们去测试....
在客户机浏览器中输入e
e.com
阅读(1667) | 评论(0) | 转发(0) |