现在的位置: 首页我爱Linux>正文
ubuntu编译安装LAPM环境
发表于8年前 我爱Linux 暂无评论 ⁄ 被围观 2,272 次+

编译安装LAPM环境


 
Linux+Apache+Mysql+Php安装范例-- ubuntu10.10

1,安装相应库文件
apt-get install autoconf automake gettext g++ libncurses5-dev libxml2 gobjc++ libtool libxml2-dev bzip2 libbz2-dev libmcrypt4 libmcrypt-dev libmhash2 libmhash-dev curl libcurl4-gnutls-dev krb5-user libkrb5-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev zlib1g zlib1g-dev libfreetype6 libfreetype6-dev libgmp3-dev libxml2 libxml2-dev libcurl3 e2fsprogs libidn11 libidn11-dev libglib2.0-0 libglib2.0-dev libc6 libc6-dev perl perl-modules libpcre3 libpcre3-dev sysstat links ntp ruby ruby-dev screen libevent-1.4-2 libevent-dev libssl-dev

2,安装mysql
groupadd mysql
useradd -g mysql mysql
tar zxvf mysql-5.1.54.tar.gz
cd mysql-5.1.54
./configure --prefix=/usr/local/webserver/mysql --enable-local-infile --with-charset=utf8 --with-big-tables --with-plugins=max --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --enable-assembler
make && make install
cp support-files/my-huge.cnf /etc/my.cnf
mkdir /usr/local/webserver/mysql/var/
/usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql/ --datadir=/usr/local/webserver/mysql/var/
chown -R mysql.mysql /usr/local/webserver/mysql/var/
/usr/local/webserver/mysql/share/mysql/mysql.server start
echo '# start mysql' >>/etc/rc.local
echo '#/usr/local/webserver/mysql/share/mysql/mysql.server start' >>/etc/rc.local
echo 'export PATH=$PATH:/usr/local/webserver/mysql/bin' >>/etc/profile
source /etc/profile
echo '/usr/local/webserver/mysql/lib/mysql' >>/etc/ld.so.conf
/sbin/ldconfig
然后使用netstat -tunlp查看3306端口是否开启.如果此过程报错,就需要检查/usr/local/webserver/mysql/var/下的错误日志。

3,安装libiconv
tar zxvf libiconv-1.13.tar.gz
cd libiconv-1.13/
./configure --prefix=/usr/local
make
make install
echo '/usr/local/lib' >> /etc/ld.so.conf
/sbin/ldconfig

4.安装mcrypt
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install

5.安装mysqlreport(收集mysql信息)
5.1.安装DBI
tar zxvf DBI-1.609.tar.gz
cd DBI-1.609
perl Makefile.PL
make && make install

5.2.安装DBD-mysql
tar zxvf DBD-mysql-4.012.tar.gz
cd DBD-mysql-4.012
perl Makefile.PL
make && make install

5.3.安装mysqlreport
tar zxvf mysqlreport-3.5.tgz
cp mysqlreport-3.5/mysqlreport /usr/bin/mysqlreport
chmod +x /usr/bin/mysqlreport
然后执行/usr/bin/mysqlreport,就可看到mysql的相关信息

6.安装apache
tar jxvf httpd-2.2.17.tar.bz2
cd httpd-2.2.17
./configure --prefix=/usr/local/webserver/apache --with-mysql=/usr/local/webserver/mysql --enable-ssl --with-ssl --enable-rewrite=shared --enable-speling=shared --enable-dav --enable-mods-shared=all --enable-module=so
make && make install
编辑/usr/local/webserver/apache/conf/httpd.conf,在"AddType application/x-gzip .gz .tgz"行下面添加"AddType application/x-httpd-php .php .phtm" "AddType application/x-httpd-php-source .phps"
echo '/usr/local/webserver/apache/bin/apachectl -k start' >>/etc/rc.local
echo 'export PATH=$PATH:/usr/local/webserver/apache/bin' >>/etc/profile

7.安装php
tar zxvf php-5.2.16.tar.gz
cd php-5.2.16
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-apxs2=/usr/local/webserver/apache/bin/apxs --with-libxml-dir --with-openssl --with-zlib --with-zlib-dir --with-bz2 --with-curl --with-curlwrappers --enable-mbregex --with-pcre-dir --enable-ftp --with-openssl-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-gmp --with-mhash --enable-mbstring --with-mcrypt --with-mysql=/usr/local/webserver/mysql/ --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --enable-soap --enable-sockets
make ZEND_EXTRA_LIBS='-liconv'
make install
cp php.ini-recommended /usr/local/webserver/php/etc/php.ini
修改/usr/local/webserver/php/etc/php.ini" extension_dir ="./" "改为" extension_dir ="/usr/local/webserver/php//lib/php/extensions/no-debug-non-zts-20060613/"
echo 'export PATH=$PATH:/usr/local/webserver/php/bin' >>/etc/profile

8.安装memcache
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make && make install
echo 'extension= "memcache.so"' >>/usr/local/webserver/php/etc/php.ini

9.安装memcached
tar zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --prefix=/usr/local/webserver/memcached
make && make install
echo '#/usr/local/webserver/memcached/bin/memcached -d -m 512 -l 127.0.0.1 -p 11211 -u root' >>/etc/rc.local
echo "PATH=$PATH:/usr/local/webserver/memcached/bin" >>/etc/profile

10.安装SCA_SDO
tar zxvf SCA_SDO-1.2.4.tar.gz
cd SCA_SDO-1.2.4

/usr/local/webserver/php/bin/phpize
./configure --prefix=/usr/local --with-php-config=/usr/local/webserver/php/bin/php-config
make && make install

echo 'extension= "memcache.so"' >>/usr/local/webserver/php/etc/php.ini
cp -r SCA /usr/local/webserver/php/lib/php/
cp -r DAS /usr/local/webserver/php/lib/php/SDO
chmod -R 755 /usr/local/webserver/php/lib/php/SCA/
chmod -R 755 /usr/local/webserver/php/lib/php/SDO/

如果 make 出错。如下:make: *** [commonj/sdo/SDODataConverter.lo] Error 1
修改 SDODataConverter.cpp 文件。在
#include <string.h>
#include "commonj/sdo/SDODataConverter.h"
#include "commonj/sdo/SDORuntimeException.h"
前加入:
#include <cstdio>
#include <cstdlib>
在编译安装

给我留言

留言无头像?