软件下载:
httpd-2.2.9.tar.gz
http://apache.mirror.phpchina.com/httpd/httpd-2.0.63.tar.bz2
mysql-4.0.21.tar.gz
http://www.serverlogistics.com/software/sources/mysql-4.0.21.tar.gz
php-4.4.9.tar.bz2
http://cn.php.net/distributions/php-4.4.9.tar.bz2
安装过程:
tar zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9
./configure --sysconfdir=/etc --enable-ssl --enable-modules
make
make install
netstat -tnl (查看是否开启80端口)
启动web服务
/usr/local/apache2/bin/apache1 start
netstat -tnl 开启了80端口说明服务启动成功
测试
links或elinks http://localhost
按q退出
tar zxvf mysql-4.0.21.tar.gz
cd mysql-4.0.21
./configure --sysconfdir=/etc
make
make install
cd /usr/local/share/mysql
ls
(选择一种数据库类型large或small或medium表示处理数据的大小,我这选择large)
cp my-large.cnf /etc/my.cnf
初始化数据库:
新建一个管理数据库的主目录为(usr/local/var)的mysql用户
useradd -d /usr/local/var mysql
设置密码(也可不设密码)
password mysql
登录mysql用户
su - mysql
可执行的初始化文件,初始化数据库
/usr/local/bin/mysql_install_db
启动服务器
/usr/local/bin/mysqld_safe
登录测试
cd /usr/local
mysql -u root
\s 系统参数
\q 退出
tar jxvf php-4.4.9.tar.bz
cd php-4.4.9
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local(数据库mysql的安装目录)
make ; make intall
配置apache配置文件/etc/httpd.conf
vi /etc/httpd.conf
查找(/AddType )然后在光标处
添加 AddType application/x-httpd-php .php .phtml(是apache认识php编写的网页)
保存退出
进入解压的php-4.4.9目录里
cp php.ini-dist /usr/local/lib/php.ini
编写测试页面
vi /usr/local/apache2/htdocs/test.php
写入
phpinfo();
?>这三行代码(显示php的系统参数)
保存退出
重新启动服务器
/usr/local/apache2/bin/apache1 stop
/usr/local/apache2/bin/apache1 start
测试编写的test.php文件
links或elinks http://localhost/test.php
收尾工作
让apache自启动
echo "/usr/local/apache2/bin/apache1 start " >> /etc/rc.local
让mysql数据库服务器自动启动
cp /usr/local/share/mysql/mysql.server /etc/init.d/mysqld
至此安装完成!!
yichfot 于 2008-09-06 20:39:28发表:
以后可能会配置,我先收下了