### Section 1: Global Environment ServerTokens Prod ServerRoot "/etc/httpd" PidFile run/httpd.pid Timeout 60 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5 StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 5000 # This isn't used by default in Fedora but can be by adjusting # /etc/sysconfig/httpd StartServers 4 MaxClients 300 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 Listen 80 # Use to restrict by IP Address/Range LoadModule authz_host_module modules/mod_authz_host.so # Logging Modules LoadModule log_forensic_module modules/mod_log_forensic.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so # Allow sending and detecting of mime types LoadModule mime_module modules/mod_mime.so # Header magic and compression LoadModule headers_module modules/mod_headers.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so # Provides DirectoryIndex directive LoadModule dir_module modules/mod_dir.so # Disable if you don't need directory indexes LoadModule autoindex_module modules/mod_autoindex.so # Used by most MVC stuff LoadModule rewrite_module modules/mod_rewrite.so #LoadModule env_module modules/mod_env.so #LoadModule setenvif_module modules/mod_setenvif.so #LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule authn_file_module modules/mod_authn_file.so #LoadModule authn_alias_module modules/mod_authn_alias.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so #LoadModule authn_default_module modules/mod_authn_default.so #LoadModule authz_user_module modules/mod_authz_user.so #LoadModule authz_owner_module modules/mod_authz_owner.so #LoadModule authz_groupfile_module modules/mod_authz_groupfile.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so #LoadModule authz_default_module modules/mod_authz_default.so #LoadModule mime_magic_module modules/mod_mime_magic.so #LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule alias_module modules/mod_alias.so #LoadModule cache_module modules/mod_cache.so #LoadModule disk_cache_module modules/mod_disk_cache.so #LoadModule ext_filter_module modules/mod_ext_filter.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule dav_module modules/mod_dav.so #LoadModule dav_fs_module modules/mod_dav_fs.so #LoadModule actions_module modules/mod_actions.so #LoadModule speling_module modules/mod_speling.so #LoadModule suexec_module modules/mod_suexec.so #LoadModule cgi_module modules/mod_cgi.so #LoadModule ldap_module modules/mod_ldap.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule authn_anon_module modules/mod_authn_anon.so #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so #LoadModule userdir_module modules/mod_userdir.so #LoadModule status_module modules/mod_status.so #LoadModule include_module modules/mod_include.so #LoadModule info_module modules/mod_info.so #LoadModule negotiation_module modules/mod_negotiation.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so #LoadModule cern_meta_module modules/mod_cern_meta.so #LoadModule asis_module modules/mod_asis.so #LoadModule unique_id_module modules/mod_unique_id.so Include conf.d/*.conf ExtendedStatus Off User apache Group apache ### Section 2: 'Main' server configuration ServerAdmin sstelfox@bedroomprogrammers.net UseCanonicalName Off DocumentRoot "/var/www/html/default" Options FollowSymLinks AllowOverride None Order Deny,Allow Deny from all # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews Options Indexes SymLinksifOwnerMatch AllowOverride FileInfo AuthConfig Limit Order allow,deny Allow from all # This module won't get loaded unless we want to use it so we should # make sure that it's properly configured UserDir disabled root UserDir public_html AllowOverride AuthConfig Limit Options Indexes SymLinksIfOwnerMatch Order allow,deny Allow from all Order deny,allow Deny from all DirectoryIndex index.html AccessFileName .htaccess Order allow,deny Deny from all TypesConfig /etc/mime.types DefaultType text/plain MIMEMagicFile conf/magic HostnameLookups Off # Disable these if we need to serve files from NFS EnableMMAP On EnableSendfile On ErrorLog logs/error_log LogLevel warn LogFormat "%v %h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\" %I %O %T" combined LogFormat "%v %h %t \"%r\" %>s %b" common LogFormat "%v %{Referer}i -> %U" referer LogFormat "%v %{User-agent}i" agent CustomLog logs/access_log combined ForensicLog logs/forensic_log ServerSignature Off DAVLockDB /var/lib/dav/lockdb Alias /icons/ "/var/www/icons/" Options SymLinksIfOwnerMatch AllowOverride None Order allow,deny Allow from all IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8 AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ DefaultIcon /icons/unknown.gif AddDescription "GZIP compressed document" .gz AddDescription "tar archive" .tar AddDescription "GZIP compressed tar archive" .tgz AddDescription "BZIP2 compressed tar archive" .tar.bz2 ReadmeName README.html HeaderName HEADER.html IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t AddDefaultCharset UTF-8 # Compressed AddType application/x-tar .tgz AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # Certificates AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl # Audio AddType audio/ogg oga ogg # Video AddType video/ogg ogv AddType video/mp4 mp4 AddType video/webm webm # SVG AddType image/svg+xmlsvg svgz AddEncoding gzip svgz # Web Fonts AddType application/vnd.ms-fontobject eot AddType font/truetype ttf AddType font/opentype otf AddType application/x-font-woff woff # Assorted AddType image/x-icon ico AddType image/webp webp AddType text/cache-manifest appcache manifest AddType text/x-component htc AddType application/x-chrome-extension crx AddType application/x-xpinstall xpi AddType application/octet-stream safariextz # Add a bunch of compression directives # 0 - 9 CPU/Bandwidth tradeoff DeflateCompressionLevel 7 SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding # html, txt, css, js, json, xml, etc: FilterDeclare COMPRESS FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/ FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/ FilterChain COMPRESS FilterProtocol COMPRESS change=yes;byteranges=no # webfonts and svg: SetOutputFilter DEFLATE AddType text/html .shtml AddOutputFilter INCLUDES .shtml #ErrorDocument 500 "The server just diagnosed itself with schizophrenia." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html 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 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 SetHandler server-status Order deny,allow Deny from all Allow from 10.13.37. SetHandler server-info Order deny,allow Deny from all Allow from 10.13.37. ProxyRequests On ProxyVia Block Order deny,allow Deny from all Allow from 10.13.37. CacheEnable disk / CacheRoot "/var/cache/mod_proxy" ``` ### /etc/httpd/conf.d/php.conf This file is being included here as it will be needed most places that I run Apache. Please refer to the PHP section below for more information. ``` LoadModule php5_module modules/libphp5.so LoadModule php5_module modules/libphp5-zts.so AddHandler php5-script .php AddType text/html .php AddType application/x-httpd-php-source .phps DirectoryIndex index.php