[伊达原创]FreeBSD8.0源码编译安装MYSQL5 APACHE2.2 PHP5.3.2
2010-04-07 00:14
483 查看
/**********************************************
@desc:FreeBSD8.0+APACHE-2.2.15+MYSQL-5.1.45+PHP-5.3.2
@mail:unix1983@gmail.com 如果有遗漏请提示 3Q ╮(╯3╰)╭
@MSN:woody1983@live.cn
@Source 的获取:sf.net和官方网站 .tbz文件在BSD的安装盘里。
/**********************************************
@note:安装前的准备
@note:安装Perl 两种模式 两个版本 随意
Install perl5
(1)tbz files install mode
pkg_add perl-5.8.9_3.tbz
(2)Source Installation
tar zxvf perl-5.10.1.tar.bz2
cd perl-5.10.1
sh Configure -de
make
make test
make install
@note:gmake是安装freetype时需要的
Install gmake
pkg_add gmake-3.81_3.tbz
@两个依赖包和pkg的一个包放在同一个目录下
libiconv-1.13.1.tbz and gettext-0.17_1.tbz and pkg-config-0.23_1.tbz
@Linux 用户
shell> groupadd mysql
shell> useradd -g mysql mysql
+-------This is a FreeBSD8.0 add user'mode--------+
woody# adduser
Username: mysql
Full name: mysql
Uid (Leave empty for default):
Login group [mysql]:
Login group is mysql. Invite mysql5 into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]: nologin
Home directory [/home/mysql]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]: yes
Lock out the account after creation? [no]:
Username : mysql
Password : <blank>
Full Name : mysql
Uid : 1003
Class :
Groups : mysql
Home : /home/mysql
Home Mode :
Shell : /usr/sbin/nologin
Locked : no
+--------------------------Step---------------------------+[/b]
shell> gunzip < mysql-5.1.45.tar.gz.tar.gz | tar -xvf -
shell> cd mysql-mysql-5.1.45
shell> ./configure --prefix=/usr/local/mysql[/b]
shell> make[/b]
shell> make install[/b]
shell> cp support-files/my-medium.cnf /etc/my.cnf
[/b]
@note:my-medium.cnf 按需 copy[/b]
@change: 修改my.cnf文件 不修改也可以 这里只是修改数据库位置。
[/b]
+my.cnf add a line ''+
[mysqld]
port = 3306
socket = /tmp/mysql.sock
.....略.....
datadir = /data/mysql
@Step:建数据库目录
shell> mkdir -p /data/mysql
+--------------------+
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql /data/mysql
@note:如果没有修改my.cnf的datadir位置 则执行:
@#shell> chown -R mysql var
@启动
shell> bin/mysqld_safe --user=mysql &
/etc/rc.local
/bin/sh -c 'cd /usr/local/mysql; ./bin/mysqld_safe --user=mysql &'
Install APACHE2.2.15
Step 1
编译Apache的要求
磁盘空间
ANSI- C编译器及编译环境
确保准确的时间
Perl 5 [可选]
apr/apr-util >= 1.2
apr和apr-util包含在Apache httpd的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了, 则必须将你的apr/apr-util升级到1.2版本,或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安 装,你必须手动完成:
@note: 编译和安装 apr 1.2
cd srclib/apr
./configure –prefix=/usr/local/apr/
make
make install
@note: 编译和安装 apr-util 1.2[/b]
cd ../apr-util
./configure –prefix=/usr/local/apr-util/ –with-apr=/usr/local/apr/
make
make install
Step2-1
tar zxvf httpd-2.2.15.tar.gz
ln -s httpd-2.2.15.tar.gz httpd
cd httpd
./configure --prefix=/usr/local/apache2 --enable-so \
--enable-mods-shared=most --with-mpm=worker \
--with-mysql=/usr/local/mysql --enable-cache \
--enable-file-cache --enable-mem-cache \
--enable-disk-cache --enable-static-support
\
--disable-cgid --disable-cgi --with-apr=/usr/local/apr/ \
--with-apr-util=/usr/local/apr-util/ --with-perl \
--enable-module=rewrite
make
make install
PHP-support[/b]
@note:freetype的安装需 要gmake 先修改configure文件中的编译器
shell > tar zxvf freetype-2.2.1
shell > cd freetype-2.2.1
vi configure
if test "x$GNUMAKE" = x; then
GNUMAKE=gmake[/b]
fi./configure
gmake
gmake install
@note:其余的就容易了 该make的 该install的就那啥了...( ̄︶ ̄)↗
/usr/local/libjpeg
./configure --prefix=/usr/local/libjpeg
/usr/local/libpng
./configure --prefix=/usr/local/libpng
/usr/local/libxml2
./configure --prefix=/usr/local/libxml2
/usr/local/zlib
./configure --prefix=/usr/local/zlib
GD2
@note:make时如果出错的话 copy两个文件到gd当前目录下
@Error:
gd_png.c:16:53: error: png.h: No such file or directory
png.h:395:21: error: pngconf.h: No such file or directory
woody# cp /usr/local/libpng/include/png.h /usr/local/src/gd-2.0.35/
woody# cp /usr/local/libpng/include/pngconf.h /usr/local/src/gd-2.0.35/
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg8 --with-zlib-dir=/usr/local/zlib --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype
make
make install
Install PHP-5.3.2 Released.
@note:5.3.2这个版本里貌似没有 --enable-so和--with-ttf 这两个选项了
./configure --prefix=/usr/local/php5 \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-gd=/usr/local/gd2 \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-freetype-dir=/usr/local/freetype \
--with-jpeg-dir=/usr/local/jpeg8 \
--with-png-dir=/usr/local/libpng \
--with-libxml-dir=/usr/local/libxml \
--with-zlib-dir=/usr/local/zlib \
--with-kerberos --enable-xml \
--enable-mbstring --enable-sockets \
--enable-calendar
make
make test #执行到这一步可以去看 看电影 泡杯茶之类的 (^。^)y-~~
make install
woody# cp /usr/local/src/php-5.3.2/php.ini-production[/u] /usr/local/php5/lib/php.ini
@edit apache's httpd.conf
@checking:LoadModule php5_module modules/libphp5.so
@Add:
<IfModule dir_module>
DirectoryIndex index.php[/b] index.html
</IfModule>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
炮 灰!!! ( ̄︶ ̄)↗ 涨
woody# du -h -d 1 /usr/local/src/
52M /usr/local/src/httpd-2.2.15
272M /usr/local/src/mysql-5.1.45
106M /usr/local/src/perl-5.10.1
18M /usr/local/src/freetype-2.2.1
9.6M /usr/local/src/jpeg-8a
3.2M /usr/local/src/zlib-1.2.4
6.3M /usr/local/src/libpng-1.4.1
59M /usr/local/src/libxml2-2.7.2
217M /usr/local/src/php-5.3.2
7.5M /usr/local/src/gd2
82M /usr/local/src/ImageMagick-6.6.1-0
7.5M /usr/local/src/gd-2.0.35
918M /usr/local/src/
woody# du -h -d 1 /usr/local/
918M /usr/local/src
138M /usr/local/mysql
2.2M /usr/local/apr
2.0M /usr/local/apr-util
17M /usr/local/apache2
2.7M /usr/local/bin
74M /usr/local/lib
18M /usr/local/man
6.7M /usr/local/share
6.0K /usr/local/etc
1.1M /usr/local/include
1.2M /usr/local/info
50K /usr/local/libdata
2.0K /usr/local/libexec
2.0K /usr/local/sbin
2.0K /usr/local/www
2.5M /usr/local/jpeg8
4.8M /usr/local/freetype
306K /usr/local/zlib
1.4M /usr/local/libpng
14M /usr/local/libxml
1.3M /usr/local/gd2
24M /usr/local/php5
36M /usr/local/apache
1.2G /usr/local/
@desc:FreeBSD8.0+APACHE-2.2.15+MYSQL-5.1.45+PHP-5.3.2
@mail:unix1983@gmail.com 如果有遗漏请提示 3Q ╮(╯3╰)╭
@MSN:woody1983@live.cn
@Source 的获取:sf.net和官方网站 .tbz文件在BSD的安装盘里。
/**********************************************
@note:安装前的准备
@note:安装Perl 两种模式 两个版本 随意
Install perl5
(1)tbz files install mode
pkg_add perl-5.8.9_3.tbz
(2)Source Installation
tar zxvf perl-5.10.1.tar.bz2
cd perl-5.10.1
sh Configure -de
make
make test
make install
@note:gmake是安装freetype时需要的
Install gmake
pkg_add gmake-3.81_3.tbz
@两个依赖包和pkg的一个包放在同一个目录下
libiconv-1.13.1.tbz and gettext-0.17_1.tbz and pkg-config-0.23_1.tbz
Install MYSQL5.1.45-Source
@添加用户 Linux和UNIX的方式不一样 原理相通@Linux 用户
shell> groupadd mysql
shell> useradd -g mysql mysql
+-------This is a FreeBSD8.0 add user'mode--------+
woody# adduser
Username: mysql
Full name: mysql
Uid (Leave empty for default):
Login group [mysql]:
Login group is mysql. Invite mysql5 into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]: nologin
Home directory [/home/mysql]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]: yes
Lock out the account after creation? [no]:
Username : mysql
Password : <blank>
Full Name : mysql
Uid : 1003
Class :
Groups : mysql
Home : /home/mysql
Home Mode :
Shell : /usr/sbin/nologin
Locked : no
+--------------------------Step---------------------------+[/b]
shell> gunzip < mysql-5.1.45.tar.gz.tar.gz | tar -xvf -
shell> cd mysql-mysql-5.1.45
shell> ./configure --prefix=/usr/local/mysql[/b]
shell> make[/b]
shell> make install[/b]
shell> cp support-files/my-medium.cnf /etc/my.cnf
[/b]
@note:my-medium.cnf 按需 copy[/b]
@change: 修改my.cnf文件 不修改也可以 这里只是修改数据库位置。
[/b]
+my.cnf add a line ''+
[mysqld]
port = 3306
socket = /tmp/mysql.sock
.....略.....
datadir = /data/mysql
@Step:建数据库目录
shell> mkdir -p /data/mysql
+--------------------+
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql /data/mysql
@note:如果没有修改my.cnf的datadir位置 则执行:
@#shell> chown -R mysql var
@启动
shell> bin/mysqld_safe --user=mysql &
Step:Starting and Stopping MySQL Automatically
@note:开机自动启动/etc/rc.local
/bin/sh -c 'cd /usr/local/mysql; ./bin/mysqld_safe --user=mysql &'
Install APACHE2.2.15
Step 1
编译Apache的要求
磁盘空间
ANSI- C编译器及编译环境
确保准确的时间
Perl 5 [可选]
apr/apr-util >= 1.2
apr和apr-util包含在Apache httpd的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了, 则必须将你的apr/apr-util升级到1.2版本,或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安 装,你必须手动完成:
@note: 编译和安装 apr 1.2
cd srclib/apr
./configure –prefix=/usr/local/apr/
make
make install
@note: 编译和安装 apr-util 1.2[/b]
cd ../apr-util
./configure –prefix=/usr/local/apr-util/ –with-apr=/usr/local/apr/
make
make install
Step2-1
tar zxvf httpd-2.2.15.tar.gz
ln -s httpd-2.2.15.tar.gz httpd
cd httpd
./configure --prefix=/usr/local/apache2 --enable-so \
--enable-mods-shared=most --with-mpm=worker \
--with-mysql=/usr/local/mysql --enable-cache \
--enable-file-cache --enable-mem-cache \
--enable-disk-cache --enable-static-support
\
--disable-cgid --disable-cgi --with-apr=/usr/local/apr/ \
--with-apr-util=/usr/local/apr-util/ --with-perl \
--enable-module=rewrite
make
make install
PHP-support[/b]
@note:freetype的安装需 要gmake 先修改configure文件中的编译器
shell > tar zxvf freetype-2.2.1
shell > cd freetype-2.2.1
vi configure
if test "x$GNUMAKE" = x; then
GNUMAKE=gmake[/b]
fi./configure
gmake
gmake install
@note:其余的就容易了 该make的 该install的就那啥了...( ̄︶ ̄)↗
/usr/local/libjpeg
./configure --prefix=/usr/local/libjpeg
/usr/local/libpng
./configure --prefix=/usr/local/libpng
/usr/local/libxml2
./configure --prefix=/usr/local/libxml2
/usr/local/zlib
./configure --prefix=/usr/local/zlib
GD2
@note:make时如果出错的话 copy两个文件到gd当前目录下
@Error:
gd_png.c:16:53: error: png.h: No such file or directory
png.h:395:21: error: pngconf.h: No such file or directory
woody# cp /usr/local/libpng/include/png.h /usr/local/src/gd-2.0.35/
woody# cp /usr/local/libpng/include/pngconf.h /usr/local/src/gd-2.0.35/
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg8 --with-zlib-dir=/usr/local/zlib --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype
make
make install
Install PHP-5.3.2 Released.
@note:5.3.2这个版本里貌似没有 --enable-so和--with-ttf 这两个选项了
./configure --prefix=/usr/local/php5 \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-gd=/usr/local/gd2 \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-freetype-dir=/usr/local/freetype \
--with-jpeg-dir=/usr/local/jpeg8 \
--with-png-dir=/usr/local/libpng \
--with-libxml-dir=/usr/local/libxml \
--with-zlib-dir=/usr/local/zlib \
--with-kerberos --enable-xml \
--enable-mbstring --enable-sockets \
--enable-calendar
make
make test #执行到这一步可以去看 看电影 泡杯茶之类的 (^。^)y-~~
make install
woody# cp /usr/local/src/php-5.3.2/php.ini-production[/u] /usr/local/php5/lib/php.ini
@edit apache's httpd.conf
@checking:LoadModule php5_module modules/libphp5.so
@Add:
<IfModule dir_module>
DirectoryIndex index.php[/b] index.html
</IfModule>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
炮 灰!!! ( ̄︶ ̄)↗ 涨
woody# du -h -d 1 /usr/local/src/
52M /usr/local/src/httpd-2.2.15
272M /usr/local/src/mysql-5.1.45
106M /usr/local/src/perl-5.10.1
18M /usr/local/src/freetype-2.2.1
9.6M /usr/local/src/jpeg-8a
3.2M /usr/local/src/zlib-1.2.4
6.3M /usr/local/src/libpng-1.4.1
59M /usr/local/src/libxml2-2.7.2
217M /usr/local/src/php-5.3.2
7.5M /usr/local/src/gd2
82M /usr/local/src/ImageMagick-6.6.1-0
7.5M /usr/local/src/gd-2.0.35
918M /usr/local/src/
woody# du -h -d 1 /usr/local/
918M /usr/local/src
138M /usr/local/mysql
2.2M /usr/local/apr
2.0M /usr/local/apr-util
17M /usr/local/apache2
2.7M /usr/local/bin
74M /usr/local/lib
18M /usr/local/man
6.7M /usr/local/share
6.0K /usr/local/etc
1.1M /usr/local/include
1.2M /usr/local/info
50K /usr/local/libdata
2.0K /usr/local/libexec
2.0K /usr/local/sbin
2.0K /usr/local/www
2.5M /usr/local/jpeg8
4.8M /usr/local/freetype
306K /usr/local/zlib
1.4M /usr/local/libpng
14M /usr/local/libxml
1.3M /usr/local/gd2
24M /usr/local/php5
36M /usr/local/apache
1.2G /usr/local/
相关文章推荐
- wdOS系统下源码编译安装LNAMP(linux+nginx+apache+mysql+php)
- 年终福利,PHP7+Apache2.4+MySQL5.6 源码编译安装,环境配置,搭建你自己的LAMP环境
- CentOS6.8 x64+Nginx1.3.8/Apache-httpd 2.4.3+PHP5.4.8(php-fpm)+MySQL5.5.28+CoreSeek4.1源码编译安装
- 源码编译安装ldap+apache+php+phpldapadmin
- 我的LAMP源码编译安装linux+Apache+mysql+php
- Apache 2.2源码编译安装
- 在Ubuntu中使用源码编译安装Apache+MySQL+PHP+phpMyAdmin
- Linux+php+apache+oracle环境搭建之CentOS下源码编译安装PHP
- Apache 2.2 + Php 5.1 安装问题解决[原创]
- 源码编译安装PHP和Apache(解决php通过yum安装版本低的问题)
- CentOS 5.X 源码编译安装LAMP(Apache+MySQL+PHP)
- CentOS 源码编译安装LAMP(Apache MySQL PHP)
- Linux下Php5+Mysql5+Apache2+GD2+Zend3最新版本软件编译安装步骤
- CentOS6.8 x64+Nginx1.3.8/Apache-httpd 2.4.3+PHP5.4.8(php-fpm)+MySQL5.5.28+CoreSeek4.1源码编译安装
- linux centos6.5 2.6.32-431.el6.x86_64 php5.5.9 apache2.4.7 mysql5 最新快速编译安装
- Linux+php+apache+oracle环境搭建之CentOS下源码编译安装PHP
- CentOS 源码编译安装LAMP(Apache MySQL PHP)
- RHEL 6.5 64bit下源码编译安装LAMP(Apache 2.4.12、MySQL 5.5.42、PHP 5.3.10)
- Freebsd php+mysql+apache 新手安装(源码安装!)
- CentOS 源码编译安装LAMP(Apache MySQL PHP)