httpd-2.2.4.tar.gz php-4.4.6.tar.tar mysql-5.0.18.tar.gz
首先说一下编码,安装mysql的时候,默认使用latin1编码,如果要改变默认编码,用选项--with-charst
例如:
shell> ./configure --with-charset=CHARSET
CHARSET 可以使下面编码中的一种: `big5', `cp1251', `cp1257', `czech',
`danish', `dec8', `dos', `euc_kr', `gb2312', `gbk', `german1',
`hebrew', `hp8', `hungarian', `koi8_ru', `koi8_ukr', `latin1',
`latin2', `sjis', `swe7', `tis620', `ujis', `usa7', or
`win1251ukr'. See *Note character-sets::.
所有这些操作需要root权限
安装开始:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql --with-charset=gb2312
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
(用mysql用户启动很重要。)
shell> bin/mysql -uroot -p
(输入密码,默认密码为空,直接回车即可)
shell> Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
如果出现上面的提示,说明mysql服务没有正常启动,因为mysql服务启动的话,会自动生成mysql.sock文件
shell> killall mysql
杀掉所有mysql进程,重新启动
shell> bin/mysql_install_db --user=mysql
重新启动
shell> bin/mysql -uroot -p
再来安装apache
tar -zxvf httpd-2.0.52.tar.gz
cd httpd-2.0.52
emacs INSTALL 获得一些安装信息
./configure --prefix=/usr/apache --enable-module=most --enable-shared=max --enable-module=so
make ; make install
cd /usr/local/apache2/bin
./apachectl start
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
这时打开浏览器,输入127.0.0.1或你的电脑名,我的为tian1118,然后你就可以看到漂亮的羽毛,证明apache安装成功,而且可以正确显示出简体中文,真爽。
再仔细看看,好像有点问题。
cd /usr/loca/apache2/conf/ cp httpd.conf beifei 备份一下,免得自己改错了。
emacs httpd.conf
找到#ServerName www.example.com:80
把它改为ServerName 127.0.0.1
../bin/apachectl restart 没有出错提示证明成功
再来安装php
tar -zxvf php-5.0.2.tar.gz
cd php-5.0.2
emacs INSTALL 获得一些安装信息
./configure --with-apxs2=/usr/local/httpd/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
cp php.ini-dist /usr/local/lib/php.ini
cp:是否覆盖‘/usr/local/lib/php.ini’? y