首页 / 网站技术 / Apache 服务器 / Apache 安装笔记

Apache 安装笔记

Jesse Lee 发表于 2009年01月04日 00时03分, 查看: 247

Apache Installation

If Apache is not currently installed, it is a simple process to install it using yum.

Check Apache Install

To check if Apache is installed, or confirm which version is installed, use the rpm package manager.

[root@shibidp install]# rpm -q httpd
httpd-2.2.3-7.el5.centos

In this case Apache 2.2.3.7 is already installed.
Locate available Apache versions

The yum package manager is the quickest mechanism to locate the versions of Apache available. However it does rely on yum being configured and an internet connection to get the latest yum catalogs.

e.g.
[root@shibidp install]# yum search httpd

returns

httpd-devel.i386 2.2.3-7.el5.centos     installed
Matched from:
httpd-devel
The httpd-devel package contains the APXS binary and other files
that you need to build Dynamic Shared Objects (DSOs) for the
Apache HTTP Server.
If you are installing the Apache HTTP server and you want to be
able to compile or develop additional modules for Apache, you need
to install this package.
http://httpd.apache.org/
httpd.i386                               2.2.3-7.el5.centos     installed
Matched from:
httpd
http://httpd.apache.org/

Installing Apache

If Apache is not installed, you can install it using the following command.

[root@shibidp install]# yum install httpd.i386 2.2.3-7.el5.centos

i.e. take the string from your previous yum search command.

This will install Apache and all dependancies.

The main Apache binary httpd will be installed to /usr/sbin, with the configuration folders set to /etc/httpd. The main web page root will be /var/www
Requirements for the tomcat connector mod_jk

In order to compile the mod_jk connector for Tomcat later, we will need the httpd-devel packages installed. This is done in the same way as the initial Apache install, this will install the apxs libraries required for mod_jk.

[root@shibidp install]# yum install httpd-devel.i386 2.2.3-7.el5.centos

Starting and Stopping Apache.

Once Apache is installed it can be managed using the apachectl command

Start Apache
apachectl start

Stop Apache
apachectl stop

Apache file locations
Executables httpd, apachectl etc /usr/sbin
Configuration files httpd.conf, ssl.conf etc /etc/httpd
Log files error_log, access_log /etc/httpd/log
Web Root document root /var/www/html

发表评论