一.搭建lamp:

1.配置yum客户端:

[root@gjp99 ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo

[rhel-Server]
name=Red Hat Enterprise Linux server
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

2.安装Apache

[root@gjp99 ~]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@gjp99 ~]# yum install httpd –y

3.安装mysql

[root@gjp99 ~]# yum list all |grep mysql
This system is not registered with RHN.
RHN support will be disabled.
freeradius-mysql.i386                  1.1.3-1.4.el5         rhel-Server       
libdbi-dbd-mysql.i386                  0.8.1a-1.2.2          rhel-Server       
mod_auth_mysql.i386                    1:3.0.0-3.2.el5_3     rhel-Server       
mysql.i386                             5.0.77-3.el5          rhel-Server       
mysql-bench.i386                       5.0.77-3.el5          rhel-Server       
mysql-connector-odbc.i386              3.51.26r1127-1.el5    rhel-Server       
mysql-devel.i386                       5.0.77-3.el5          rhel-Server       
mysql-server.i386                      5.0.77-3.el5          rhel-Server       
mysql-test.i386                        5.0.77-3.el5          rhel-Server       
php-mysql.i386                         5.1.6-23.2.el5_3      rhel-Server       
qt4-mysql.i386                         4.2.1-1               rhel-Server       
rsyslog-mysql.i386                     2.0.6-1.el5           rhel-Server

[root@gjp99 ~]# yum install mysql mysql-server –y

Dependency Installed: (依赖的文件  )
  perl-DBD-MySQL.i386 0:3.0007-2.el5      perl-DBI.i386 0:1.52-2.el5    

Complete!

[root@gjp99 ~]# yum list all |grep php

[root@gjp99 ~]# yum install php php-mysql php-mbstring

Dependency Installed:
  php-cli.i386 0:5.1.6-23.2.el5_3   php-common.i386 0:5.1.6-23.2.el5_3 
  php-pdo.i386 0:5.1.6-23.2.el5_3 

Complete!

[root@gjp99 conf.d]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                              [  OK  ]
[root@gjp99 conf.d]# chkconfig httpd on   //开机自动启动

[root@gjp99 ~]# service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
120828 15:37:24 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
120828 15:37:24 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
OK
Filling help tables...
120828 15:37:25 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
120828 15:37:25 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h gjp99.baidu.com password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
                                                                   [  OK  ]
Starting MySQL:                                            [  OK  ]

[root@gjp99 ~]# chkconfig mysqld on   //开机自动启动

4.测试:
[root@gjp99 conf.d]# cd /var/www/html
[root@gjp99 html]# vim index.php

<?php
phpinfo();
?>

p_w_picpath 

由于设置了身份验证!

p_w_picpath

证明:php作为模块被Apache调用

[root@gjp99 ~]# cd /var/www/html
[root@gjp99 html]# vim index.php

p_w_picpath

注意:语句后面都要以分号结束!

证明:apache调用php,php调用mysql

p_w_picpath

p_w_picpath

p_w_picpath

二.搭建phpwind来实现论坛

物理目录的创建:

1.上传p_w_picpath

p_w_picpath

p_w_picpath

2.解压缩并配置

[root@gjp99 ~]# unzip phpwind_GBK_8.3  //解压到当前目录(GBK字体,8.3版本)

用ll 可看到以下蓝色为解压后的文件夹

p_w_picpath

cd upload/  查看,里面都是php文件

 p_w_picpath

3.测试并修正:

p_w_picpath

出现乱码,页面上右击 编码---简体中文

p_w_picpath

但是每一次都要调整,比较麻烦!

解决:[root@gjp99 ~]# vim /etc/httpd/conf/httpd.conf

p_w_picpath p_w_picpath 服务重启

4.安装phpwind 做的准备工作:

[root@gjp99 ~]# cd /var/www/html
[root@gjp99 html]# ll
total 12
-rw-r--r--  1 root root   25 Aug 21 18:30 index.html
-rw-r--r--  1 root root  117 Aug 28 16:22 index.php
drwxr-xr-x 22 root root 4096 Dec 21  2010 phpwind
[root@gjp99 html]# cd phpwind/
[root@gjp99 phpwind]# ll

[root@gjp99 phpwind]# chmod -R 777 p_w_upload
[root@gjp99 phpwind]# chmod -R 777 data     
[root@gjp99 phpwind]# chmod -R 777 html

