一,编译安装httpd
1.安装软件包
# tar zxf httpd-2.2.25.tar.gz
# cd httpd-2.2.25
# ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-cgi --enable-ssl --enable-charset-lite
--------------------------------------分割线 --------------------------------------
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置
CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12)
RedHat 5.4下Web服务器架构之源码构建LAMP环境及应用PHPWind
LAMP源码环境搭建WEB服务器Linux+Apache+MySQL+PHP
--------------------------------------分割线 --------------------------------------
配置参数用途:
--prefix=:指定安装目录
--enable-so:支持动态加载模块
--enable-rewrite :支持网站地址重写
--enable-cgi:支持CGI程序脚本
--enable-ssl:支持SSL加密
--enable-charset-lite:支持多语言编码
配置错误提示:
no SSL-C headers found
configure: error: ...No recognized SSL/TLS toolkit detected
安装相应库文件
# yum -y install openssl-devel
# ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-cgi --enable-ssl --enable-charset-lite
# make && make install
2.建立服务脚本
# cd /usr/local/httpd/bin/
# cp apachectl /etc/init.d/httpd
# vim /etc/init.d/httpd
#!/bin/sh
# chkconfig: 2345 85 35
# description:Apache is a world wide web server
……
# chkconfig --add httpd
# chkconfig --list httpd
httpd 0:off1:off2:on3:on4:on5:on6:off
3.修改主配置文件及启动服务
# vim /usr/local/httpd/conf/httpd.conf
ServerName :80
# service httpd start
[root@client bin]# netstat -ln | grep :80
tcp 0 0 :::80 :::* LISTEN
二.编译安装mysql
1. 添加运行用户
# useradd -M -u 49 -s /sbin/nologin mysql
2.安装软件包
# tar zxf mysql-5.1.62.tar.gz
# cd mysql-5.1.62
# ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=gbk,gb2312
配置参数用途:
--prefix=:指定安装目录
--with-charset=utf8:指定默认字符集
--with-collation=utf8_general_ci:指定默认的校对规则集
--with-extra-charsets=gbk,gb2312:设置支持的其他字符集
配置错误信息:
checking for termcap functions library... configure: error: No curses/termcap library found
安装库文件
# yum -y install ncurses-devel libtermcap-devel
# ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=gbk,gb2312
# make && make install
编译错误信息:
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] Error 127
make[1]: Leaving directory `/root/Desktop/mysql-5.1.62/mysys'
make: *** [all-recursive] Error 1
# yum -y install gcc gcc-c++ //需要安装软件
再重新配置编译安装