[omd-commits] OMD Git: omd: Added apache configuration for apache 2.4 or later

git version control git at mathias-kettner.de
Tue Oct 22 13:34:20 CEST 2013


Module:   omd
Branch:   master
Commit:   9787b399ff8f5e6958f3475a23da92ad971a62c8
URL:      http://omdistro.org/projects/omd/repository/revisions/9787b399ff8f5e6958f3475a23da92ad971a62c8

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Tue Oct 22 13:23:14 2013 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Tue Oct 22 13:23:14 2013 +0200

Added apache configuration for apache 2.4 or later

---

 packages/apache-omd/Makefile                      |   12 ++
 packages/apache-omd/skel/etc/apache/apache24.conf |  220 +++++++++++++++++++++
 2 files changed, 232 insertions(+)

diff --git a/packages/apache-omd/Makefile b/packages/apache-omd/Makefile
index 69e99e5..0153267 100644
--- a/packages/apache-omd/Makefile
+++ b/packages/apache-omd/Makefile
@@ -10,6 +10,11 @@ ifeq ($(shell uname -m),x86_64)
   MODULE_DIR=$(APACHE_MODULE_DIR_64)
 endif
 
+APACHE_VERSION      = $(shell $(APACHE_BIN) -v | awk '/version/ {print $$3}' | awk -F/ '{print $$2}')
+APACHE_VERSION_MAIN = $(word 1, $(subst ., ,$(APACHE_VERSION)))
+APACHE_VERSION_SUB  = $(word 2, $(subst ., ,$(APACHE_VERSION)))
+APACHE_24_OR_NEWER  = $(shell [ $(APACHE_VERSION_MAIN) -ge 2 -a $(APACHE_VERSION_SUB) -ge 4 ] && echo 1 || echo 0)
+
 APACHE_MODULES=
 APACHE_MODULES_INSTALL=
 APACHE_FCGID_PATH=$(MODULE_DIR)/$(APACHE_FCGID_MODULE)
@@ -45,6 +50,13 @@ skel:
 		cp /etc/php.ini $(SKEL)/etc/apache/php.ini || exit 1; \
 		echo -e "\n\n; OMD OMD OMD OMD OMD OMD\n\nmemory_limit=64M\n\n[Session]\nsession.save_path=###ROOT###/tmp/php/session\nupload_tmp_dir=###ROOT###/tmp/php/upload\nsoap.wsdl_cache_dir=###ROOT###/tmp/php/wsdl-cache\n" >> $(SKEL)/etc/apache/php.ini; \
 	fi
+	
+	# install a custom apache configuration for apache 2.4 or later
+	if [ $(APACHE_24_OR_NEWER) -eq 1 ]; then \
+	    mv $(SKEL)/etc/apache/apache24.conf $(SKEL)/etc/apache/apache.conf ; \
+	else \
+	    rm $(SKEL)/etc/apache/apache24.conf ; \
+	fi
 
 	# Replace macros
 	sed -i -e 's|###APACHE_MODULE_DIR###|$(MODULE_DIR)|g' \
