linux 安装apache服务器

 1.下载apache, http://httpd.apache.org/download.cgi  经过这个官方网站,咱们能够下到最新的版本。如今版本都是以这样的方式表达的:httpd-*.*.*.tar.gzhtml

2.       例如,你如今去官网下载的就是最新版本:httpd-2.2.9.tar.gzlinux

3.       好了,下载到你的家目录/root里面。web

4.       [root@hostlocal~]# ls    // 你会看到你下载的httpd-2.2.9.tar.gz.apache

5.       [root@hostlocal~]# tar –zxvf  httpd-2.2.9.tar.gz // 解压后为httpd-2.2.9windows

【今天在linux下 用tar -zxf xxx.tar.bz2服务器

而后就报这个错。oracle

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors测试

一开始我觉得是压缩包坏的,去下其余的。下下来也是同样。而后仔细看了一下,原来这个压缩包没有用gzip格式压缩  因此解压的时候也不用加上z 。直接tar -xf 就能够了。网站

http://blog.sina.com.cn/s/blog_6f2274fb0100z026.htmlspa

6.       [root@hostlocal~]# mkdir –p /usr/local/web/apache/   //在这个目录下创建文档,利于管理

7.       [root@hostlocal~]# mv /root/httpd-2.2.9 /usr/local/src/  //将安装包放到/src下,利于管理

8.       [root@hostlocal~]# cd httpd-2.2.9

9.       [root@httpd-2.2.9]#./configure  --prefix=/usr/local/web/apache /    //安装路径

Ø       --enable-shared=max /

Ø       --enable-module=rewirte /

Ø       --enable-module=so

【若是在第9步执行报错:“checking for APR... no”,则须要安装apr】

10.   [root@httpd-2.2.9]# make  //编译

11.   [root@httpd-2.2.9]# make install

12.   [root@hostlocal~]# service httpd start            //开启httpd服务

安装成功后,apache将会安装到/usr/local/web/apache下面。而后在windows主机的IE中输入apache服务器的IP地址。看是否能够访问到。

原文:http://blog.csdn.net/loverwind/article/details/3064356

 


apr安装

安装apache时checking for APR... no错误的解决方法

#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found . Please read the documentation.
能够用./configure –help | grep apr 查看帮助。
--with-included-apr Use bundled copies of APR/APR-Util
--with-apr=PATH prefix for installed APR or the full path to apr-config
--with-apr-util=PATH prefix for installed APU or the full path to

安装APR(Apache Portable Runtime )
下载:http://apr.apache.org/download.cgi
 

复制代码代码以下:

#tar -zxvf apr-1.4.6.tar.gz
# cd /apr-1.4.6
#./configure --prefix=/usr/local/apr
#make
#make install

再次检查编译环境出现
 

复制代码代码以下:

checking for APR-util... no
configure: error: APR-util not found . Please read the documentation.
#./configure –help | grep apr-util
--with-apr-util=PATH prefix for installed APU or the full path to

下载:http://download.chinaunix.net/download/0001000/472.shtml
#tar -zxvf apr-util-1.4.1.tar.gz
#cd /apr-util-1.4.1
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/usr
#make
#make install

以后到/oracle/http-2.4.2路径下
 

复制代码代码以下:

./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
#make
make install

注意:Apache在安装时不会检查参数是否正确,错误的参数会直接被丢弃,不会报告给用户。但能够使用echo $?命令检查是否有错误,当输出结果为0时表示没有错误。
#echo $?
0

设置 apache 开机时自动启动
cp /usr/local/apache/httpd/bin/apachectl /sbin/

在#vi /etc/rc.d/rc.local
增长一行 /sbin/apachectl start

能够在本地输入127.0.0.1来测试apache是否已经启动。

原文: http://www.jbxue.com/article/3006.html
相关文章
相关标签/搜索