首先搭建lamp环境,这里就不再详细列出.
[root@localhost phpwind]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database phpwind
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database
|
+--------------------+
| information_schema |
| mysql
|
| phpwind
|
| test
|
+--------------------+
4 rows in set (0.00 sec)
mysql>
[root@localhost phpwind]# mysqladmin -u root -p password '123'
Enter password:
[root@localhost phpwind]#
删除install.php
[root@localhost phpwind]# ll ins*
-rw-r--r-- 1 root root 32955 2010-12-21 install.php
[root@localhost phpwind]# rm install.php
rm:是否删除 一般文件 “install.php”? y
[root@localhost phpwind]#
虚拟主机设置
[root@localhost phpwind]# vim /etc/httpd/conf/httpd.conf
991 #</VirtualHost>
992 <VirtualHost 192.168.28.20:80>
994
DocumentRoot /var/www/html/phpwind
995
ServerName bbs.nxl.com
996
ErrorLog logs/phpwind-error_log
997
CustomLog logs/phpwind-access_log common
998 </VirtualHost>
:
测试结果
2.利用wordpress搭建论坛:
[root@localhost wordpress]# unzip wordpress_v3.0.5-zh_CN.zip
[root@localhost wordpress]# cd wordpress-3.0.5-zh_CN/
[root@localhost wordpress-3.0.5-zh_CN]# ll
总计 4
drwxr-xr-x 5 root root 4096 2011-02-09 wordpress
[root@localhost wordpress-3.0.5-zh_CN]# mv wordpress/ /var/www/html/
[root@localhost wordpress-3.0.5-zh_CN]# cd /var/www/html/
[root@localhost html]# ll
总计 12
-rw-r--r-- 1 root root
97 08-19 21:14 index.php
drwxr-xr-x 22 root root 4096 08-19 21:22 phpwind
drwxr-xr-x 5 root root 4096 2011-02-09 wordpress
[root@localhost html]# cd wordpress/
[root@localhost wordpress]# ls
index.php
wp-atom.php wp-cron.php wp-mail.php wp-settings.php
license.txt
wp-blog-header.php wp-feed.php wp-pass.php wp-signup.php
readme.html
wp-comments-post.php wp-includes wp-rdf.php wp-trackback.php
wp-activate.php wp-commentsrss2.php
wp-links-opml.php wp-register.php xmlrpc.php
wp-admin
wp-config-sample.php wp-load.php wp-rss2.php
wp-app.php
wp-content wp-login.php wp-rss.php
[root@localhost wordpress]# cp wp-config-sample.php wp-config.php
[root@localhost wordpress]# chown apache.apache wp-config.php
[root@localhost wordpress]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database
|
+--------------------+
| information_schema |
| mysql
|
| phpwind
|
| test
|
| wordpress
|
+--------------------+
5 rows in set (0.01 sec)
[root@localhost wordpress]# vim wp-config.php
/** WordPress 数据库的名称 */^M
define('DB_NAME', 'wordpress');^M
^M
/** MySQL 数据库用户名 */^M
define('DB_USER', 'root');^M
^M
/** MySQL 数据库密码 */^M
define('DB_PASSWORD', '123');^M
^M
/** MySQL 主机 */^M
define('DB_HOST', 'localhost');^M
^M
/** 创建数据表时默认的文字编码 */^M
define('DB_CHARSET', 'utf8');^M
访问主页面
[root@localhost html]# vim /etc/httpd/conf/httpd.conf
#</VirtualHost>
<VirtualHost 192.168.28.20:80>
DocumentRoot /var/www/html/phpwind
ServerName bbs.nxl.com
ErrorLog logs/phpwind-error_log
CustomLog logs/phpwind-access_log common
</VirtualHost>
<VirtualHost 192.168.28.20:80>
DocumentRoot /var/www/html/wordpress
ServerName bbs.qq.com
ErrorLog logs/wp-error_log
CustomLog logs/wp-access_log common
</VirtualHost>
[root@localhost html]# service httpd restart
停止 httpd:
[确定]
启动 httpd:
[确定]
测试结果