1.lamp简介
Linux-Apache-MySQL-PHP的LAMP一直是最流行的Web开发平台。LAMP之所以很受欢迎,是因为与其它平台相比,它具有很多优势。1)成本低廉,扩展能力好。2)部署量大,安全性高LAMP因其部署量非常大,安全问题也更少,因为能发现的问题几乎都被翻了过遍,它也是全世界范围内测试最彻底的软件组合。灵活,稳定LAMP也提供了非常好的灵活性,开发人员可以选择自己喜欢的框架,甚至构建自己的框架。
2.lamp+bbs的详细配置
1)为比较方便的安装所需要的软件配置本地yum
[root@localhost ~]# mkdir /mnt/cdrom //创建/mnt/cdrom目录
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom //挂载光盘
编辑yum配置文件
[root@localhost Server]# vim /etc/yum.repos.d/rhel-debuginfo.repo
文件修改如下图
2)安装httpd 服务
[root@localhost Server]# yum install httpd -y
3)安装mysql
[root@localhost Server]# yum install mysql mysql-server -y
[root@localhost Server]# yum list all |grep php
4)安装php
[root@localhost Server]# yum install php php-mysql php-mbstring
5)启动所需的服务
[root@localhost Server]# service mysqld start //启动mysql
[root@localhost Server]# chkconfig mysqld on //设置开机自动启动
6)测试php
[root@localhost Server]# cd /var/www/html
[root@localhost html]# vim index.php
编辑的文件如下图
测试信息如下
7)测试php是否能调用mysql
[root@localhost html]# vim index.php
网页文件如下
测试信息如下
8)利用lamp+phpwind创建论坛
查看phpwind压缩文件
9)解压phpwind压缩文件
[root@localhost ~]# unzip phpwind_GBK_8.3.zip
[root@localhost ~]# cd phpwind_GBK_8.3
10)解压phpwind压缩文件
10)安装论坛
11)按照网页上的提示改变文件夹权限
[root@localhost phpwind]# chmod -R 777 p_w_upload
[root@localhost phpwind]# chmod -R 777 data
[root@localhost phpwind]# chmod -R 777 html
12)创建论坛数据库
[root@localhost phpwind]# mysql
mysql> create database phpwind;
mysql> use phpwind;
mysql> mysqladmin -u user root -p password '123‘; //创建数据库用户名密码
安装完成
13)测试
14)构建基于主机头的网站
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
重启服务
15)修改测试机上的host文件
用主机名测试
Lamp+Wordpress实现构建论坛
1) 解压wordpress包
[root@localhost ~]# cd wordpress
[root@localhost wordpress]# unzip wordpress_v3.0.5-zh_CN.zip //解压wordpress
[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/wordpress/
[root@localhost wordpress-3.0.5-zh_CN]# cd /var/www/html
[root@localhost html]# ll
总计 20
-rw-r--r-- 1 root root 110 07-26 00:00 index.php
drwxr-xr-x 22 root root 4096 07-26 02:22 phpwind
drwxr-xr-x 5 root root 4096 2011-02-09 wordpress
2)配置httpd.conf配置如下图
[root@localhost html]# vim /etc/httpd/conf/httpd.conf
3)wordpress的相关配置
[root@localhost wordpress]# ls |grep wp-config
wp-config-sample.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;
mysql> create database wordpress //创建wordpress数据库
4)配置wp-config.php
[root@localhost wordpress]# vim wp-config.php
重启服务
[root@localhost wordpress]# service httpd restart
客户端配置
5)论坛配置
管理界面
论坛首页
6)更换主题
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# cd wordpress
[root@localhost wordpress]# chmod o+w wp-content
[root@localhost wp-content]# ll
总计 20
-rw-r--r-- 1 root root 30 2011-02-08 index.php
drwxr-xr-x 2 root root 4096 2011-02-08 languages
drwxr-xr-x 3 root root 4096 2011-02-08 plugins
drwxr-xr-x 3 root root 4096 2011-02-08 themes
[root@localhost wp-content]# cd uploads
[root@localhost uploads]# cd ../themes/
[root@localhost themes]# cp ../uploads/Stratex.zip ./
[root@localhost themes]# unzip Stratex.zip
7)安装主题的界面
8)安装后的主题
9)更换主题后的首页。
lamp+Discuz实现论坛
1)解压文件
[root@localhost ]# mkdir discuz
[root@localhost discuz]# cd discuz
[root@localhost discuz]# unzip Discuz_X2.5_SC_GBK.zip
解压后所形成的文件
[root@localhost discuz]# mv upload/ /var/www/html/discuz
[root@localhost ~]# cd /var/www/html/discuz
修改用户host文件
修改/etc/httpd/conf/httpd.conf
访问网站
2)按照网页提示做如下操作
[root@localhost discuz]# cd config创建所需文件
[root@localhost config]# cp config_global_default.php config_global.php
[root@localhost config]# cp config_ucenter_default.php config_ucenter.php改变文件权限
[root@localhost config]# chmod 777 config_global.php
[root@localhost config]# chmod 777 config_ucenter.php[root@localhost discuz]# chmod 777 -R config
[root@localhost discuz]# chmod 777 -R data [root@localhost discuz]# chmod 777 -R uc_client [root@localhost discuz]# chmod 777 -R uc_serverconfig目录下的文件如下
[root@localhost discuz]# cd config
[root@localhost config]# ll 总计 16 -rwxrwxrwx 1 root root 7637 07-02 13:54 config_global_default.php -rwxrwxrwx 1 root root 1512 07-02 13:54 config_ucenter_default.php -rwxrwxrwx 1 root root 1 07-02 13:54 index.htm创建数据库
修改/var/www/html/discuz/config目录下的文件如下所示
3)安装成功后页面
访问论坛首页