[root@gjp99 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&gt; create database phpwind;
Query OK, 1 row affected (0.00 sec)

mysql&gt; show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1
mysql&gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| phpwind            |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql&gt; use phpwind;
Database changed
mysql&gt; show tables;
Empty set (0.00 sec)

mysql&gt; quit;
Bye
[root@gjp99 phpwind]# mysqladmin -u root -p password '123'
Enter password:   旧密码为空,所以在此回车!

进入数据库,测试:
[root@gjp99 phpwind]# mysql -u root -p     
Enter password:    //输入设置的密码
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt;

p_w_picpath

p_w_picpath

p_w_picpath 

[root@gjp99 phpwind]# ll inst*
-rw-r--r-- 1 root root 32955 Dec 21  2010 install.php
[root@gjp99 phpwind]# rm install.php
rm: remove regular file `install.php'? y

p_w_picpath p_w_picpath

管理员账号 进入下面界面

p_w_picpath 进入后台管理界面

添加板块管理:

p_w_picpath p_w_picpath

p_w_picpath p_w_picpath

p_w_picpath 

[root@gjp99 html]# vim /etc/httpd/conf/httpd.confp_w_picpath

[root@gjp99 html]# service httpd restart

C:\Windows\System32\drivers\etc

hosts文件修改如下:

192.168.2.100   bbs.gjp.com

p_w_picpath

 

三 、搭建wordpress来实现论坛

1.上传wordpress及相应主题:

p_w_picpath 

注意右侧的目录!

p_w_picpath p_w_picpathp_w_picpath

2.解压缩,并把它作为物理目录访问

[root@gjp99 ~]# unzip wordpress_v3.0.5-zh_CN.zipp_w_picpath

[root@gjp99 ~]# cd wordpress-3.0.5-zh_CN/wordpress/
[root@gjp99 wordpress]# ll
total 320
-rw-r--r-- 1 root root   397 Feb  8  2011 index.php
-rw-r--r-- 1 root root 15410 Dec  6  2008 license.txt
-rw-r--r-- 1 root root  8358 Feb  8  2011 readme.html
-rw-r--r-- 1 root root  4391 Feb  8  2011 wp-activate.php

截了一部分,该文件夹下几乎都是php页面p_w_picpathp_w_picpath

http://192.168.2.100/wordpresss

访问不到![root@gjp99 html]# vim /etc/httpd/conf/httpd.conf

p_w_picpath p_w_picpath

p_w_picpath 

[root@gjp99 wordpress]# ll wp-config*
-rw-r--r-- 1 root root 2972 Feb  8  2011 wp-config-sample.php
-rw-r--r-- 1 root root 2972 Aug 28 18:47 wp-config.php

查看权限,有谁控制,httpd-----php-----wp-config.php(php是模块,被apache调用)

[root@gjp99 wordpress]# chown apache.apache wp-config.php
[root@gjp99 wordpress]# ll wp-config*
-rw-r--r-- 1 root   root   2972 Feb  8  2011 wp-config-sample.php
-rw-r--r-- 1 apache apache 2972 Aug 28 18:47 wp-config.php

[root@gjp99 wordpress]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; create database wordpress;
Query OK, 1 row affected (0.00 sec)

mysql&gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| phpwind            |
| test               |
| wordpress          |
+--------------------+
5 rows in set (0.01 sec)

mysql&gt; \q
Bye

[root@gjp99 wordpress]# vim wp-config.php

p_w_picpath

注意,apache服务重启!

p_w_picpath 

p_w_picpath

p_w_picpath

 p_w_picpath

p_w_picpath

p_w_picpath

以管理员登陆,站点管理--外观--安装主题----上传---浏览---现在安装

p_w_picpath p_w_picpath 

没有uploads文件夹p_w_picpath

刷新刚才错误页面:(下面的图证明已上传主题成功)p_w_picpathp_w_picpath

[root@gjp99 wp-content]# cd themes
[root@gjp99 themes]# ll
total 8
-rw-r--r-- 1 root root   30 Feb  8  2011 index.php
drwxr-xr-x 4 root root 4096 Feb  8  2011 twentyten
[root@gjp99 themes]# cp ../uploads/WireMagazine.zip  ./
[root@gjp99 themes]# ll
total 500
-rw------- 1 root root 497931 Aug 28 19:42 WireMagazine.zip
-rw-r--r-- 1 root root     30 Feb  8  2011 index.php
drwxr-xr-x 4 root root   4096 Feb  8  2011 twentyten

[root@gjp99 themes]# unzip WireMagazine.zipp_w_picpathp_w_picpathp_w_picpathp_w_picpathp_w_picpathp_w_picpathp_w_picpath 

四、基于主机头的虚拟主机:

[root@gjp99 themes]# vim /etc/httpd/conf/httpd.confp_w_picpathp_w_picpath 

测试机:

p_w_picpath p_w_picpath

[root@gjp99 html]# ll
total 16
-rw-r--r--  1 root root   25 Aug 21 18:30 index.html
-rw-r--r--  1 root root  117 Aug 28 16:22 index.php
drwxr-xr-x 22 root root 4096 Aug 28 17:22 phpwind
drwxr-xr-x  5 root root 4096 Aug 28 19:11 wordpress

只要不是在主目录/var/www/html/ 下,任意地方都可以,只要指明即可!
[root@gjp99 html]# mv wordpress /var/
[root@gjp99 html]# mv phpwind  /var/p_w_picpath p_w_picpath

五、搭建Discuz来实现论坛

1.上传的文件

p_w_picpath

[root@gjp99 ~]# mkdir Discuz                         
[root@gjp99 ~]# mv Discuz_X2.5_SC_GBK.zip Discuz
[root@gjp99 ~]# ll Discuz
total 9292
-rw-r--r-- 1 root root 9496731 Aug 28 21:05 Discuz_X2.5_SC_GBK.zip
[root@gjp99 ~]# cd Discuz   
[root@gjp99 Discuz]# unzip Discuz_X2.5_SC_GBK.zip

p_w_picpath 

cd upload   用ll查看,出现的都是php页面p_w_picpath

增加以下信息:

p_w_picpath

[root@gjp99 var]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                             [  OK  ]

C:\Windows\System32\drivers\etcp_w_picpath p_w_picpath

出现以下错误! 

p_w_picpath p_w_picpathp_w_picpathp_w_picpath

都变为可写,下一步:

p_w_picpath p_w_picpathp_w_picpath

 

p_w_picpath

p_w_picpath

p_w_picpath 点击

p_w_picpath p_w_picpath p_w_picpath p_w_picpath p_w_picpathp_w_picpath

刷新即可!

p_w_picpath

(如果喜欢,可以转载!)