openSUSE 設定ファイル Apache2
覚書
/etc/apache2/default-server.conf
### default-server.conf ###
ServerAdmin info@example.jp
ServerName example.jp
DocumentRoot /home/example/public_html
#ErrorLog /var/log/apache2/example.jp-error_log
#CustomLog /var/log/apache2/example.jp-access_log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/home/example/public_html/cgi-bin/"
<directory "/home/example/public_html/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
AddHandler image/gif .gif
AddHandler image/jpg .jpg
AddHandler image/png .png
AddHandler text/html .html
AddHandler text/htm .htm
AddHandler text/css .css
AddHandler text/cfg .cfg
AddHandler text/js .js
AddHandler text/php .php
</directory>
#<ifModule mod_userdir.c>
# Note that the name of the user directory ("public_html") cannot simply be
# changed here, since it is a compile time setting. The apache package
# would have to be rebuilt. You could work around by deleting
# /usr/sbin/suexec, but then all scripts from the directories would be
# executed with the UID of the webserver.
#UserDir public_html
# The actual configuration of the directory is in
# /etc/apache2/mod_userdir.conf.
#Include /etc/apache2/mod_userdir.conf
# </ifModule>
<directory "/home/example/public_html">
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</directory>
Alias /icons/ "/usr/share/apache2/icons/"
<directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</directory>
Include /etc/apache2/conf.d/*.conf
# The manual... if it is installed ('?' means it won't complain)
Include /etc/apache2/conf.d/apache2-manual?conf
/etc/apache2/mod_log_config.conf
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# http://httpd.apache.org/docs-2.2/mod/mod_log_config.html
#
#
# Format string: Nickname:
#
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
# To use %I and %O, you need to enable mod_logio
<ifModule mod_logio.c>
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</ifModule>
# Use one of these when you want a compact non-error SSL logfile on a virtual
# host basis:
<ifModule mod_ssl.c>
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b" ssl_common
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b \"%{Referer}i\" \"%{User-Agent}i\"" ssl_combined
</ifModule>
###################################################################################################
##
###################################################################################################
#SetEnvIf Remote_Addr "192.168.0." nolog
#SetEnvIf Remote_Addr "127.0.0." nolog
SetEnvIf Remote_Addr "::1" nolog
SetEnvIf Request_URI "\.(gif)|(jpg)|(JPG)|(png)|(ico)|(js)|(bmp)|(css)|(cgi)$" nolog
SetEnvIf Request_URI "^/_mem_bin/" nolog
SetEnvIf Request_URI "^/_vti_bin/" nolog
SetEnvIf Request_URI "^/c/" nolog
SetEnvIf Request_URI "^/d/" nolog
SetEnvIf Request_URI "^/msadc/" nolog
SetEnvIf Request_URI "^/MSADC/" nolog
SetEnvIf Request_URI "^/scripts/" nolog
SetEnvIf Request_URI "^/default.ida" nolog
SetEnvIf User-Agent "Alexa Toolbar" nolog
SetEnvIf User-Agent "Baiduspider" nolog
SetEnvIf User-Agent "BasicHTTP" nolog
SetEnvIf User-Agent "Bookmark" nolog
SetEnvIf User-Agent "Gigabot" nolog
SetEnvIf User-Agent "Girafabot" nolog
SetEnvIf User-Agent "Googlebot" nolog
SetEnvIf User-Agent "Hatena" nolog
SetEnvIf User-Agent "ia_archiver" nolog
SetEnvIf User-Agent "ichiro" nolog
SetEnvIf User-Agent "Infoseek" nolog
SetEnvIf User-Agent "Java" nolog
SetEnvIf User-Agent "MaSagool" nolog
SetEnvIf User-Agent "MFcrawler" nolog
SetEnvIf User-Agent "MJ12bot" nolog
SetEnvIf User-Agent "msnbot" nolog
SetEnvIf User-Agent "MVAClient" nolog
SetEnvIf User-Agent "page_verifier" nolog
SetEnvIf User-Agent "Plagger" nolog
SetEnvIf User-Agent "psbot" nolog
SetEnvIf User-Agent "scidclam" nolog
SetEnvIf User-Agent "Scooter" nolog
SetEnvIf User-Agent "Shim-Crawler" nolog
SetEnvIf User-Agent "Snapbot" nolog
SetEnvIf User-Agent "WebCrawler" nolog
SetEnvIf User-Agent "Yahoo" nolog
SetEnvIf User-Agent "Yahoo! Slurp" nolog
SetEnvIf User-Agent "zia-httpmirror" nolog
SetEnvIf User-Agent "Steeler" nolog
/etc/apache2/vhosts.d/yast2_vhosts.conf
<virtualHost 192.168.24.10:80>
ServerAdmin info@example.jp
ServerName example.jp
#ServerAlias example.jp www.example.jp
DocumentRoot /home/example/public_html
CustomLog /var/log/apache2/example.jp-access_log common env=!nolog
ErrorLog /var/log/apache2/example.jp-error_log
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/home/example/public_html/cgi-bin/"
<directory "/home/example/public_html/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
AddHandler image/gif .gif
AddHandler image/jpg .jpg
AddHandler image/png .png
AddHandler text/html .html
AddHandler text/htm .htm
AddHandler text/css .css
AddHandler text/cfg .cfg
AddHandler text/js .js
AddHandler text/php .php
AddHandler text/tmpl .tmpl
</directory>
#<ifModule mod_userdir.c>
# Note that the name of the user directory ("public_html") cannot simply be
# changed here, since it is a compile time setting. The apache package
# would have to be rebuilt. You could work around by deleting
# /usr/sbin/suexec, but then all scripts from the directories would be
# executed with the UID of the webserver.
#UserDir public_html
# The actual configuration of the directory is in
# /etc/apache2/mod_userdir.conf.
#Include /etc/apache2/mod_userdir.conf
# </ifModule>
<directory "/home/example/public_html">
Options MultiViews SymLinksIfOwnerMatch IncludesNoExec ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</directory>
<directory "/home/example/public_html/mt">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
AddHandler image/gif .gif
AddHandler image/jpg .jpg
AddHandler image/png .png
AddHandler text/html .html
AddHandler text/htm .htm
AddHandler text/css .css
AddHandler text/cfg .cfg
AddHandler text/js .js
AddHandler text/php .php
AddHandler text/tmpl .tmpl
AddHandler text/pl .pl
AddHandler text/text .text
AddType text/html cgi
AddHandler cgi-script cgi
</directory>
<directory "/home/example/public_html/mtone">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
AddHandler image/gif .gif
AddHandler image/jpg .jpg
AddHandler image/png .png
AddHandler text/html .html
AddHandler text/htm .htm
AddHandler text/css .css
AddHandler text/cfg .cfg
AddHandler text/js .js
AddHandler text/php .php
AddHandler text/tmpl .tmpl
AddHandler text/pl .pl
AddHandler text/text .text
AddType text/html cgi
AddHandler cgi-script cgi
</directory>
RewriteEngine On
RewriteLog /var/log/apache2/rewrite_log
RewriteLogLevel 0
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/postfixadmin/(.*)?$ https://%{HTTP_HOST}/postfixadmin/$1 [L,R]
RewriteRule ^/mail/(.*)?$ https://%{HTTP_HOST}/mail/$1 [L,R]
</virtualHost>
Popularity: 7% [?]
