第一步:系统与软件的准备
系统版本 redhat enterprise linux v5.3 ,内核版本 2.6.18
第二步:软件包的准备
Apache2软件包:httpd-2.2.13.tar.gz
php5软件包:php-5.3.0.tar.gz
第三步, 架设YUM仓库
由于系统连GCC都没有给我们安装,因此是无法直接去make安装上述源代码的,必须先使用系统光盘架设一个YUM代码仓库,从中安装我们所需要的各种软件。
首先,我们按照系统安装光盘上所有的文件拷贝一份到RHEL5中(假设放置目录为/home/phinecos/back)
然后,我们要先安装一个RPM包才能开始架设YUM仓库
# rpm-ihvcreaterepo- 0.4 . 4 - 2 . fc6 . noarch . rpm
这个包安装之后,会生成一个新的命令:/usr/bin/createrepo,而这个命令是我下面必须要用到的。
RHEL5 所有的 Package 主要位于 Server, VT, Cluster, ClusterStorage 等目录, 该目录内有 repodata/ 目录放置 yum 程序所需要的索引信息档案, 包含 GUI 的套件新增移除所需要的大项分类信息. 不过由于该档案预设提供的是 cd disc 的方式安装使用, 所以需要手动建立新的档案提供 yum 与 GUI Packager 正常运作使用.
首先先复制出来 Server, VT, Cluster, ClusterStorage 目录内位于 repodata/ 内 comps-rhel5-*.xml 档案到暂存目录内提供后续要使用, 然后删除 repodata 目录, 重新建立新的 repodata 目录结构与必要索引档案.
for nameinServerVTClusterClusterStorage
do
cp $ name / repodata / comps-rhel5-* . xml / tmp
done
# Server
cd / home / phinecos / back / Server
rm-rfrepodata
createrepo-g / tmp / comps-rhel5-server-core . xml .
# VT
cd / home / phinecos / back / VT
rm-rfrepodata
createrepo-g / tmp / comps-rhel5-vt . xml .
# Cluster
cd / home / phinecos / back / Cluster
rm-rfrepodata
createrepo-g / tmp / comps-rhel5-cluster . xml .
# ClusterStorage
cd / home / phinecos / back / ClusterStorage
rm-rfrepodata
createrepo-g / tmp / comps-rhel5-cluster-st . xml .
我们的YUM仓库到这里也就建好了。接下来,我们要做的就是要设置/etc/yum.repo.d里面的内容了,首先创建一个rhel-server.repo文件,在其中写入下述内容:
name = RedHatEnterpriseLinuxServerCore
baseurl = file: /// home / phinecos / back / Server
enabled = 1
gpgcheck = 0
gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-redhat-release
[VT]
name = RedHatEnterpriseLinuxVirtualTechnology
baseurl = file: /// home / phinecos / back / VT
enabled = 1
gpgcheck = 0
gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-redhat-release
[Cluster]
name = RedHatEnterpriseLinuxCluster
baseurl = file: /// home / phinecos / back / Cluster
enabled = 1
gpgcheck = 0
gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-redhat-release
[ClusterStorage]
name = RedHatEnterpriseLinuxClusterStorage
baseurl = file: /// home / phinecos / back / ClusterStorage
enabled = 1
gpgcheck = 0
gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-redhat-release
当然,你也可以通过http与ftp方式把这个目录发布出去,那只要把相关的file:/// home/phinecos/back/这部分修改一下就可以了。
第四步,安装图形化互联网,开发工具等必须的软件
“Applications”à”Add/Remove Software”里面安装所需的基本工具软件,如gcc等。
第五步,安装Apache2
# cd http- 2.2 . 8
#./ configure--prefix =/ usr / local / apache2--enable-rule = SHARED_CORE--enable-module = so
# make
# makeinstall
安装apache完成,输入命令
从本地或其它机器打开Firefox浏览器,输入地址http://127.0.0.1/,如果正确的话会出现一个"It works !"的提示页面,此时,apache2基本安装完成。
第五步,安装MySQL
“Applications”à”Add/Remove Software”里面找到MySql,进行安装,如果安装后发现启动mysql时出现:
这是SELINUX在作怪,解决办法:
改为:SELINUX = disabled
然后保存,电脑重启,然后再把以前装的MYSQL删除重装下
启动mysql
停止mysql
或者也可以采用rpm的方式来安装.首先从安装光盘中安装perl-DBI包,在Server文件夹中可以找到
安装完成后再依次安装mysql的其他包
# rpm-ivhMySQL-client-community- 5.0 . 51a- 0 . rhel5 . i386 . rpm
# rpm-ivhMySQL-devel-community- 5.0 . 51a- 0 . rhel5 . i386 . rpm
# rpm-ivhMySQL-shared-community- 5.0 . 51a- 0 . rhel5 . i386 . rpm
安装完成后修改mysql的root用户密码,默认为空,修改命令如下
以后再从命令行登录mysql的就输入
会提示输入密码,Mysql的基本安装完成。
第六步,安装Php
# ./ configure--prefix =/ usr / local / php--with-mysql--with-apxs2 =/ usr / local / apache2 / bin / apxs
# make
# makeinstall
# cpphp . ini-dist / usr / local / php / lib / php . ini
对php.ini进行修改,把short_open_tag = Off改为short_open_tag = On
编辑Apache配置文件即/usr/local/apache/conf/httpd.conf,并添加以下一行:
AddTypeapplication / x-httpd-php-source . phps
并在 DirectoryIndex 一行加上 index.php
LoadModulephp5_modulemodules / libphp5 . so
保存并退出
建立test.php文件放在apache目录下的htdocs下,内容如下:
phpinfo ();
?>
通过浏览器查看http://127.0.0.1/test.php
Redhat添加中文支持
然后在“系统”—“语言”中选择“中文简体”
第七步,安装discuz
下载Discuz安装包
$ mkdir discus
$ wgethttp: // download2 . comsenz . com / Discuz / 7.0 . 0 / Discuz_7 . 0 . 0_FULL_SC_GBK . zip
解压
在/usr/local/apache2/htdocs下新建bbs目录,将前面解压出的upload目录下所有文件复制到 bbs目录中
给htdocs文件夹777属性,
打开浏览器,输入: