SUSE Linux下源码编译安装apache2.2.6+php5.1.16+mysq

Linux大全评论158 views阅读模式

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

企鹅博客
  • 本文由 发表于 2020年6月9日 04:01:00
  • 转载请务必保留本文链接:https://www.qieseo.com/138759.html

发表评论