Apache HTTP Server /etc/apache2/conf.d/default.conf

Original ๐Ÿ“‹ Alpine Linux v3.21 70 lines

Works On

Viewing:
Alpine Linux v3.21
Same on:
Other versions:

Details

Size
70 lines
MD5
557a5ba2f7ee33171e90190eb6ef8f88
SHA256
ef417e33de3b08faa204411fed29bb5e88d8c6945b93d50af1b0984a7129a4c0

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/557a5ba2f7ee33171e90190eb6ef8f88?hint=default.conf
wget:
wget -O default.conf https://exampleconfig.com/api/v1/config/original/557a5ba2f7ee33171e90190eb6ef8f88?hint=default.conf

For AI Agents

You are a DevOps agent. Fetch the default Apache HTTP Server config for Alpine Linux v3.21 from https://exampleconfig.com/api/v1/config/original/557a5ba2f7ee33171e90190eb6ef8f88?hint=default.conf. Compare with my current /etc/apache2/conf.d/default.conf and summarize differences and safe changes.

Copy this prompt into Claude, ChatGPT, or other AI assistants.

/etc/apache2/conf.d/default.conf
#
# This configuration file reflects default settings for Apache HTTP Server.
#
# You may change these, but chances are that you may not need to.
#

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 60

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

#
# UseCanonicalName: Determines how Apache constructs self-referencing 
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client.  When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride 
# directive.
#
AccessFileName .htaccess

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

#
# Set a timeout for how long the client may take to send the request header
# and body.
# The default for the headers is header=20-40,MinRate=500, which means wait
# for the first byte of headers for 20 seconds. If some data arrives,
# increase the timeout corresponding to a data rate of 500 bytes/s, but not
# above 40 seconds.
# The default for the request body is body=20,MinRate=500, which is the same
# but has no upper limit for the timeout.
# To disable, set to header=0 body=0
#
<IfModule reqtimeout_module>
  RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
</IfModule>

Install Apache HTTP Server

Alpine Linux

sudo apk add apache2

Debian

sudo apt update && sudo apt install apache2

Red Hat Enterprise Linux

sudo yum install httpd

Ubuntu

sudo apt update && sudo apt install apache2

File Location

File Path
/etc/apache2/conf.d/default.conf
Directory
/etc/apache2/conf.d/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

When should I use this default.conf?

Restore it. Compare it. Start clean.

How do I restore Apache HTTP Server defaults?

Download, replace, restart.

Is default.conf safe for production?

Yes. This is exactly what shipped. Safe starting point.

How does this differ from other OS versions?

Defaults change. This one is specific to Alpine Linux v3.21.

Can I use this for Apache HTTP Server troubleshooting?

Absolutely. Diff this against yours to spot the problem.