wget
wget
wget
wget
wget
wget
wget
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.25-rc.tar.gz/from/http://mysql.byungsoo.net/
wget 或者使用yum 安装依赖包
- #!/bin/bash
- yum install curl curl-devel zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel perl perl-devel gd gd-devel libtool libtool-ltdl libtool-ltdl-devel fontconfig fontconfig-devel freetds freetds-devel freetype freetype-devel libjpeg-devel libpng-devel libc-client-devel pam-devel -y
- INSTALLDIR=/usr/local
-
DIR=/usr/local/src
- IMAPVER=imap-2007f
- cd /usr/local/src
- tar xvzf $DIR/$IMAPVER.tar.gz
- cd $DIR/$IMAPVER
- make lsu IP6=4 EXTRACFLAGS=-fPIC
- mkdir -p /usr/local/imap/{include,lib}
- cp c-client/c-client.a /usr/local/imap/lib
- cp c-client/c-client.a /usr/local/imap/lib/libc-client.a
- cp c-client/*.c /usr/local/imap/lib
- cp c-client/*.h /usr/local/imap/include
-
-
LIBICONV=libiconv-1.14
cd $INSTALLDIR
tar zxvf $DIR/$LIBICONV.tar.gz
cd $LIBICONV
./configure
make && make install
ln -s /usr/lib64/libjpeg.so* /usr/lib/
ln -s /usr/lib64/libpng* /usr/lib/
ln -s /usr/lib64/libsybdb.so* /usr/lib/
echo "/usr/local/lib64">>/etc/ld.so.conf
echo "/usr/local/lib">>/etc/ld.so.conf
/sbin/ldconfig
LD_RUN_PATH=$BASE/openssl/lib:$BASE/mysql/lib/:$BASE/zlib/lib:$BASE/gd/lib:$BASE/libxml2/lib
export LD_RUN_PATH
1.)ZLIB
ZLIB=$BASE/zlib
tar xzf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=$ZLIB
make && make install
2.)LIBICONV
LIBICONV=$BASE/gd
tar xzf libiconv-1.9.2.tar.gz
cd libiconv-1.9.2
./configure --prefix=$LIBICONV --enable-static=yes
3.)FREETYPE
FREETYPE=$BASE/gd
tar xzf freetype-2.1.3.tar.gz
cd freetype-2.1.3
./configure --prefix=$FREETYPE
make && make install
4.)LIBJPEG
LIBJPEG=$BASE/gd
tar xzf libjpeg-6b.tar.gz
cd libjpeg-6b
./configure --prefix=$LIBJPEG --enable-shared
mkdir $BASE/gd/man/man1
make & make install
5.)LIBPNG
LIBPNG=$BASE/gd
tar xzf libpng-1.2.30.tar.gz
cd libpng-1.2.30
LDFLAGS="-L$BASE/zlib/lib -Wl,-R$BASE/zlib/lib/"
CPPFLAGS="-I$BASE/zlib/include"
export LDFLAGS CPPFLAGS
./configure --prefix=$LIBPNG
make & make install
/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol' can not be used when
making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
解决办法 : 重新安装 zlib-1.2.3.tar.gz
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
vi Makefile
找到 CFLAGS=-O3 -DUSE_MMAP
在后面加入-fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC
接下面步骤
make
make install
LIBXML=$BASE/libxml2
tar xzf libxml2-sources-2.6.32.tar.gz
cd libxml2-2.6.32
./configure --prefix=$LIBXML --with-iconv=$BASE/gd --with-zlib=$BASE/zlib
make & make install
7.)GD
GD=$BASE/gd
tar xzf gd-2.0.35RC4.tar.gz
cd gd-2.0.35RC4
./configure --prefix=$GD --with-png=$BASE/gd --with-freetype=$BASE/gd --with-jpeg=$BASE/gd
OPENSSL=$BASE/openssl
./config --prefix=$OPENSSL no-threads shared -fPIC
make && make test && make install
9.)MYSQL
tar xzf mysql-5.1.25-rc.tar.gz
cd mysql-5.1.25-rc
#CFLAGS="-O3 -mpentiumpro"
#CXX="gcc"
#CXXFLAGS="-O3 -mpentiumpro -felide-constructors"
#export CFLAGS CXX CXXFLAGS
./configure --prefix=$MYSQL --enable-assembler --with-charset=gbk \
make & make install
mkdir $MYSQL/var
cp mysql-version/share/mysql/my-large.cnf $MYSQL/var/my.cnf
checking for tgetent in -ltermcap... no
checking for termcap functions library... configure: error: No curses/termcap library found
innodb_data_file_path = ibdata1:2000M;ibdata2:2000M
innodb_log_group_home_dir = /mysql/var
set-variable = innodb_mirrored_log_groups=1
set-variable = innodb_log_files_in_group=3
set-variable = innodb_log_file_size=30M
set-variable = innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
innodb_log_arch_dir = /mysql/var
innodb_log_archive=0
set-variable = innodb_buffer_pool_size=80M
set-variable = innodb_additional_mem_pool_size=10M
set-variable = innodb_file_io_threads=4
set-variable = innodb_lock_wait_timeout=50
10.)APACHE
export CPPFLAGS="-I$BASE/openssl/include"
./configure --prefix=$BASE/apache --enable-ssl --with-ssl=$BASE/openssl \
--enable-so --enable-mods-shared=most \
--enable-dav --enable-maintainer-mode
make &&make install
# ./configure \
# --enable-modules=vhost_alias so logio cache cache_mem \
# --disable-userdir \
# --with-mpm=worker \
# --enable-lib64
/usr/lib/libexpat.so: could not read symbols: File in wrong format
这个问题出现在configure后的make,也就是说configure都能顺利通过,但是在make这一步时确有问题了。/usr/lib/libexpat.so: could not read symbols: File in wrong format
1、删除安装目录下的configure文件,在我的环境中是httpd-2.2.6/configure
2、删除“httpd-2.26/srclib/apr-util/configure”
3、通过以下命令重建编译文件(以下命令在http-2.26/目录下运行)。
#./buildconf
4. 、通过以上重建编译文件,现在可以拥有64位的apr-util了,最后在编辑时加上以上参数:
./configure --enable-lib64=/usr/lib64
--with-openssl=$BASE/openssl --with-mysql=$BASE/mysql \
--with-zlib-dir=$BASE/zlib --with-jpeg-dir=$BASE/gd \
--with-png-dir=$BASE/gd --with-freetype-dir=$BASE/gd \
--with-ttf --enable-gd-native-ttf --enable-mbstring=cn \
--with-gd --enable-sockets --enable-bcmath --with-iconv-dir=$BASE/gd \
make install
#修改 $APACHE/conf/httpd.conf
AddType application/x-httpd-php .php .phtml .php4 .inc
DirectoryIndex index.php
mysql.php:
mysql_connect("localhost", "username", "password") or die(mysql_error());
echo "Connected to MySQL
";
mysql_select_db("testdb") or die(mysql_error());
echo "Connected to Database";
echo "
";
phpinfo();
?>