SUSE Linux下源码编译安装apache2.2.6+php5.1.16+mysql5.0.40
文档
一、编译mysql 5.0.40
#cd /usr/local/src
# tar zxvf mysql-5.0.40.tar.gz
# cd mysql-5.0.46
#./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=mysql --without-debug --with-big-tables --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-innodb --without-ndb-debug --without-isam
配置成功会提示:
MySQL has a Web site at http://www.mysql.com/ which carries details on the
latest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.
Thank you for choosing MySQL!
# make
编译的时间可能会比较长,毕竟优化的比较厉害。
# make install
编译安装完成后执行后续操作:
# useradd mysql //添加 mysql 用户
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root:mysql . //设置权限,注意后面有一个 "."
# chown -R mysql /var/lib/mysql //设置 mysql 目录权限
# chgrp -R mysql . //注意后面有一个 "."
# cp share/mysql/my-large.cnf /etc/my.cnf
# cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld //开机自动启动 mysql。
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# /etc/init.d/mysqld start //启动 MySQL
#/usr/local/mysql/ bin/mysqladmin -u root password "password_for_root" // password_for_root为密码.本机是mysql
#/usr/local/mysql/bin/mysql –u root –p //进入mysql客户端
(/usr/local/mysql/bin/mysql –u root –p 提示Enter password: 输入密码,回车进入)
# /etc/init.d/mysqld start //关闭 MySQL
二 、编译安装 Apache
# cd /usr/local/src
# tar zxvf httpd-2.2.6.tar.gz
# cd httpd-2.2.6
#./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --with-mysql=/usr/local/mysql --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --enable-static-support --enable-static-htpasswd --enable-static-htdigest --enable-static-rotatelogs --enable-static-logresolve --enable-static-htdbm --enable-static-ab --enable-static-checkgid --disable-cgid --disable-cgi
# make
# make install
# echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local //将 apachectl 的调用加入到你的系统启动文件中。
注解:
./configure //配置源代码树
--prefix=/usr/local/apache2 //体系无关文件的顶级安装目录PREFIX ,也就Apache的安装目录。
--enable-module=so //打开 so 模块,so 模块是用来提 DSO 支持的 apache 核心模块
--enable-mods-shared=all //编译全部的模板,对于不需要我们可以在httpd.conf去掉。
--enable-cache //支持缓存
--enable-file-cache //支持文件缓存
--enable-mem-cache //支持记忆缓存
--enable-disk-cache //支持磁盘缓存
--enable-static-support //支持静态连接(默认为动态连接)
--enable-static-htpasswd //使用静态连接编译 htpasswd - 管理用于基本认证的用户文件
--enable-static-htdigest //使用静态连接编译 htdigest - 管理用于摘要认证的用户文件
--enable-static-rotatelogs //使用静态连接编译 rotatelogs - 滚动 Apache 日志的管道日志程序
--enable-static-logresolve //使用静态连接编译 logresolve - 解析 Apache 日志中的IP地址为主机名
--enable-static-htdbm //使用静态连接编译 htdbm - 操作 DBM 密码数据库
--enable-static-ab //使用静态连接编译 ab - Apache HTTP 服务器性能测试工具
--enable-static-checkgid //使用静态连接编译 checkgid
--disable-cgid //禁止用一个外部 CGI 守护进程执行CGI脚本
--disable-cgi //禁止编译 CGI 版本的 PHP我们不再使用worker模式编译apache,worker模式和php貌似有一些不协调不稳定之处。所以使用了默认的perfork模式。
将apache设置成开机自启动:
在/etc/rc.d/rc.local文件中加入一行
/usr/local/apache2/bin/apachectl start
这样每次重新启动系统以后,apache也会随系统一起启动.
三、编译php 5.1.16。PHP需要一些支持工具。
●freeTDS(解决PHP与MSSQL连接的问题)
●编译安装PHP并支持GD
具体安装如下:
1. freeTDS的安装
#cd /usr/local/src/phpYH
#tar –zxvf freetds-stable.tgz
#cd freetds-0.63
#./configure --prefix=/usr/local/freetds --with-tdsver=8.0
注:--with-tdsver指定的freetds支持的数据库版本号,其中8.0对应的是sqlservr2000.
#make
#make install
#vi /etc/ld.so.conf 设置系统动态库配置文件,加入以下:
/usr/local/freetds/lib
保存退出。
#ldconfig 重新加载动态库列表ld.so.conf
2、安装 jpeg6
建立目录
# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/bin
# mkdir /usr/local/jpeg6/lib
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/man
# mkdir /usr/local/jpeg6/man/man1
# cd /usr/local/src/phpYH
# tar -zxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
#echo $?
# make; make install
3、安装libpng
# cd /usr/local/src/phpYH
# tar -zxf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# cp scripts/makefile.std makefile
# make; make install
4、安装 freetype
# cd /usr/local/src/phpYH
# tar -zxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# ./configure --prefix=/usr/local/freetype
#echo $?
# make;make install
5、安装最新的GD库
# cd /usr/local/src/phpYH
# tar -zxf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
#echo $?
# make; make install
6、安装最新的Curl库
# cd /usr/local/src/phpYH
# tar -zxf curl-7.15.0.tar.gz
# ./configure --prefix=/usr/local/curl
#echo $?
# make; make install
7、由于php5需libxml2的支持, 所以先安装libxml2
# cd /usr/local/src/phpYH
# tar -zxf libxml2-2.6.19.tar.gz
# cd libxml2-2.6.19
# ./configure --prefix=/usr/local/libxml2
#echo $?
# make; make install
8、安装 libxslt
# cd /usr/local/src/phpYH
# tar -zxf libxslt-1.1.15.tar.gz
# cd libxslt-1.1.15
# ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
#echo $?
# make; make install
9、安装php
# cd /usr/local/src
# tar zxvf php-5.1.16.tar.gz
# cd php-5.1.16
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-pear=/usr/share/php --with-zlib-dir --with-bz2 --with-libxml-dir=/usr --with-gd=/usr/local/gd2 --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-ttf=shared,/usr --enable-mbstring --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/etc --with-iconv --disable-ipv6 --enable-static --enable-maintainer-zts --enable-zend-multibyte --enable-inline-optimization --enable-zend-multibyte --enable-sockets --enable-soap
配置成功会提示:
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
# make
# make install
# cp php.ini-recommended /etc/php.ini
四 、整合apache 与php
# vi /usr/local/apache2/conf/httpd.conf
在最后一行加上:
AddType application/x-httpd-php .php
查找:(设置 WEB 默认文件)
DirectoryIndex index.html
替换为:
DirectoryIndex index.php index.html index.htm //在 WEB 目录不到默认文件,httpd 就会执行 /var/www/error/noindex.html
找到这一段:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride none
更改为AllowOverride all
允许apache rewrite
保存httpd.conf,退出。
# /usr/local/apache2/bin/apachectl restart //重启 Apache
五、 测试
vi /usr/local/apache2/htdocs/test.php
新增加下面一行,并保存。
<?php phpinfo(); ?>
# chmod 755 /usr/local/apache2/htdocs/phpinfo.php
用浏览器打开 http://locahost/test.php
或者 http://本机ip/test.php
(如ip为192.168.1.2 则 http://192.168.1.2/test.php)
当看到php页面时表示成功!
分享到:
相关推荐
主要是在linux上安装mysql+apache+php+wordpress,linux,suselinux,ubuntu都可以,笔记很详细,对于新手非常有帮助
主要介绍了SUSE Linux下源码编译方式安装MySQL 5.6过程分享,本文使用SUSE Linux Enterprise Server 10 SP3 (x86_64)系统,需要的朋友可以参考下
二、安装Mysql 1、下载MySQL的安装文件 安装MySQL需要下面两个文件: MySQL-server-4.0.16-0.i386.rpm MySQL-client-4.0.16-0.i386.rpm 下载地址为:www.mysql.com/downloads/mysql-4.0.html,打开此...
SUSE Linux Enterprise Server 11安装mysql(mysql-5.0.22)
从SUSE Linux Enterprise Server 15开始,安装介质仅包含安装程序,这是一个基于命令行的最小系统,用于安装,更新和注册SUSE Linux Enterprise Server。在安装过程中,您可以通过选择要安装在安装程序之上的模块来...
详尽诠释了suse linux系统下oracle数据库的安装全过程。
在suse linux下的snmp安装包
suse linux 11 中文版安装手册
SUSE Linux Enterprise 12 SP5-Server-DVD-x86_64-GM-DVD1.iso SUSE Linux Enterprise 12 SP5-Server-DVD-x86_64-GM-DVD2.iso Raj Meel宣布了适用于SUSE Linux Enterprise 12的第五个服务包,这是该公司商业,企业...
suse_linux配置apache文档
SUSE11G linuxSVN详细配置
SUSE Linux Enterprise 12 系统安装.
suselinux安装详细介绍,特别包括了对分区的介绍,适合参考。
在SUSE11SP4环境下源码安装apache2服务,包括若干工具连同安装。 包括如下内容: apr-1.6.5.tar.bz2 apr-util-1.6.1.tar.bz2 expat-2.0.1.tar.gz httpd-2.4.2.tar.gz pcre-8.30.zip zlib-1.2.8.tar.gz 详细安装教程...
suse linux中安装MySql.txt
从 SUSE Linux Enterprise Desktop 15 开始,安装媒体仅包含安装程序 - 一个用于安装、更新和 注册 SUSE Linux Enterprise Desktop 的基于命令行的精简系统。在安装期间,您可以通过选择 要基于安装程序安装的模块来...
suse linux是我用过最好的linux系统,其界面跟windows相似,一切都非常熟悉,最主要的是他有一个yast安装软件非常方便。
介绍在虚拟机上构建Oracle10g RAC集群的操作过程,其中介绍了裸机上安装虚拟机软件ESXi,SuSELinux上安装Oracle10g RAC集群。 安装RAC集群,首先要创建虚拟机共享磁盘,然后分区,挂载裸设备和进行ASM分区,然后安装...
包括两篇文档suselinux11安装Oracle11g(使用orarun包).doc和 suselinux11安装Oracle11g(不使用orarun包).doc。 别人的文档,我自己经过试验补充,有这两篇文档足够。