- LAMP
- 修改远程登录避免显示乱码
vi /etc/sysconfig/i18n,将utf-8改为GB18030
vi /etc/selinux/config 将SELINUX=enforcing注释掉,加上一行:SELINUX=disable 准备安装包
库文件:libgd,libxml2,libmcrypt,zlib,jpeg,freetype,qutoconf,libgd,
安装包:mysql,PHP,apache,
如果用tar –xzvf 去解压.tar.gz文件
3.安装库文件
安装libxml2
./configure –prefix=/usr/local/libxml2
安装libmcrypt
./configure –prefix=/usr/local/libmcrypt
安装zlib
./configure –prefix=/usr/local/zlib
安装libpng
先安装zlib:yum -y install zlib-devel –y
如果出现下述错误
There is no \”configure\” script in this distribution of
libpng-1.2.8.
Instead, please copy the appropriate makefile for your system from the
\”scripts\” directory. Read the INSTALL file for more details.Update, July 2004: you can get a “configure” based distribution
from the libpng distribution sites. Download the file
libpng-1.2.8-config.tar.gz
这个是在装libpng的时候,要做的是 在scripts下面的makefile.linux文件拷贝到libpng根目录下重命名为makefile,然后用命令 ./configure –prefix=/usr/local/libpng ,可是打开configure文件后发现,里面啥指令都没有,只是打印出一些话,就是上面那段话,意思就是说,不用configure啦,直接make就好了
安装jpeg
[root@local soft]# mkdir /usr/local/jpeg 建立软件安装目录
[root@local soft]# mkdir /usr/local/jpeg/bin 建立存放命令目录
[root@local soft]# mkdir /usr/local/jpeg/lib 建立库文件所在目录
[root@local soft]# mkdir /usr/local/jpeg/include 建立存放头文件目录
[root@local soft]# mkdir -p /usr/local/jpeg/man/man1 建立存放手册目录
[root@local jpeg-9c]]# ./configure \
–prefix=/usr/local/jpeg/\
–enable-shared\ 建立共享库使用的gnu的libtool
–enable-static 建立静态库使用的gnu的libtool
安装freetype库文件
./configure –prefix=/usr/local/freetype
安装autoconf
./configure
安装gd文件
[root@local libgd-2.2.5]# ./configure \ 配置命令
–prefix=/usr/local/gd/ \ 指定软件安装位置
–with-zlib=/usr/local/zlib/ \ 指定到哪去找zlib库文件的位置
–with-jpeg=/usr/local/jpeg/ \ 指定到哪去找jpeg库文件的位置
–with-freetype=/usr/local/freetype/ 指定到哪去找freetype库文件的位置
4. 安装lamp
1.安装httpd
[root@local httpd-2.4.33]# ./configure \
–prefix=/usr/local/apache \ 指定软件安装位置
–sysconfdir=/etc/httpd \ 指定配置文件存放位置
–with-z=/usr/local/zlib/ \ 指定zlib库文件位置
–with-included-apr \ 使用捆绑APR/APR-Util的副本
–enable-so \ 以动态共享对象编译
–enable-deflate=shared \ 缩小传输编码的支持
–enable-expires=shared \ 期满头控制
–enable-rewrite=shared \ 基于规则的url操控
–enable-static-support 建立一个静态链接版本的支持
checking for APR… configure: error: the –with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
解决办法:下载apr和apr-util
下载安装将解压的库文件夹移动到httpd子目录srclib里(去掉版本号):
cp -rf apr-1.5.2 httpd-2.4.18/srclib/apr //将版本号去掉,下同
cp -rf apr-util-1.5.4 httpd-2.4.18/srclib/apr-util
或者yum -y install apr apr-util
checking for pcre-config… false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
解决办法:
[root@www.linuxidc.com httpd-2.4.1]# yum -y install pcre-devel
还需要安装一个库expat-devel直接用yum即可
如果出现错误启动出现错误,httpd: apr_sockaddr_info_get() failed for 报错
,将httpd.conf中的ServerName 前面的 # 去掉。
测试Apache服务器
/usr/local/apache/bin/apachectl start 启动apache
netstat -na|grep 80 查看80端口是否开启
apache添加自启动功能
echo “/usr/local/apache2/bin/apachectl start”>>/etc/rc.d/rc.local
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd 让httpd支持service启动