源码安装Apache服务器遇到的问题及解决方法
2013-03-22 14:02
836 查看
Linux下安装软件的方式有很多种其中常用的有三种:源码安装、RPM安装、yum安装针对于后两种的安装都比较方便,只要有rpm软件包就可以轻易安装,今天我来谈谈使用源码的方式来实现对apache软件的安装(原有的版本太低,想安装一个新版本),但是第一次安装的时候便遇到了很多问题,于是我便把这些问题记录下来了,相信一定会对你以后想安装新版本的apache服务器有帮助
首先你的去apache官网去下载最新版的源码包我下载的是httpd-2.4.4.tar.bz2,地址是http://httpd.apache.org/download.cgi#apache24
然后将源码解压到/usr/local/src目录下,方便以后的管理
tar -jxvf httpd-2.4.4.tar.bz2 -C /usr/local/src/
切换到相应目录
cd /usr/local/src/httpd-2.4.4/
源码安装三步走起:1)./configure 2) make 3) make install
./configure --prefix=/usr/local/apache 然后麻烦就出现了
错误提示的很明显
checking for APR... no
configure: error: APR not found. Please read the documentation.
那就是缺少APR((Apache portable Run-time libraries,Apache可移植运行库),那就下载安装呗下载网址是http://apr.apache.org/ 你会看到
Apache Portable Runtime 1.4.6 Released
点击下载就是了apr-1.4.6.tar.gz,并且将其解压到/usr/local/src目录下
tar -zxvf apr-1.4.6.tar.gz -C /usr/local/src/
切换到目录下
cd /usr/local/src/apr-1.4.6/
当然这个运行库也是源码安装的,同样是三步曲,走起
./configure
make
make install
然后再切换到httpd的源码目录下再次执行./configure时加上apr的配置路径./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config 你会发现又出现了问题
意思是APR-util包没有找到,如果你还有印象的话应该记得在我们下载apr的时候看见过这个工具包,于是我们可以去刚刚的那个网站去下载去http://apr.apache.org/ 你会看到
Apache Portable Runtime Utility 1.5.1 Released
下载安装就是了apr-util-1.5.1.tar.gz 先解压到/usr/local/src目录下
tar -zxvf apr-util-1.5.1.tar.gz -C /usr/local/src/
切换到源码目录下cd /usr/local/src/apr-util-1.5.1/
然后是老三步
./configure --with-apr=/usr/local/src/apr-1.4.6/apr-1-config(加上apr的路径)
make
make install
然后到httpd源码的目录下执行./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config还会遇到问题
说pcre(Perl Compatible Regular Expressions是一个Perl库,包括 perl 兼容的正规表达式库)没发现,当然处理方法相同下载源码,解压,安装
下载地址http://sourceforge.net/projects/pcre/
unzip pcre-8.32.zip
cd pcre-8.32
./configure
make
make install
然后到httpd源码的目录下执行./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config --with-pcre=/usr/local/pcre/
make && make install
一切安装完成之后我们还要涉及到一个httpd的运行管理问题,我模仿linux原有的管理脚本自己写了一个简易的管理脚本httpd内容如下:
#!/bin/bash
# chkconfig: 35 80 30
# description: Apache server
HTTPD=/usr/local/apache/bin/httpd
LOCKFILE='/var/lock/subsys/httpd'
. /etc/init.d/functions
function start(){
[ -e $LOCKFILE ] && echo "httpd is running ......." && exit
echo -n "httpd is starting ......"
sleep 1
$HTTPD -k start
}
function stop(){
echo -n "httpd is stoping......"
sleep 1
killproc $HTTPD &>/dev/null
[ $? -eq 0 ] && rm -rf $LOCKFILE && echo -e "\033[31m [ok] \033[0m" ||echo -e "\033[31m [fail] \033[0m"
}
function status(){
[ -e $LOCKFILE ]&& echo "httpd is running ......" || echo "httpd is stoped"
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "httpd Usage: {start|stop|restart}"
;;
esac之后将其拷贝到/etc/rc.d/init.d/目录下
cp httpd /etc/rc.d/init.d/
chkconfig --add httpd
chkconfig –level 35 httpd on
chkconfig --list httpd
接下来就是测试了
service httpd start
然后在其他电脑上访问
到此全部工作已经完成,当然对于vsftp服务器同样能做,不过vsftp的安装方式比较简单,这里就不细说了,当然我也写了一个管理脚本,如果有兴趣的话可以读一读,内容如下
#!/bin/bash
# chkconfig: 35 83 30
# description: vsftpd server
VSFTPD='/usr/local/sbin/vsftpd'
LOCKFILE='/var/lock/subsys/ftp'
. /etc/init.d/functions
function start(){
[ -e $LOCKFILE ] && echo "vsftpd is running ......." && exit
echo -n "vsftpd is starting ......"
sleep 1
$VSFTPD &
}
function stop(){
echo -n "Vsftpd is stoping......"
sleep 1
killproc $VSFTPD &>/dev/null
}
function status(){
[ -e $LOCKFILE ]&& echo "vsftpd is running ......" || echo "vsftpd is stoped"
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "vsftp Usage: {start|stop|restart}"
;;
esac
在下一篇博客中我将会介绍一下mysql的安装配置,尽情期待。。。。。
首先你的去apache官网去下载最新版的源码包我下载的是httpd-2.4.4.tar.bz2,地址是http://httpd.apache.org/download.cgi#apache24
然后将源码解压到/usr/local/src目录下,方便以后的管理
tar -jxvf httpd-2.4.4.tar.bz2 -C /usr/local/src/
切换到相应目录
cd /usr/local/src/httpd-2.4.4/
源码安装三步走起:1)./configure 2) make 3) make install
./configure --prefix=/usr/local/apache 然后麻烦就出现了
错误提示的很明显
checking for APR... no
configure: error: APR not found. Please read the documentation.
那就是缺少APR((Apache portable Run-time libraries,Apache可移植运行库),那就下载安装呗下载网址是http://apr.apache.org/ 你会看到
Apache Portable Runtime 1.4.6 Released
点击下载就是了apr-1.4.6.tar.gz,并且将其解压到/usr/local/src目录下
tar -zxvf apr-1.4.6.tar.gz -C /usr/local/src/
切换到目录下
cd /usr/local/src/apr-1.4.6/
当然这个运行库也是源码安装的,同样是三步曲,走起
./configure
make
make install
然后再切换到httpd的源码目录下再次执行./configure时加上apr的配置路径./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config 你会发现又出现了问题
意思是APR-util包没有找到,如果你还有印象的话应该记得在我们下载apr的时候看见过这个工具包,于是我们可以去刚刚的那个网站去下载去http://apr.apache.org/ 你会看到
Apache Portable Runtime Utility 1.5.1 Released
下载安装就是了apr-util-1.5.1.tar.gz 先解压到/usr/local/src目录下
tar -zxvf apr-util-1.5.1.tar.gz -C /usr/local/src/
切换到源码目录下cd /usr/local/src/apr-util-1.5.1/
然后是老三步
./configure --with-apr=/usr/local/src/apr-1.4.6/apr-1-config(加上apr的路径)
make
make install
然后到httpd源码的目录下执行./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config还会遇到问题
说pcre(Perl Compatible Regular Expressions是一个Perl库,包括 perl 兼容的正规表达式库)没发现,当然处理方法相同下载源码,解压,安装
下载地址http://sourceforge.net/projects/pcre/
unzip pcre-8.32.zip
cd pcre-8.32
./configure
make
make install
然后到httpd源码的目录下执行./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/bin/apr-1-config --with-pcre=/usr/local/pcre/
make && make install
一切安装完成之后我们还要涉及到一个httpd的运行管理问题,我模仿linux原有的管理脚本自己写了一个简易的管理脚本httpd内容如下:
#!/bin/bash
# chkconfig: 35 80 30
# description: Apache server
HTTPD=/usr/local/apache/bin/httpd
LOCKFILE='/var/lock/subsys/httpd'
. /etc/init.d/functions
function start(){
[ -e $LOCKFILE ] && echo "httpd is running ......." && exit
echo -n "httpd is starting ......"
sleep 1
$HTTPD -k start
}
function stop(){
echo -n "httpd is stoping......"
sleep 1
killproc $HTTPD &>/dev/null
[ $? -eq 0 ] && rm -rf $LOCKFILE && echo -e "\033[31m [ok] \033[0m" ||echo -e "\033[31m [fail] \033[0m"
}
function status(){
[ -e $LOCKFILE ]&& echo "httpd is running ......" || echo "httpd is stoped"
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "httpd Usage: {start|stop|restart}"
;;
esac之后将其拷贝到/etc/rc.d/init.d/目录下
cp httpd /etc/rc.d/init.d/
chkconfig --add httpd
chkconfig –level 35 httpd on
chkconfig --list httpd
接下来就是测试了
service httpd start
然后在其他电脑上访问
到此全部工作已经完成,当然对于vsftp服务器同样能做,不过vsftp的安装方式比较简单,这里就不细说了,当然我也写了一个管理脚本,如果有兴趣的话可以读一读,内容如下
#!/bin/bash
# chkconfig: 35 83 30
# description: vsftpd server
VSFTPD='/usr/local/sbin/vsftpd'
LOCKFILE='/var/lock/subsys/ftp'
. /etc/init.d/functions
function start(){
[ -e $LOCKFILE ] && echo "vsftpd is running ......." && exit
echo -n "vsftpd is starting ......"
sleep 1
$VSFTPD &
}
function stop(){
echo -n "Vsftpd is stoping......"
sleep 1
killproc $VSFTPD &>/dev/null
}
function status(){
[ -e $LOCKFILE ]&& echo "vsftpd is running ......" || echo "vsftpd is stoped"
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "vsftp Usage: {start|stop|restart}"
;;
esac
在下一篇博客中我将会介绍一下mysql的安装配置,尽情期待。。。。。
相关文章推荐
- 在windows下安装apache+mysql+php时遇到的问题与解决方法
- 初次linux下安装apache2.4.27遇到的一点问题和解决方法
- 安装Apache遇到的问题及解决方法
- Windows下安装Apache HTTP Server 无法启动遇到OS10048 通常每个套接字地址(协议/网络地址/端口)只允许使用一次 的问题解决方法
- 我在安装TFS 2008的时候遇到的问题以及解决方法一sharepoint 安装 打开站点 出现服务器不可用问题
- VM 安装Linux虚拟服务器:环境搭建遇到:《Linux “ifconfig”看不到inet address》问题--解决土方法
- Linux安装MySQL5.5版本+源码安装遇到的问题及解决方法
- centos6.5搭建git服务器 win10 安装git客户端连接 和遇到的问题+解决方式
- SQL Server 2008 安装过程中遇到“性能计数器注册表配置单元一致性”检查失败 问题的解决方法【已验证 】
- 安装widows mysql 免安装版(zip) 步骤详解 以及遇到问题解决 以及忘记密码的修改方法
- 安装widows mysql 免安装版(zip) 步骤详解 以及遇到问题解决 以及忘记密码的修改方法
- 【个人笔记】anaconda安装遇到的问题:failed to creat anaconda menus的解决方法
- nginx、Apache、IIS服务器解决 413 Request Entity Too Large问题方法汇总
- Git服务器安装详解及安装遇到问题解决方案
- Rstudio 安装xlsx包时遇到Java interpreter, rJava, jni.h 等问题的解决方法
- IIS部署到服务器的流程及可能遇到的问题及解决方法
- iis中文件夹的默认文档配置和Apache配置跨域遇到的问题解决方法
- 最新cocoapods安装流程,安装过程中遇到的问题及解决方法
- ubuntu-14.10下,安装gcc交叉编译器遇到问题及解决方法
- Linux从源码安装subversion遇到问题及解决