diff --git a/packages/apache-omd/skel/etc/apache/apache24.conf b/packages/apache-omd/skel/etc/apache/apache24.conf
new file mode 100644
index 0000000..87f8044
--- /dev/null
+++ b/packages/apache-omd/skel/etc/apache/apache24.conf
@@ -0,0 +1,220 @@
+###############################################################################
+# Apache configuration file for OMD site specific webserver daemon
+#
+# This file is only used, if you have set WEBSERVER to 'own' (which 
+# is the default). It is the configuration for a site-specific additional
+# Apache server process, which is just listening on 127.0.0.1 and is
+# called by the system-Apache via mod_proxy.
+#
+# Advantages are: No root-permissions are needed for administrating this
+# Apache and priviledges are better separated. Also each OMD site has its
+# own Apache access and error logs below ~/var/log/apache.
+###############################################################################
+
+ServerName 127.0.0.1
+
+# OMD OMD OMD OMD OMD OMD OMD OMD OMD OMD OMD OMD  ----------------------------
+# Better do not change anything in this block or you will have to
+# resolve conflicts in omd cp/mv/upate:
+
+ServerRoot "###ROOT###"
+PidFile ###ROOT###/tmp/apache/run/apache.pid
+DocumentRoot "###ROOT###/var/www"
+
+# Include file where TCP port number is configured. That file
+# is automatically created and changed by 'omd config' if you
+# change APACHE_TCP_PORT.
+Include ###ROOT###/etc/apache/listen-port.conf
+
+# User/Group to run the webserver with
+User ###SITE###
+Group ###SITE###
+
+# ---------------------------------------------------------------
+# 
+# Here you can configure and tune Apache
+# 
+
+ServerAdmin nobody at localhost
+#ServerName www.example.com:80
+UseCanonicalName Off
+
+Timeout 120
+KeepAlive On
+MaxKeepAliveRequests 100
+KeepAliveTimeout 15
+
+DirectoryIndex index.html index.php index.html.var
+AccessFileName .htaccess
+ServerTokens OS
+HostnameLookups Off
+ServerSignature Off
+
+
+##
+## Server-Pool Size Regulation (MPM specific)
+## 
+
+# prefork MPM
+# StartServers: number of server processes to start
+# MinSpareServers: minimum number of server processes which are kept spare
+# MaxSpareServers: maximum number of server processes which are kept spare
+# ServerLimit: maximum value for MaxClients for the lifetime of the server
+# MaxClients: maximum number of server processes allowed to start
+# MaxRequestsPerChild: maximum number of requests a server process serves
+<IfModule prefork.c>
+StartServers         1
+MinSpareServers      1
+MaxSpareServers      5
+ServerLimit          128
+MaxClients           128
+MaxRequestsPerChild  4000
+</IfModule>
+
+# worker MPM
+# StartServers: initial number of server processes to start
+# MaxClients: maximum number of simultaneous client connections
+# MinSpareThreads: minimum number of worker threads which are kept spare
+# MaxSpareThreads: maximum number of worker threads which are kept spare
+# ThreadsPerChild: constant number of worker threads in each server process
+# MaxRequestsPerChild: maximum number of requests a server process serves
+<IfModule worker.c>
+StartServers         2
+MaxClients           150
+MinSpareThreads      25
+MaxSpareThreads      75 
+ThreadsPerChild      25
+MaxRequestsPerChild  0
+</IfModule>
+
+###############################################################################
+# Load Modules
+###############################################################################
+# Ugly IfModules! But they seem to be needed because some distributions have
+# modules compiled in. An example is the log_config module which is
+# compiled in on ubuntu/debian and a module on sles/centos.
+
+LoadModule mpm_prefork_module ###APACHE_MODULE_DIR###/mod_mpm_prefork.so
+
+<IfModule !mod_log_config.c>
+LoadModule log_config_module ###APACHE_MODULE_DIR###/mod_log_config.so
+</IfModule>
+LoadModule access_compat_module ###APACHE_MODULE_DIR###/mod_access_compat.so
+LoadModule auth_basic_module ###APACHE_MODULE_DIR###/mod_auth_basic.so
+LoadModule authn_core_module ###APACHE_MODULE_DIR###/mod_authn_core.so
+LoadModule authn_file_module ###APACHE_MODULE_DIR###/mod_authn_file.so
+LoadModule authz_core_module ###APACHE_MODULE_DIR###/mod_authz_core.so
+LoadModule authz_host_module ###APACHE_MODULE_DIR###/mod_authz_host.so
+LoadModule authz_user_module ###APACHE_MODULE_DIR###/mod_authz_user.so
+LoadModule autoindex_module ###APACHE_MODULE_DIR###/mod_autoindex.so
+LoadModule env_module ###APACHE_MODULE_DIR###/mod_env.so
+LoadModule expires_module ###APACHE_MODULE_DIR###/mod_expires.so
+LoadModule deflate_module ###APACHE_MODULE_DIR###/mod_deflate.so
+LoadModule headers_module ###APACHE_MODULE_DIR###/mod_headers.so
+LoadModule setenvif_module ###APACHE_MODULE_DIR###/mod_setenvif.so
+LoadModule mime_magic_module ###APACHE_MODULE_DIR###/mod_mime_magic.so
+LoadModule mime_module ###APACHE_MODULE_DIR###/mod_mime.so
+LoadModule negotiation_module ###APACHE_MODULE_DIR###/mod_negotiation.so
+LoadModule dir_module ###APACHE_MODULE_DIR###/mod_dir.so
+LoadModule alias_module ###APACHE_MODULE_DIR###/mod_alias.so
+LoadModule rewrite_module ###APACHE_MODULE_DIR###/mod_rewrite.so
+LoadModule cgi_module ###APACHE_MODULE_DIR###/mod_cgi.so
+LoadModule status_module ###APACHE_MODULE_DIR###/mod_status.so
+
+<Directory />
+    Options FollowSymLinks
+    AllowOverride None
+</Directory>
+
+#
+# Configure mod_status (if available)
+#
+<IfModule mod_status.c>
+    <Location /server-status>
+        SetHandler server-status
+        Order deny,allow
+        Deny from all
+        Allow from 127.0.0.1 ::1
+    </Location>
+
+    # Keep track of extended status information for each request
+    ExtendedStatus On
+</IfModule>
+
+#
+# The following lines prevent .htaccess and .htpasswd files from being 
+# viewed by Web clients. 
+#
+<Files ~ "^\.ht">
+    Order allow,deny
+    Deny from all
+</Files>
+
+TypesConfig /etc/mime.types
+
+
+# Loglevel and logfile configuration
+LogLevel warn
+LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+
+#
+# Language configuration
+#
+
+LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
+ForceLanguagePriority Prefer Fallback
+
+AddDefaultCharset UTF-8
+
+AddType application/x-compress .Z
+AddType application/x-gzip .gz .tgz
+
+AddHandler type-map var
+
+#
+# PHP specific configuration
+#
+AddType text/html .php
+
+
+#
+# The following directives modify normal HTTP response behavior to
+# handle known problems with browser implementations.
+#
+BrowserMatch "Mozilla/2" nokeepalive
+BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
+BrowserMatch "RealPlayer 4\.0" force-response-1.0
+BrowserMatch "Java/1\.0" force-response-1.0
+BrowserMatch "JDK/1\.0" force-response-1.0
+
+#
+# The following directive disables redirects on non-GET requests for
+# a directory that does not include the trailing slash.  This fixes a 
+# problem with Microsoft WebFolders which does not appropriately handle 
+# redirects for folders with DAV methods.
+# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
+#
+BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
+BrowserMatch "MS FrontPage" redirect-carefully
+BrowserMatch "^WebDrive" redirect-carefully
+BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
+BrowserMatch "^gnome-vfs/1.0" redirect-carefully
+BrowserMatch "^XML Spy" redirect-carefully
+BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
+
+
+# OMD OMD OMD OMD OMD OMD OMD OMD OMD OMD OMD OMD  ----------------------------
+# Do not change anything below here
+
+MIMEMagicFile ###ROOT###/etc/apache/magic
+ErrorLog ###ROOT###/var/log/apache/error_log
+CustomLog ###ROOT###/var/log/apache/access_log combined
+
+# fcgi settings must be site specific and cannot be used from shared apache
+SharememPath "###ROOT###/tmp/apache/fcgid_shm"
+SocketPath "###ROOT###/tmp/apache/fcgid_sock"
+
+# Load config files from the include dir. You can put your own
+# configuration there. Also addons put default files there.
+Include ###ROOT###/etc/apache/conf.d/*.conf
+



More information about the omd-commits mailing list