---
title: "Installing Apache Http Server on Linux"
author: "dodoflying"
date: "2007-05-09T08:13:16Z"
tags: []
slug: "installing-apache-http-server-on-linux"
draft: false
lastmod: "2007-05-09T08:13:16Z"
id: 78150
url: "https://dodoflying.iteye.com/blog/78150"
---

## [Overview for the impatient]()

[Download](http://httpd.apache.org/docs/2.2/install.html#download) `$ lynx http://httpd.apache.org/download.cgi` [Extract](http://httpd.apache.org/docs/2.2/install.html#extract) `$ gzip -d httpd-NN.tar.gz $ tar xvf httpd-NN.tar $ cd httpd-NN` [Configure](http://httpd.apache.org/docs/2.2/install.html#configure) `$ ./configure --prefix=PREFIX(PREFIX指安装目录)` [Compile](http://httpd.apache.org/docs/2.2/install.html#compile) `$ make` [Install](http://httpd.apache.org/docs/2.2/install.html#install) `$ make install` [Customize](http://httpd.apache.org/docs/2.2/install.html#customize) `$ vi PREFIX/conf/httpd.conf` [Test](http://httpd.apache.org/docs/2.2/install.html#test) `$ PREFIX/bin/apachectl -k start`

安装好了后，出现问题如下：

\[root at mobile apache]# dot /bin/apachectl start  
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

结果  
Forbidden  
You don't have permission to access / on this server.  
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

原因可能是：  
1、你没有为该目录或者该文件设置guest组权限；  
2、你没有将该文件名设置为默认页面，尤其是在仅用域名访问的情况下。  
解决办法:  
chmod 701 ／home／www                  （apache安装目录，同上面的PREFIX）  
chmod 701 ／home／www／*