mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz
httpd-2.0.52.tar.gz
php-5.0.2.tar.gz
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MySql:
cp mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz /usr/local/
tar -zxvf mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz
cd mysql-standard-5.0.1-alpha-pc-linux-i686/
emacs INSTALL-BINARY 获得安装信息
'''''''''''''''''''''''''''''''''''''
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local 或 cd ..
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 --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
''''''''''''''''''''''''''''''''''''''''''''''''''''''
groupadd mysql
useradd -g mysql mysql
cd /usr/local/
ln -s mysql-standard-5.0.1-alpha-pc-linux-i686/ mysql 建立软链接
cd mysql
./scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
$ bin/mysqld_safe --user=mysql &
这样我们就将MySQL安装在我们的机器上了.
证明已经成功,可以用ps -aux │ grep mysql 可以看到。
安装成功
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Apache:
tar -zxvf httpd-2.0.52.tar.gz
cd httpd-2.0.52
emacs INSTALL 获得一些安装信息
''''''''''''''''''''''''''''''''''''''''''
./configure --enable-so --enable-so
make ; make install
'''''''''''''''''''''''''''''''''''''''''''
#./configure --enable-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
改中文显示
把“# DefaultLanguage nl”前面的“# ”去掉,把“nl”改成你要强制输出的语言,中文是“zh-cn”,保存,关闭。
./apachectl start
../bin/apachectl restart 没有出错提示证明成功
‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’
./apachectl stop
PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
PHP:
tar -zxvf php-5.0.2.tar.gz
cd php-5.0.2
emacs INSTALL 获得一些安装信息
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Example 2-1. Installation Instructions (Apache Shared Module Version)
for PHP
1. gunzip apache_xxx.tar.gz
2. tar -xvf apache_xxx.tar
3. gunzip php-xxx.tar.gz
4. tar -xvf php-xxx.tar
5. cd apache_xxx
6. ./configure --prefix=/www --enable-module=so
7. make
8. make install
9. cd ../php-xxx
..........................................................
# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd --enable-mbstring
./configure --prefix=/usr/local/php --with-apache=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --enable-track-vars --enable-ftp --enable-sigchild /*注意’/’和前面的字符中间有空格*/
配置PHP5可以加载Apache模块以及支持MySQL.
编译:
# maek
安装:
$ make install
经过这样的步骤以后我们就将PHP5安装在我们的机器上了
cp php.ini-dist /usr/local/lib/php.ini
cp:是否覆盖‘/usr/local/lib/php.ini’? y
php与apache整合
emacs /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
在它后面添加
AddType application/x-httpd-php .php
/usr/local/apache2/bin/apachectl restart
测试php
emacs /usr/local/apache2/htdocs/index.php
添加
打开浏览器,输入
http://127.0.0.1/index.php
可以看到关于php的信息,证明php安装成功。
./configure –prefix=/usr/local/php –with-mysql=/usr/local/mysql –enable-force-cgi-redirect –with-freetype-dir=/usr –with-png-dir=/usr –with-gd –enable-gd-native-ttf –with-ttf –with-gdbm –with-gettext –with-iconv –with-jpeg-dir=/usr –with-png –with-zlib –with-xml –enable-calendar –with-apxs=/usr/local/apache/bin/apxs