安装mysql
cd /usr/local/src
groupadd mysql
useradd mysql -g mysql
tar -xvf mysql-5.0.51a.tar.gz
cd mysql-5.0.51a
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all
如果在编译APACHE的时候,使用--with-mpm模块,所以就必须在编译MYSQL的时候加上
--enable-thread-safe-client.
这是PHP5.2的一个改进,在PHP5.2.0之前的版本都不需要MYSQL启用安全线程。
make && make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
chown -R mysql.mysql .
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
cd /usr/local/src/mysql-5.0.51a
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
service mysqld start
chkconfig mysqld on
/usr/local/mysql/bin/mysqladmin -uroot password redhat //redhat为新密码
/usr/local/mysql/bin/mysql -uroot -predhat
查看服务器是否运行
myslqadmin version (出现版本号说明正在运行)
ps -ef | grep mysql
netstat -tnlp | grep 3306
修改MySQL管理员口令
mysqladmin -uroot -p oldpasswd newpasswd
安裝libxml2
cd /usr/local/src
tar -xvf libxml2-2.6.23.tar.bz
cd libxml2-2.6.23
./configure --prefix=/usr/local/libxml2
make && make install
安裝zlib
cd /usr/local/src
tar -xvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure //这个配置编译命令不要加目录参数
make && make install
安裝jpeg6
mkdir -p /usr/local/jpeg6
mkdir -p /usr/local/jpeg6/bin
mkdir -p /usr/local/jpeg6/lib
mkdir -p /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man
mkdir -p /usr/local/jpeg6/man1
mkdir -p /usr/local/jpeg6/man/man1
cd /usr/local/src
tar -vxf jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make && make install
安裝libpng
cd /usr/local/src
tar -vxf libpng-1.2.12.tar.gz
cd libpng-1.2.12
./configure //和zlib一样不要带参数,让它默认安装到相应目录
make && make install
安裝freetype
cd /usr/local/src
tar -vxf freetype-2.3.4.tar.gz
cd freetype-2.3.4
mkdir -p /usr/local/freetype
./configure --prefix=/usr/local/freetype
make && make install
安裝GD库
cd /usr/local/src
tar -vxf gd-2.0.34.tar.gz
mkdir -p /usr/local/gd
cd gd-2.0.34
./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
make && make install
安装Apr和Apr-util
cd /usr/local/src
tar -zxvf apr-1.3.6.tar.gz
cd apr-1.3.6
./configure --prefix=/usr/local/apr
make && make install
tar -zxvf apr-util-1.3.8.tar.gz
cd apr-util-1.3.8
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
安装 apache
cd /usr/local/src
tar -xvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache2 --enable-modules=most --enable-so --enable-rewrite --enable-ssl --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-dav --enable-proxy --enable-proxy-ajp --enable-proxy-balancer
make && make install
//也可以使用--enable-mods-shared=most|all
安装 php
cd /usr/local/src
tar -xvf php-5.2.2.tar.gz
cd php-5.2.2
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-freetype-dir=/usr/local/freetype --with-gd=/usr/local/gd --with-zlib --with-libxml-dir=/usr/local/libxml2 --with-jpeg-dir=/usr/local/jpeg6 --with-png-dir --enable-mbstring=all --enable-mbregex --enable-shared --with-config-file-path=/etc //--with-config-file-path定义了php主配置文件php.ini的位置
make && make install
cp php.ini-dist /etc/php.ini
配置并启动Apache
在Apache主配置文件中增加:vim /usr/local/apache2/conf/httpd.conf
AddType application/x-httpd-php .php .phtml
DirectoryIndex index.html
改成:
DirectoryIndex index.php index.jsp index.html index.htm
添加到自启动
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
chmod +x /etc/rc.d/init.d/httpd
然后 vi /etc/rc.d/init.d/httpd 添加(#!/bin/sh下面)
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache Web Server
最后,运行chkconfig把Apache添加到系统的启动服务组里面:
chkconfig --add httpd
chkconfig httpd on
service httpd start
ps -ef | grep httpd
netstat -tnlp | grep 80
建立测试页面测试:vim /usr/local/apache2/htdocs/index.php
<?php
phpinfo();
?>
保存退出
重启apache
service httpd restart
http://172.28.1.254/
安装Zend
tar xvf ZendOptimizer-3.3.0a-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.3.0a-linux-glibc21-i386
./install.sh
出现一个界面
OK点回车
然后问你php的配置文件php.ini,我们前面已经知道是在/etc,下所以输入/etc
我们再输入IE看那个测试页Zend是否加载成功。
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
安装eaccelerator加速软件
eaccelerator是php的加速软件,使用后php的执行效率会有很大幅度的提升。目前eaccelerator0.9.5.2已经和ZendOptimizer-3.3.0能够基本上兼容啦。
tar xvf eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
/usr/local/php/bin/phpize //收集php信息,如版本
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
make && make install
编译安装后我们会看到屏幕提示的eaccelerator.so所在的目录,php5.2.x系列是在/usr/local/php/lib/php/extensions/no-debug-zts-20060613/,记住这个路径,待会要用到。
有可能是: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/,
修改php.ini
vim /etc/php.ini
安装php扩展
在文件最后,[zend]之前,注意,这部分内容务必放在[zend]之前,不然可能会出现不可预期的服务器问题。添加下列信息:
引用:
[eaccelerator]
extension="/usr/local/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
建立目录:
mkdir /tmp/eaccelerator
chmod 777 /tmp/eaccelerator
重启apache然后在IE还是那个php测试页,zend哪又有没有变化如没有,说明这种方法没有好用。
在浏览器中打开phpinfo()那个测试页,如果出现以下内容,证明安装成功!
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies
最后就可以把网站工程放在/usr/local/htdocs目录下进行测试了。
LMAP安裝
最新推荐文章于 2019-10-21 16:01:06 发布