一:lamp简介:

Linux+Apache+Mysql+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。该软件开发的项目在软件方面的投资成本较低,因此受到整个IT界的关注。从网站的流量上来说,70%以上的访问流量是LAMP来提供的,LAMP是最强大的网站解决方案.

二:phpwind,wordpress,discus,discus简介:

PHPWind(简称:PW)是一个基于PHP和MySQL的论坛程序,是国内最受欢迎的通用型论坛程序之一.

WordPress 是一种使用 PHP语言和 MySQL数据库开发的开源、免费的 Blog(博客,网站)引擎,用户可以在支持 PHP 和 MySQL 数据库的服务器上建立自己的blog.

Discuz是北京康盛新创科技有限责任公司推出的一套通用的社区论坛软件系统,是全球成熟度最高、覆盖率最大的论坛软件系统之一。

三:搭建lamp

1:[root@lyt ~]# mkdir /mnt/cdrom

[root@lyt ~]# mount /dev/cdrom /mnt/cdrom/

[root@lyt ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo          #编辑本地yum,如图:

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的

2:[root@lyt ~]# yum install httpd            #安装http服务器

[root@lyt ~]# yum install mysql mysql-server          #安装mysql工具包和mysql-server

[root@lyt ~]# yum list all |grep php            #搜索安装php需要的包

[root@lyt ~]# yum install php php-mbstring  php-mysql          #安装这三个软件包

[root@lyt ~]# service httpd start       #开启http服务器

[root@lyt ~]# service mysqld start       #开启mysql服务器

[root@lyt ~]# chkconfig httpd on           #开机自动启动http服务器

[root@lyt ~]# chkconfig mysqld on         #开机自动启动mysql服务器

[root@lyt ~]# cd /var/www/html/

[root@lyt html]# vim index.php            #编辑一个动态的页面,测试php是否能被apache调用

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_02

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_03

[root@lyt html]# vim index.php         #编辑动态页面,测试mysql是否能被php调用

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_04

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_05 

3:[root@lyt ~]# cd /mnt/cdrom/Server/

[root@lyt Server]# rpm -ivh vsftpd-2.0.5-16.el5.i386.rpm

[root@lyt Server]# vim /etc/vsftpd/vsftpd.conf

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_06

[root@lyt Server]# cd /var/ftp

[root@lyt ftp]# chmod o+w pub/

[root@lyt ftp]# service vsftpd restart

利用ftp将phpwind,wordpress传入虚拟机中:

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_07

[root@lyt var]# cd /var/ftp/pub/

 

 

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_08

四:创建论坛:

phpwind:

4:[root@lyt pub]# mv phpwind_GBK_8.3.zip /root/            #将这些包全部移动到/root中

[root@lyt pub]# mv Stratex.zip  /root/

[root@lyt pub]# mv WireMagazine.zip  /root/

[root@lyt pub]# mv wordpress_v3.0.5-zh_CN.zip  /root/

[root@lyt ~]# unzip phpwind_GBK_8.3.zip           #解压文件

[root@lyt ~]# cd phpwind_GBK_8.3

[root@lyt phpwind_GBK_8.3]# mv upload/ /var/www/html/phpwind          #将网页upload文件移动到/var/www/html中,并重命名为phpwind

[root@lyt phpwind]# vim /etc/httpd/conf/httpd.conf        #编辑apache配置文件,更改论坛页面字体

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_09

[root@lyt phpwind]# service httpd restart

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_10

[root@lyt phpwind]# chmod -R p_w_upload/           #更改上图中目录属性为777,-R表示递归

[root@lyt phpwind]# chmod -R 777 data/             #更改上图中目录属性为777,-R表示递归

[root@lyt phpwind]# chmod -R 777 html/             #更改上图中目录属性为777,-R表示递归

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_11

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_12

[root@lyt html]# mysqladmin -u root -p password '123'        #为数据库创建用户名root,密码“123”

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_13

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_14

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_15

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_16

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_17

[root@lyt var]# cd /var/www/html/phpwind/

[root@lyt phpwind]# rm install.php

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_18

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_19

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_20

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_21

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_22

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_23

wordpress:

1:[root@lyt ~]# unzip wordpress_v3.0.5-zh_CN.zip       #解压wordpress

[root@lyt ~]# ll wordpress-3.0.5-zh_CN/

[root@lyt ~]# mv wordpress-3.0.5-zh_CN/wordpress/  /var/www/html/       #将wordpress文件移动到/var/www/html

[root@lyt html]# cd /var/www/html/wordpress/

[root@lyt wordpress]# cp wp-config-sample.php  wp-config.php       #产生一个wp-config.php文件

[root@lyt wordpress]# chown apache.apache wp-config.php        #将wp-config.php文件交给apache进程处理

[root@lyt html]# mysql -u root –p #登录数据库

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_24

2:[root@lyt ~]# cd /var/www/html/wordpress/

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

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_25

[root@lyt wordpress]# service httpd restart

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_26

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_27

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_28

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_29

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_30

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_31

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_32

进入后台管理页面:

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_33

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_34

修改/var/www/html/wordpress/wp-content权限:

[root@lyt pub]# cd /var/www/html/wordpress

[root@lyt wordpress]# chmod o+w wp-content/            #增加写的权限

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_35

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_36

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_37

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_38

[root@lyt wp-content]# cd uploads/

[root@lyt uploads]# cp Stratex.zip ../themes/

[root@lyt uploads]# cd ../themes/

[root@lyt themes]# unzip Stratex.zip

[root@lyt themes]# unzip Stratex.zip        #将Stratex.zip解压缩

 

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_39

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_40

建立基于主机头的虚拟主机,用不同的主机名登录论坛:

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

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_41

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_42

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_43 

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_44

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_45

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_46

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_47

Discuz:(安装discus并将discus添加到虚拟主机中

[root@lyt html]# cd /var/ftp/pub/

[root@lyt pub]# mv Discuz_X2.5_SC_GBK.zip /root/

[root@lyt pub]# cd

[root@lyt ~]# unzip Discuz_X2.5_SC_GBK.zip           #解压文件

[root@lyt ~]# mv  upload/  /var/www/html/

[root@lyt ~]# cd /var/www/html/

[root@lyt html]# mkdidr discus       #新建目录

[root@lyt html]# cp -r readme/ ./discus/      #将readme目录移动到discus中

[root@lyt html]# cp -r upload/ ./discus/

[root@lyt html]# cp -r utility/ ./discus/  

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

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_48

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_49

[root@lyt html]# service httpd restart                             

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_50

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_51

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_52

[root@lyt html]# cd discus/

[root@lyt discus]# chmod -R o+w  config/

[root@lyt discus]# chmod -R o+w  data/

[root@lyt discus]# chmod -R o+w  uc_client/

[root@lyt discus]# chmod -R o+w  uc_server/

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_53

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_54

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_55

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_56

[root@lyt discus]# mysql -u root –p       #登录数据库mysql

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_57

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_58

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_59

Linux下搭建lamp论坛(phpwind+wordpress+discus)_Linux_60

Linux下搭建lamp论坛(phpwind+wordpress+discus)_应用程序_61

Linux下搭建lamp论坛(phpwind+wordpress+discus)_phpwind_62

Linux下搭建lamp论坛(phpwind+wordpress+discus)_的_63

Linux下搭建lamp论坛(phpwind+wordpress+discus)_网站_64