Lamp构建论坛
 
实验环境:红帽Linux5.4企业版
通过php和mysql构建lamp环境构建论坛
安装php.i386
[[email protected] ~]# yum install -y php.i386
编辑网页
[[email protected] html]# vim index.php
Hello!!!!!!
<?php
phpinfo()
?>
重启服务
[[email protected] html]# service httpd restart
Stopping httpd:                                            [ OK ]
Starting httpd:                                            [ OK ]
检测

Lamp构建论坛

 
安装数据库 存放帐号
安装mysql
 
[[email protected] html]# yum install -y mysql.i386
[[email protected] html]# yum install -y mysql-server.i386
查询
[[email protected]ocalhost html]# chkconfig --list |grep mysql
mysqld             0:off 1:off 2:off 3:off 4:off 5:off 6:off
设置开机自动启动
[[email protected] html]# chkconfig mysqld on
[[email protected] html]# service mysqld start
查看运行端口
[[email protected] html]# netstat -tupln |grep mysql
安装php和mysql相关联软件
[[email protected] html]# yum install -y php-mysql
编辑测试网页
[[email protected] html]# vim index.php
Hello!!!
<?php
$link=mysql_connect('127.0.0.1','root','');
if ($link)
echo "ok";
else
echo "not ok"
?>
 

Lamp构建论坛

~  
为了方便管理数据库phpadmin的安装
把phpMyAdmin-2.11.10.1-all-languages.zip导入Linux系统的root目录下
unzip该zip包
[[email protected] ~]# unzip phpMyAdmin-2.11.10.1-all-languages.zip
移动文件建立一目录
[[email protected] ~]# mv phpMyAdmin-2.11.10.1-all-languages /var/www/html/phpmyadmin
访问http://192.168.2.100/phpmyadmin/

Lamp构建论坛 

 

Lamp构建论坛

设置密码
[[email protected] html]# mysqladmin -u root -p password '123456'
[[email protected] html]# cd phpmyadmin/
[[email protected] phpmyadmin]# cp config.sample.inc.php config.inc.php
[[email protected] phpmyadmin]# vim config.inc.php
17 $cfg['blowfish_secret'] = 'redhat'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 添加密码
重启http服务
[[email protected] phpmyadmin]# service httpd restart
查看http://192.168.2.100/phpmyadmin/

Lamp构建论坛

安装mycrpt软件(php-mcrypt-5.1.6-5.el5.i386.rpm libmcrypt-2.5.7-5.el5.i386.rpm)
[[email protected] ~]# yum localinstall php-mcrypt-5.1.6-5.el5.i386.rpm libmcrypt-2.5.7-5.el5.i386.rpm –nogpgcheck

Lamp构建论坛

root登录
 

Lamp构建论坛

由于未发现php的扩展设置mbstring,需安装php-gd php-mbstring php-pea php-xml等软件包
[[email protected] ~]# yum install -y php-gd php-mbstring php-pear php-xml
 

Lamp构建论坛

Lamp环境已成功搭建完成
论坛的实现
解压
[[email protected] ~]# unzip phpwind_GBK_8.3.zip
建立虚拟目录
[[email protected] ~]# cd phpwind_GBK_8.3
[[email protected] phpwind_GBK_8.3]# mv upload/ /var/www/html/phpwind
修改编码禁用UTF-8
[[email protected] phpwind_GBK_8.3]# vim /etc/httpd/conf/httpd.conf
747 #AddDefaultCharset UTF-8
重新启动apache服务
[[email protected] phpwind_GBK_8.3]# service httpd restart
查看http://192.168.2.100/phpwind/install.php

Lamp构建论坛

设递归设置目录权限为777简单如下
[[email protected] ~]# cd /var/www/html/
[[email protected] html]# cd phpwind/
[[email protected] phpwind]# chmod -R 777 p_w_upload
[[email protected] phpwind]# chmod -R 777 data
[[email protected] phpwind]# chmod -R 777 html
选择 开始安装

Lamp构建论坛

同意协议下一步

Lamp构建论坛

填写信息,下一步

Lamp构建论坛

安装详细信息

Lamp构建论坛

安装成功
 

Lamp构建论坛

删除inistall.php文件
[[email protected] phpwind]# rm inistall.php

Lamp构建论坛 

管理员登录:

Lamp构建论坛

Lamp构建论坛 

 

Lamp构建论坛 

登陆成功!!!