ubuntu安装apache过程总结
介绍
配置介绍:
/etc/httpd/conf/httpd.conf
DocumentRoot
告诉httpd去哪找内容yum install elinks
elinks
是命令行浏览器- 在
/etc/httpd/conf.d
目录下,新建文件,里面设置<VirtualHost *:80>
安装
CentOS
yum install httpd
源码
方法
wget http://www.apache.org/dist/httpd/httpd-2.0.65.tar.gz
tar zxvf httpd-2.0.63.tar.gz
httpd-2.0.63
./configure -prefix=/usr/local/apache2 -enable-module=so
make
make install
/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl restart
http://localhost
配置示例
nagios
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.
ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/"
<Directory "/usr/lib64/nagios/cgi-bin/">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/passwd
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require all granted
# Require local
Require valid-user
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
Require valid-user
</IfModule>
</Directory>
Alias /nagios "/usr/share/nagios/html"
<Directory "/usr/share/nagios/html">
# SSLRequireSSL
Options None
AllowOverride None
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/passwd
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require all granted
# Require local
Require valid-user
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
Require valid-user
</IfModule>
</Directory>