CentOS6.5安装LAMP环境APACHE的安装
1、卸载apr、apr-util# yum remove apr apr-util
2、编译安装apr-1.5.1.tar.gz
# tar zxvf apr-1.5.1.tar.gz
# cd apr-1.5.1
# ./configure --prefix=/usr/local/lamp/apr-httpd
# make
# make install
3、编译安装apr-util-1.5.4.tar.gz
# tar zxvf apr-util-1.5.4.tar.gz
# cd apr-util-1.5.4
# ./configure --prefix=/usr/local/lamp/apr-util-httpd --with-apr=/usr/local/lamp/apr-httpd
# make
# make install
4、编译安装pcre-8.35.zip
# unzip -o pcre-8.36.zip
# cd pcre-8.36
# ./configure --prefix=/usr/local/lamp/pcre
# make
# make install
5、编译安装apache
# tar -zxvf httpd-2.4.10.tar.gz
# cd httpd-2.4.10
# ./configure --prefix=/usr/local/lamp/apache --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache--enable-file-cache --enable-disk-cache --enable-mem-cache --enable-so --enable-expires=shared --enable-rewrite=shared --enable-static-support --sysconfdir=/etc/httpd
--with-z=/usr/local/lamp/zlib --with-apr=/usr/local/lamp/apr-httpd --with-apr-util=/usr/local/lamp/apr-util-httpd --with-pcre=/usr/local/lamp/pcre/ --disable-userdir
# make && make instal
6、修改配置
# vi /etc/httpd/httpd.conf
修改成 ServerName localhost:80
7、启动apache
# /usr/local/apache/bin/apachectl start
浏览器访问本机IP地址,出现It works!,就OK了!
8、做成服务 # echo "/usr/local/lamp/apache/bin/apachectl start" >> /etc/rc.d/rc.local
# /usr/local/lamp/apache/bin/apachectl start
# cp /usr/local/lamp/apache/bin/apachectl /etc/init.d/httpd
# chmod +x /etc/init.d/httpd
# chkconfig --add httpd
注意:如果提示service httpd does not support chkconfig错误,解决办法:编辑/etc/rc.d/init.d/httpd在文件第二行加入
#chkconfig:2345 10 90
#description:Activates/Deactivates Apache Web Server
# chkconfig --level 2345 httpd on
# service httpd restart
页:
[1]