mysql 编译安装 版本mysql-5.0.41
./configure '--prefix=/usr/local/mysql' '--without-debug' '--with-charset=utf8' '--with-extra-charsets=all' '--enable-assembler' '--with-pthread' '--enable-thread-safe-client' '--with-mysqld-ldflags=-all-static' '--with-client-ldflags=-all-static' '--with-big-tables' '--with-readline' '--with-ssl' '--with-embedde'
缺少ncurses
yum install ncurses ncurses-devel 安装
make
make install
cp my-medium.cnf /etc/my.cnf
添加系统mysql组和mysql用户:
执行命令:groupadd mysql和useradd -r -g mysql mysql
入安装mysql软件目录:执行命令 cd /usr/local/mysql
修改当前目录拥有者为mysql用户:执行命令 chown -R mysql:mysql ./
安装数据库:执行命令 ./scripts/mysql_install_db --user=mysql
修改当前目录拥有者为root用户:执行命令 chown -R root:root ./
修改当前data目录拥有者为mysql用户:执行命令 chown -R mysql:mysql data
./mysql.server start 启动
apache 编译安装
版本 httpd-2.2.20 不需要安装apr
今日编译apache时出错:
#./configure --prefix……检查编辑环境时出现:
checking for APR... noconfigure: error: APR not found . Please read the documentation
解决办法:
1.下载所需软件包:
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
2.编译安装:
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
具体步骤如下:
a:解决apr not found问题>>>>>>
[root@xt test]# tar -zxf apr-1.4.5.tar.gz [root@xt test]# cd apr-1.4.5 [root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr [root@xt apr-1.4.5]# make && make install
b:解决APR-util not found问题>>>>
[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz [root@xt test]# cd apr-util-1.3.12 [root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config [root@xt apr-util-1.3.12]# make && make installc:解决pcre问题>>>>>>>>>
[root@xt test]#unzip -o pcre-8.10.zip [root@xt test]#cd pcre-8.10 [root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre [root@xt pcre-8.10]#make && make install
4.最后编译Apache时加上:
--with-apr=/usr/local/apr
--with-apr-util=/usr/local/apr-util
--with-pcre=/usr/local/pcre
./configure --prefix=/usr/local/apache2 --enable-cache --enable-disk-cache -enable-mem-cache --enable-file-cache --with-ssl --enable-ssl --enable-so --enable-mime-magic --enable-mods-shared=most --with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
缺少opensll-devel
yum install openssl-devel 安装
make
make install
./apachectl start 启动php 编译安装
版本php-5.2.6
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql
缺少xlmlib
yum install libxml2-devel 安装
make
make install
cp php.ini-development /usr/local/php5/lib/php.ini
vi /usr/local/apache2/conf/httpd.conf 添加php支持
AddType application/x-httpd-php .php
编译安装的apache 网页存放路径跟rpm包安装的不一样。编译安装的路径在/usr/local/apache2/htdocs/
可添加以下内容info.php到/usr/local/apache2/htdocs/下,测试php模块是否加载.复制代码 代码如下:
# vi /usr/local/apache2/htdocs/info.php
---------------<?phpecho phpinfo();?>