apache+mysql+php

groupadd mysql
useradd -g mysql -d /usr/local/mysql/data -M mysql -s /sbin/nologin
tar -zxvf mysql-5.0.17.tar.gz
cd mysql-5.0.17
./configure --prefix=/usr/local/mysql \      指定安装目录
> --sysconfdir=/etc \                    配置文件的路径
> --localstatedir=/usr/local/mysql/data \     数据库存放的路径
> --enable-assembler \                使用一些字符函数的汇编版本
> --with-mysqld-ldflags=-all-static \        以纯静态方式编译服务端
> --with-charset=utf8 \                   添加utf8字符支持
> --with-extra-charsets=all                添加所有字符支持
# make
# make install
# /usr/local/mysql/bin/mysql_install_db
# chown -R mysql:mysql /usr/local/mysql/data
# cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
#  chkconfig --add mysqld
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
service mysqld restart
创建root用户密码:
./bin/mysqladmin  -u root password "111111"

安装Apache
tar -zvxf httpd-2.2.tar.gz
cd httpd-2.2
./configure --prefix=/usr/local/httpd  --enable-so  --enable-mods-shared=most      --enable-rewrite=shared
make
make install


安装freetype
rpm -ivh freetype-devel-2.2.1-19.el5.i386.rpm

安装libpng
rpm -ivh libpng-devel-1.2.10-7.0.2.i386.rpm


安装jpeg
rpm -ivh libjpeg-devel-6b-37.i386.rpm  

安装GD
tar xzvf gd-2.0.33.tar.gz
./configure  --with-jpeg --with-png --with-zlib --with-freetype
make
make install

安装mcrypt
tar xzvf libmcrypt-2.5.7.tar.gz
./confingure --prefix=/usr/local/modules/libmcrypt
make
make install

安装MHASH
tar -zxvf mhash-0.9.9.tar.gz
./confingure
make
make install

关闭Selinux
vi /etc/selinux/config
SELINUX=disabled
重新启动
shutdown -r now

安装php
tar -zxvf php-5.2.6.tar.gz
cd php-5.1.1
cp /usr/local/mysql/bin/mysql_config  /usr/local/bin/.  
./configure  --prefix=/usr/local/php5   --with-apxs2=/usr/local/httpd/bin/apxs   --with-mysql=/usr/local/mysql  --with-gd   --enable-gd-native-ttf   --with-jpeg-dir  --with-png-dir  --with-zlib  --with-freetype-dir  --with-libxml-dir  --enable-sockets  --enable-soap  --enable-mbstring  --with-iconv-dir  --with-mcrypt   --with-curl  --with-pdo-mysql --with-mhash --with-openssl
make
make install

cp ./php.ini-dist /usr/local/php5/lib/php.ini

修改httpd.conf
vi /usr/local/httpd/conf/httpd.conf

在354行加上此两行
AddType application/x-httpd-php .php .phtml

测试
service httpd restart

cd /usr/local/httpd/htdoc
vi  phpinfo.php
加入如下内容
<?php
        phpinfo();
?>

ip/phpinfo.php
如果打不开,查看一下防火墙
iptables -L
iptables -F
iptables-save
加入memcache-php


tar vxzf memcache-1.5.tgz
cd memcache-1.5
/usr/local/php/bin/phpize
./configure --enable-memcache --with-php-config=/usr/local/php5/bin/php-config --with-zlib-dir
make
make install

安装完后会有类似这样的提示:
Installing shared extensions:     /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/
把这个复制下来,然后修改php.ini,将486行
extension_dir = "./"
修改为
extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/"
并在592行后添加一行
extension=memcache.so

重启apache,查看phpinfo看是否有memcache模块

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值