上接“Cacti和Zabbix所需Apache安装配置(一)”(http://rolandqu.blog.51cto.com/3477736/945717)
6. httpd.conf 配置文件示例
- ServerRoot "/usr/local/apache"
- Listen 80
- LoadModule php5_module modules/libphp5.so
- <IfModule !mpm_netware_module>
- <IfModule !mpm_winnt_module>
- User daemon
- Group daemon
- </IfModule>
- </IfModule>
- ServerAdmin you@example.com
- ServerName YourServerIpAddr:80
- DocumentRoot "/usr/local/apache/htdocs/"
- <Directory />
- Options FollowSymLinks
- AllowOverride None
- Order deny,allow
- Deny from all
- </Directory>
- <Directory "/data/website/">
- Options FollowSymLinks
- AllowOverride None
- Order allow,deny
- Allow from all
- </Directory>
- <IfModule dir_module>
- DirectoryIndex index.html index.shtml index.wml index.php index.jsp
- </IfModule>
- <FilesMatch "^\.">
- Order allow,deny
- Deny from all
- Satisfy All
- </FilesMatch>
- <Files ~ "\.inc$">
- Order allow,deny
- Deny from all
- </Files>
- <Files ~ "\.log$">
- Order allow,deny
- Deny from all
- </Files>
- <Files ~ "\.err$">
- Order allow,deny
- Deny from all
- </Files>
- <Files ~ "\.conf$">
- Order allow,deny
- Deny from all
- </Files>
- <Location /etc/>
- Order allow,deny
- Deny from all
- </Location>
- <Location /log/>
- Order allow,deny
- Deny from all
- </Location>
- ErrorLog "logs/error_log"
- LogLevel warn
- <IfModule log_config_module>
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
- LogFormat "%h %l %u %t \"%r\" %>s %b" common
- <IfModule logio_module>
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
- </IfModule>
- </IfModule>
- <IfModule alias_module>
- ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
- </IfModule>
- <IfModule cgid_module>
- </IfModule>
- <Directory "/usr/local/apache/cgi-bin">
- AllowOverride None
- Options None
- Order allow,deny
- Allow from all
- </Directory>
- DefaultType text/plain
- <IfModule mime_module>
- TypesConfig conf/mime.types
- AddType application/x-compress .Z
- AddType application/x-gzip .gz .tgz
- AddType text/vnd.wap.wml wml
- AddType application/x-httpd-php .php
- AddType application/vnd.symbian.install .sis
- AddType application/octet-stream .sisx
- AddType application/octet-stream .cab
- AddType application/cab .cab
- AddType application/x-compress .cab
- AddType application/x-compressed .cab
- AddType zz-application/zz-winassoc-cab .cab
- AddType application/vnd.ms-cab-compressed .cab
- AddType application/java-archive .jar
- AddType text/vnd.sun.j2me.app-descriptor .jad
- </IfModule>
- Include conf/extra/httpd-mpm.conf
- Include conf/vhosts.conf
- <IfModule ssl_module>
- SSLRandomSeed startup builtin
- SSLRandomSeed connect builtin
- </IfModule>
7. 由于博文字数限制 httpd-mpm.conf 配置示例请参看“Cacti和Zabbix所需Apache安装配置(三)”(http://rolandqu.blog.51cto.com/3477736/945740)
8. 由于博文字数限制 vhosts.conf 配置示例请参看“Cacti和Zabbix所需Apache安装配置(三)”(http://rolandqu.blog.51cto.com/3477736/945740)