转载请注明出处:
http://bbs.mmqun.com/thread-15144-1-1.html
step1:
OS:redhat 9.0
自己拿盘装
apache:httpd-2.0.58.
[各种版本请去http://apache.justdn.org/httpd下载]
http://apache.justdn.org/httpd/httpd-2.0.58.tar.gz
PHP 4.4.1
[可在官方下载5.1.1和4.4.2两个版本http://www.php.net/downloads.php]
http://cn.php.net/get/php-4.4.1.tar.gz/from/cn2.php.net/mirror
MySQL Database Server 5.0.22
[各种版本可在mysql官方下载到 http://downloads.mysql.com/archives.php]
http://downloads.mysql.com/archi ... i686-glibc23.tar.gz
Zend Optimizer 3.0.1
[Zend Optimizer各种版本请见:downloads.zend.org]
http://downloads.zend.org/optimi ... glibc21-i386.tar.gz
step2:
全部wget完毕
安装环境如果不确定的朋友,用rpm查一下
如果原来编译安装的,删了即可,放那也没事
rpm qa | grep apache
rpm qa | grep mysql
rpm qa | grep php
再顺便查查
rpm -qa | grep zlib
rpm -qa | grep libpng
rpm -qa | grep freetype
rpm -qa | grep jpeg
rpm -qa | grep gd
如果没有的话
下载
tar zxvf xxxx.tar.gz
./configure --prefix=/path
make
make install
因为我要装discuz,所以需要gd支持水印
安装顺序:mysql > apache > php > zend
step3:具体安装
1,mysql
cd /usr/local
groupadd mysql
useradd -g mysql mysql
cd /usr/local
tar zxvf mysql-standard-5.0.22-linux-i686.tar.gz
ln -s mysql-VERSION-OS mysql
cd mysql
scripts/mysql_install_db
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/data
chgrp -R mysql /usr/local/mysql
chown -R root /usr/local/mysql/bin
bin/safe_mysqld --user=mysql &
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
copy一个执行脚本
chkconfig --add mysqld
/etc/rc.d/init.d/mysqld start
此时,若你安装成功的话,会有如下提示:Starting MySQL SUCCESS!
2,apache
cd ..
返回/usr/local目录
tar zxvf httpd-2.0.58.tar.gz
cd httpd-2.0.58
./configure --prefix=/usr/local/apache --enable-so
编译apache,加上加载模块参数
make
make install
/usr/local/apache/bin/apachectl start
显示httpd (pid xxxxx) already running
ps -A
看看是否有httpd进程
vi /usr/local/apache/conf/httpd.conf
配置一下conf脚本
在http.conf最末端找到
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
复制,添加在最后去掉#修改为
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /home/wwwroot
ServerName 127.0.0.1
ServerAlias 127.0.0.1
</VirtualHost>
3,php
cd ..
tar xzvf php-4.4.1.tar.gz
cd php-4.4.1
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql --with-config-file-path=/usr/local/php/etc --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --enable-mbstring
make
make install
cp php.ini.dist /usr/local/php/lib/php.ini
修改php.ini文件,全局注册变量改为开启
register_globals = On
vi /usr/local/apache/conf/httpd.conf //编辑文件,加入php文件头支持
找到DirectoryIndex index.html index.html.var
改为DirectoryIndex index.php index.html index.html.var
找到
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
改为
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
4,zend
cd ..
tar xzvf ZendOptimizer-3.0.1-linux-glibc21-i386
rm -f ZendOptimizer-3.0.1-linux-glibc21-i386
cd ZendOptimizer-3.0.1-linux-glibc21-i386
# ./install.sh
mud安装过程中会要你输入php.ini的路径
我们已经在安装php的时候将dist脚本复制过去了
只需确定/usr/local/php/lib即可
最后
/usr/local/apache/bin/apachectl restart
在/home/wwwroot目录下保存为/index.php测试下:
<?php
echo 'installing linux+apache+mysql+php+zend success';
?>
打开浏览器,输入127.0.0.1
installing linux+apache+mysql+php+zend success
over
-------------------------------mmqun----8/1/2006--------
redhat下初次安装,有误导的地方,请多多指出
参考文档:
php-4.4.1/INSTALL
httpd-2.0.58/INSTALL
mysql-standard-5.0.22-linux-i686/INSTALL-BINARY
CU/http://bbs.chinaunix.net/viewthread.php?tid=215402&extra=page%3D1%26filter%3Ddigest
DZ/https://discuz.dismall.com/viewthread.php?tid=209728&extra=page%3D1%26amp%3Bfilter%3Ddigest |