ubuntu源码安装apache

折腾了一天,从安装到卸载,再到安装,这其中的心酸,这其中的折腾难以言表啊...虽然LAMP没有配置成功,但好在apache安装好了,PHP和Mysql还没有正确安装,今天就先列出apache的安装教程。 首先,在ubuntu系统上会有简洁的apache安装,但此apache安装后用着过于不方便,所以就卸载了,重新安装了源码编译的。 现在网上貌似有LAMP一键安装的包,不过一键安装那多不像高人啊,等会儿试试去...o(∩_∩)o 一,准备 1,安装 apr 下载地址:http://apr.apache.org/download.cgi [root@ubuntu:/work/soft/apache]# tar jxvf apr-1.5.0.tar.bz2 [root@@ubuntu:/work/soft/apache/apr-1.5.0]# ./configure --prefix=/work/installed/apr [root@@ubuntu:/work/soft/apache/apr-1.5.0]# make [root@@ubuntu:/work/soft/apache/apr-1.5.0]# make install 2,安装 apr-util 下载地址:http://apr.apache.org/download.cgi [root@ubuntu:/work/soft/apache]# tar jxvf  apr-util-1.5.3.tar.bz2 [root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# ./configure --prefix=/work/installed/apr-util --with-apr=/work/installed/apr [root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make [root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make install 3,安装 pcre 下载地址:http://pcre.org/ [root@ubuntu:/work/soft/apache]# tar jxvf  pcre-8.35.tar.bz2 [root@@ubuntu:/work/soft/apache/pcre-8.35]# ./configure --prefix=/work/installed/pcre [root@@ubuntu:/work/soft/apache/pcre-8.35]# make [root@@ubuntu:/work/soft/apache/pcre-8.35]# make install 注意:如果在安装 pcre 时,遇到问题:configure: error: You need a C++ compiler for C++ support. 解决方法sudo apt-get install build-essential 二,安装apache 下载地址:http://httpd.apache.org/ [root@ubuntu:/work/soft/apache]# tar jxvf  httpd-2.4.9.tar.bz2 [root@@ubuntu:/work/soft/apache/httpd-2.4.9]#  ./configure --prefix=/work/installed/apache --with-apr=/work/installed/apr --with-apr-util=/work/installed/apr-util --with-pcre=/work/installed/pcre [root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make [root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make install,启动 apache安装 1,启动 [root@ubuntu:/work/installed/apache]# ./bin/apachectl start 2,开机启动 打开文件:/etc/rc.local [root@ubuntu:/]# sudo gedit /etc/rc.local  添加:/work/installed/apache/bin/apachectl start  

评论