cp mysql-standard-4.0.25-pc-linux-gnu-i686.tar.gz /usr/local/
tar -zxvf mysql-standard-4.0.25-pc-linux-gnu-i686.tar.gz
cd mysql-standard-4.0.25-pc-linux-gnu-i686/
vi INSTALL-BINARY 获得安装信息
groupadd mysql
useradd -g mysql mysql
cd /usr/local/
mv mysql-standard-4.0.25-pc-linux-gnu-i686 mysql 安装文档该步骤为建立软链接
./scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
./bin/mysqld_safe --user=mysql & 从后台启动mysql,这时会看到
[1] 3879
[root--1014--/usr/local/mysql]Starting mysqld daemon with databases from /usr/local/mysql/data
证明已经成功,可以用ps -aux │ grep mysql 可以看到。
测试:
/usr/local/mysql/bin/mysql
mysql>show database;
mysql>exit;
mysqladmin -uroot -p '你的旧密码'(默认为空) '你的新密码'
二、安装apache
tar -zxvf httpd-2.0.54.tar.gz
cd httpd-2.0.54
vi INSTALL 获得一些安装信息
mkdir /usr/local/apache2
./configure --perfix=/usr/local/apache2 --enable-module=so
make ; make install
cd /usr/local/apache2/bin
cd /usr/loca/apache2/conf/
查找#ServerName www.example.com:80
改为ServerName 127.0.0.1:80
./apachectl start
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
测试:打开浏览器,在地址栏输入127.0.0.1或你的电脑名,如果可以看到漂亮的羽毛,证明apache安装成功。
三、安装php
tar -zxvf php-4.4.0.tar.gz
cd php-4.4.0
vi INSTALL 获得一些安装信息
mkdir /usr/local/php4
./configure --prefix=/usr/local/php4 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
如果出现如下证明快成功了。
+--------------------------------------------------------------------+
│ License: │
│ This software is subject to the PHP License, available in this │
│ distribution in the file LICENSE. By continuing this installation │
│ process, you are bound by the terms of this license agreement. │
│ If you do not agree with the terms of this license, you must abort │
│ the installation process at this point. │
+--------------------------------------------------------------------+
Thank you for using PHP.
make
make install
四、php与apache整合
vi /usr/local/apache2/conf/httpd.conf
找到DirectoryIndex改为如下:
DirectoryIndex index.html index.php index.htm index.html.var
找到
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
在它后面添加,增加PHP支持模组
AddType application/x-httpd-php .php
/usr/local/apache2/bin/apachectl restart
测试:
vi /usr/local/apache2/htdocs/index.php
添加 ,保存退出
打开浏览器,输入