apache+mysql+php for linux全攻略
安装gcc gcc-c++ make 包
安装顺序:
1.libxml2-2.6.30
libxml2-2.6.30
#./configure --prefix=/usr/local/libxml2/
#make && make install
删除用源代码包安装的软件:
1.删除安装的目录文件
2.删除源代码安装源文件
2.libmcrypt-2.5.8
#./configure --perfix=/usr/local/libmcrypt/
#make && make install
#[root@node203 libmcrypt-2.5.8]# cd libltdl/
#[root@node203 libmcrypt-2.5.8]#./configure --enable-ltdl-install
#[root@node203 libmcrypt-2.5.8]#make && make install
3.zlib-1.2.3
#./configure
在没有指定安装目录的时候,要删除所安装的软件,可以将安装的信息写入一个日志中eg:#make install > /backup/zlib_2013.install.log
#make && make install
4.libpng-1.2.31
#./configure --prefix=/usr/local/libpng
#make && make install
5.jpeg-6g jpegsrc.v6b.tar.gz
[[root@node203 jpeg-6b]# mkdir /usr/local/jpeg6
[root@node203 jpeg-6b]# mkdir /usr/local/jpeg6/bin
[root@node203 jpeg-6b]# mkdir /usr/local/jpeg6/lib
[root@node203 jpeg-6b]# mkdir /usr/local/jpeg6/include
[root@node203 jpeg-6b]# mkdir /usr/local/jpeg6/man1
[root@node203 jpeg-6b]# mkdir /usr/local/jpeg6/man/man1
[root@node203 jpeg-6b]# mkdir -p /usr/local/jpeg6/man/man1
[root@node203 jpeg-6b]# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
[root@node203 jpeg-6b]# make && make install
6.freetype freetype-2.3.5.tar.gz
[root@node203 freetype-2.3.5]# ./configure --prefix=/usr/local/freetype/
[root@node203 freetype-2.3.5]# make && make install
7.autoconfig autoc onf-2.61.tar.gz
#./configure
#make && make install
8.gd gd-2.0.35.tar.gz
#./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/
#make && make install
9.httpd httpd-2.2.9.tar.gz
cd /lamp/httpd-2.2.9
./configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable- deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support
#查看所有的参数:./configure --help
#make && make install
#开启模块的权限:#chcon -t texrel_shlib_t /usr/local/apache2/modules/mod_rewrite.so
#开机自动启动:echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.local
10.ncurses-5.6 ncurses-5.6.tar.gz
#./configure --with-shared --without-debug --without-ada --enable-overwrite
#make && make install
11.mysql mysql-5.0.41.tar.gz
[root@node203 ncurses-5.6]# groupadd mysql
[root@node203 ncurses-5.6]# useradd -g mysql mysql
[root@node203 mysql-5.0.41]# ./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all
[root@node203 mysql-5.0.41]#make && make install
groupadd mysql
useradd -g mysql mysql
cd /lamp/mysql-5.0.41
./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql //创建初始授权表
chown -R mysql /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql & //当mysql服务器程序发生错误时,mysqld_safe会重新启动服务器
# ps -le | grep myslqd
#netstat -an | grep 3306
#查看mysql版本信息:/usr/local/mysql/bin/mysqladmin version|variables
#设置root密码:set password for `root`@`localhost`=password(`123`)
cp /lamp/mysql-5.0.41/support-files/mysql.server /etc/rc.d/init.d/mysqld
chown root.root /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld
chkconfig --levels 245 mysqld off
12.PHP php-5.2.6.tar.gz
cd /lamp/php-5.2.6
./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd2/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets
#问题:
libtool yum install libtool
libltdl.so yum install libtool-ltdl
make
make install
cp php.ini-dist /usr/local/php/etc/php.ini
echo "Addtype application/x-httpd-php .php .phtml" >> /usr/local/apache2/conf/httpd.conf
/usr/local/apache2/bin/apachectl restart
13.zend
cd zend
./install.sh
14.phpmyadmin
cp phpmyadmin /usr/local/apache2/htdocs/phpmyadmin
cd /usr/local/apache2/htdocs/phpmyadmin/
cp config.sample.inc.php config.inc.php
vim config.inc.php
$cfg[`Servers`][$i][`auth_type`] = `http`
make clean
make clean all