REDHATENTERPRISELINUX搭建PHP运行环境搭建一个论坛,以discuz为模板,RedHat为系统,阿帕奇为web服务器,搭建PHP环境,后台为MySQL数据库,即时下流行的“LAMP”。Discuz_7.2_FULL_SC_UTF8mysql-5.0.22-2.1httpd-2.2.3-6.el5php-5.1.6-5.el51、PHP的运行是在阿帕奇服务之上的,首先要安装httpd服务[root@localhost~]#clear[root@localhost~]#rpm-qa|grephttpd[root@localhost~]#mount/dev/cdrom/mnt/cdrom[root@localhost~]#yuminstall-yhttpd重启httpd服务,测试阿帕奇服务器:阿帕奇测试页:2、安装PHP解释器:默认安装后,再次查询会显示以下组件:[root@localhost~]#rpm-qa|grepphpphp-common-5.1.6-5.el5php-5.1.6-5.el5php-cli-5.1.6-5.el5[root@localhost~]#还需要一个rpm包,来支持php与MySQL数据库包名为php-mysql编辑php配置文件:[root@localhost~]#vi/etc/httpd/conf.d/php.conf增加拓展名为.php文件的处理关系测试PHP环境:在Apache主目录/var/www/html中建立一个名为test.php文件文件内容如下:重启httpd服务测试:3、安装MySQL数据库,为安装起见,并修改数据库密码为123[root@localhost~]#yuminstall–ymysql*[root@localhost~]#rpm–qa|grepmysql启动MySQL数据库:[root@localhost~]#servicemysqldstart初始化MySQL数据库:InstallingallpreparedtablesFillhelptablesTostartmysqldatboottimeyouhavetocopysupport-files/mysql.servertotherightplaceforyoursystemPLEASEREMEMBERTOSETAPASSWORDFORTHEMySQLrootUSER!Todoso,starttheserver,thenissuethefollowingcommands:/usr/bin/mysqladmin-urootpassword'new-password'/usr/bin/mysqladmin-uroot-hlocalhost.localdomainpassword'new-password'Seethemanualformoreinstructions.YoucanstarttheMySQLdaemonwith:cd/usr;/usr/bin/mysqld_safe&YoucantesttheMySQLdaemonwiththebenchmarksinthe'sql-bench'directory:cdsql-bench;perlrun-all-testsPleasereportanyproblemswiththe/usr/bin/mysqlbugscript!ThelatestinformationaboutMySQLisavailableonthewebathttp://www.mysql.comSupportMySQLbybuyingsupport/licensesathttp://shop.mysql.com[确定]启动MySQL:[确定]修改密码:[root@localhost~]#mysqladmin-urootpassword123登陆数据库:查看数据库:4、搭建samba服务,将discuz安装程序目录upload放到/var/www/html/下如果samba配置没错误,但是仍然无法将安装文件复制到linux中,请将selinux设置为允许,同时在iptables中放行相关端口修改upload目录中相关目录权限:以下这些目录及文件需要可读写权限./config.inc.php./templates./attachments./forumdata./forumdata/cache./forumdata/templates./forumdata/threadcaches./forumdata/logs./uc_client/data/cache/5、开始安装:在浏览器中输入:http://192.168.2.2/upload/install/根据提示进行安装环境以及文件目录权限检查:填写数据库信息:数据库用户名:默认为username修改为root数据库密码:123Admin密码:在此设置为admin其他根据情况填写直至安装完成后跳转到论坛首页:我们再来看一下MySQL数据库:[root@localhostinstall]#mysql-uroot-pEnterpassword:WelcometotheMySQLmonitor.Commandsendwith;or\g.YourMySQLconnectionidis52toserverversion:5.0.22Type'help;'or'\h'forhelp.Type'\c'toclearthebuffer.mysql>showdatabases;+--------------------+|Database|+--------------------+|information_schema||discuz||mysql||test|+--------------------+4rowsinset(0.00sec)mysql>usediscuzReadingtableinformationforcompletionoftableandcolumnnamesYoucanturnoffthisfeaturetogetaquickerstartupwith-ADatabasechangedmysql>showtables;+-------------------------+|Tables_in_discuz|+-------------------------+|cdb_access||cdb_activities||cdb_activityapplies||cdb_addons||cdb_adminactions||cdb_admincustom||cdb_admingroups||cdb_adminnotes||cdb_adminsessions||cdb_advertisements||cdb_announcements||cdb_attachme...