会员控制台 会员登陆 会员注册 最后更新 高级搜索 会员投稿 退出登陆
设为首页
收藏本站
留言给我
  首页 | 操作系统类 | 程序设计类 | 数据库类 | 应用服务类 | 网络及硬件类 | 其他技术 | GBunix论坛
操作系统类
程序设计类
数据库类
应用服务类
网络及硬件类
其他技术
Unix中文 / 应用服务类 / WebServer / apache2、mysql4与php4整合安装
apache2、mysql4与php4整合安装
2004-06-11          点击:
apache2、mysql4与php4整合安装
一、系统环境
本系统为:Red Hat Linux----Advanced Server release 2.1AS
此安装也适合与Red Hat Linux 9.0

二、安装
2.1、源代码(请自行下载,版本相差不远关系不大)
mysql-4.x.tar.gz
httpd-2.x.tar.gz
php-4.x.tar.gz
2.2、安装mysql
请参照mysql时的安装文档:INSTALL-BINARY来安装,里面的详尽的说明。
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/safe_mysqld --user=mysql &
or
shell> bin/mysqld_safe --user=mysql &
if you are running MySQL 4.x
2.3、安装apache2
shell> tar zxvf apache2.x.tar.gz
shell> cd httpd-2.x
shell> ./configure --prefix=/usr/local/apache2
shell> make
shell> make install
apache2.x安装完成
2.4、安装php4
shell> tar zxvf php-4.x.tar.gz
shell> cd php-4.x
shell> ./configure --with-mysql --with-apxs2=/usr/local/apache/bin/apxs --enable-versioning --disable-debug --enable-track-vars
shell> make
shell> make install
--with-mysql 表示支持mysql
其中--with-apxs2=/usr/local/apache/bin/apxs一定不能少,这个参数把php以动态模块的方式安装到apache下
2.5、配置httpd.conf
shell> cd /usr/local/apache/conf
shell> vi httpd.conf
加入两行:
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
修改Listen x.x.x.x:80
x.x.x.x是你本机的IP

三、启动:
/usr/local/apache/bin/apachectl start

四、测试:
在/usr/local/apache/htdocs下
编辑index.php

在Mozilla中输入http://x.x.x.x/index.php
可以看见熟悉的php的表以及信息。

了解更多详情,参与讨论,请进入GBUNIX论坛

http://www.gbunix.com/bbs/index.php
责任编辑: trotter

相关文章
在Linux下用软件实现RAID功能 - 01-08 10:48 pm - 点击: 628
Linux下软件RAID的实现 - 08-15 02:27 pm - 点击: 648

发表评论 查看评论 加入收藏 Email给朋友 打印本文
给该文章评分
1 2 3 4 5 6 7 8 9 10
平均得分 5.80, 共 5 人评分
1 2 3 4 5 6 7 8 9 10
发表评论
标题:
内容:
声明:本站资讯均来自互联网,所有文章版权归原作者和出版者所有,如涉及版权问题,请来信告知!
Copyright © 2002-2004 GBunix.com. All rights reserved.