Posts tagged configuration
Apache Configuration for Multiple Domains
Feb 2nd
Here is a sample configuration for Apache on Windows.
Configuration files are loaded separately. You can download all configuration here.
httpd.conf
#------------------------------------------------------------------------------
# ServerRoot
#------------------------------------------------------------------------------
ServerRoot "D:/Httpd"
#------------------------------------------------------------------------------
# HTTP
#------------------------------------------------------------------------------
Listen 192.168.1.30:80
#------------------------------------------------------------------------------
# SVN
#------------------------------------------------------------------------------
Listen 192.168.1.20:8443
Listen 192.168.1.30:8443
#------------------------------------------------------------------------------
# Modules
#------------------------------------------------------------------------------
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_alias_module modules/mod_authn_alias.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cache_module modules/mod_cache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule disk_cache_module modules/mod_disk_cache.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule ldap_module modules/mod_ldap.so
LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
#------------------------------------------------------------------------------
# User - Group
#------------------------------------------------------------------------------
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
#------------------------------------------------------------------------------
# Main Server Configuration
#------------------------------------------------------------------------------
ServerAdmin catch-all@mydomain.com
ServerName 192.168.1.30:80
#------------------------------------------------------------------------------
# Document Root
#------------------------------------------------------------------------------
DocumentRoot "D:/WorkSpace"
#------------------------------------------------------------------------------
# Default Directory Settings
#------------------------------------------------------------------------------
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
#------------------------------------------------------------------------------
# Default Directory
#------------------------------------------------------------------------------
<Directory "D:/WorkSpace">
#--------------------------------------------------------------------------
# Options Directive
# All ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes
# MultiViews SymLinksIfOwnerMatch
#--------------------------------------------------------------------------
Options Indexes FollowSymLinks ExecCGI
#--------------------------------------------------------------------------
# Allow Override Directive
# All AuthConfig FileInfo Indexes Limit None
#--------------------------------------------------------------------------
AllowOverride All
#--------------------------------------------------------------------------
# Controls who can get stuff from this server.
#--------------------------------------------------------------------------
Order allow,deny
Allow from all
</Directory>
#------------------------------------------------------------------------------
# Directory Index
#------------------------------------------------------------------------------
<IfModule dir_module>
DirectoryIndex index.html index.php index.cgi
</IfModule>
#------------------------------------------------------------------------------
# Protect .htaccess and .htpasswd
#------------------------------------------------------------------------------
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
#------------------------------------------------------------------------------
# Error Logging
#------------------------------------------------------------------------------
ErrorLog "D:/WebTemp/Apache-Logs/error.log"
#------------------------------------------------------------------------------
# Error Logging Level
# debug, info, notice, warn, error, crit, alert, emerg
#------------------------------------------------------------------------------
LogLevel crit
#------------------------------------------------------------------------------
# Error Logging Configuration
#------------------------------------------------------------------------------
<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 \"%{User-Agent}i\"" mydomain
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>
#--------------------------------------------------------------------------
# Redirect
# Allows you to tell clients about documents that used to exist in your
# server's namespace, but do not anymore. The client will make a new
# request for the document at its new location.
#--------------------------------------------------------------------------
# Redirect permanent /foo http://mydomain.com/bar
#--------------------------------------------------------------------------
# Alias
# Maps web paths into filesystem paths and is used to access content that
# does not live under the DocumentRoot.
#--------------------------------------------------------------------------
# Alias /webpath /full/filesystem/path
#--------------------------------------------------------------------------
# ScriptAlias: This controls which directories contain server scripts.
#--------------------------------------------------------------------------
# ScriptAlias /cgi-bin/ "D:/Httpd/cgi-bin/"
</IfModule>
<IfModule cgid_module>
#--------------------------------------------------------------------------
# ScriptSock
# On threaded servers, designate the path to the UNIX socket used to
# communicate with the CGI daemon of mod_cgid
#--------------------------------------------------------------------------
# Scriptsock logs/cgisock
</IfModule>
#------------------------------------------------------------------------------
# "D:/Httpd/cgi-bin" should be changed to whatever your ScriptAliased CGI
# directory exists, if you have that configured.
#------------------------------------------------------------------------------
<Directory "D:/Httpd/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
#------------------------------------------------------------------------------
# Default MIME Type
#------------------------------------------------------------------------------
DefaultType text/plain
<IfModule mime_module>
#--------------------------------------------------------------------------
# Mime Type Configuration
#--------------------------------------------------------------------------
TypesConfig conf/mime.types
#--------------------------------------------------------------------------
# AddType
# Allows you to add to or override the MIME configuration file specified
# in TypesConfig for specific file types.
#--------------------------------------------------------------------------
#AddType application/x-gzip .tgz
#--------------------------------------------------------------------------
# Add Encoding
# Allows you to have certain browsers uncompress information on the fly.
# Note: Not all browsers support this.
#--------------------------------------------------------------------------
# AddEncoding x-compress .Z
# AddEncoding x-gzip .gz .tgz
#--------------------------------------------------------------------------
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#--------------------------------------------------------------------------
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#--------------------------------------------------------------------------
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi .pl
# For type maps (negotiated resources):
#AddHandler type-map var
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>
#------------------------------------------------------------------------------
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#------------------------------------------------------------------------------
#MIMEMagicFile conf/magic
#------------------------------------------------------------------------------
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#------------------------------------------------------------------------------
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://mydomain.com/subscription_info.html
#------------------------------------------------------------------------------
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall is used to deliver
# files. This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
#------------------------------------------------------------------------------
#EnableMMAP off
#EnableSendfile off
#------------------------------------------------------------------------------
# Supplemental configuration
#------------------------------------------------------------------------------
Include conf/extra/enabled.*.conf
# Virtual Hosts
<IfModule vhost_alias_module>
Include conf/vhost/enabled.*.conf
</IfModule>
# Secure (SSL/TLS) connections
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLPassPhraseDialog builtin
SSLSessionCache "shm:D:/WebTemp/SSL-Cache"
SSLSessionCacheTimeout 300
SSLMutex default
</IfModule>
#------------------------------------------------------------------------------
# PHP Module (Optional)
#------------------------------------------------------------------------------
#PHP 5.3.3
#PHPIniDir "D:/PHP/PHP-5.3.3-VC6/"
#LoadModule php5_module "D:/PHP/PHP-5.3.3-VC6/php5apache2_2.dll"
#PHP 5.3.1
#PHPIniDir "D:/PHP/PHP-5.3.1-VC6/"
#LoadModule php5_module "D:/PHP/PHP-5.3.1-VC6/php5apache2_2.dll"
#PHP 5.2.12
#PHPIniDir "D:/PHP/PHP-5.2.12_VC6/"
#LoadModule php5_module "D:/PHP/PHP-5.2.12-VC6/php5apache2_2.dll"
# PHP MimeType
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
#------------------------------------------------------------------------------
# Perl Module (Optional)
#------------------------------------------------------------------------------
#LoadFile "D:/Perl/bin/perl512.dll"
#LoadModule perl_module modules/mod_perl.so
# Perl Handler
#AddHandler cgi-script .cgi pl
#ScriptInterpreterSource Registry-Strict
IIS and Apache IP-Port Configuration
Jan 26th
httpcfg iplisten (from msdn)
This group of examples show how to add, delete, and list IP address in the iplisten store.
Adding an IP address to the iplisten store.
httpcfg set iplisten -i xxx.xxx.xxx.xxx:80
HttpSetServiceConfiguration completed with 0.
Viewing all off the IP addresses that the HTTP API is listening on. (more…)


LinkedIn
Twitter
Skype