# apache2.conf tailored for vapi ServerRoot "/etc/apache2" # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # # We will load modules explicitly in this file. Do not load dynamic and/or incorrect modules from OS-provided directory. #Include conf.modules.d/*.conf LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so LoadModule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so LoadModule authn_core_module /usr/lib/apache2/modules/mod_authn_core.so LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so LoadModule authz_groupfile_module /usr/lib/apache2/modules/mod_authz_groupfile.so LoadModule authz_user_module /usr/lib/apache2/modules/mod_authz_user.so LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so LoadModule auth_basic_module /usr/lib/apache2/modules/mod_auth_basic.so LoadModule reqtimeout_module /usr/lib/apache2/modules/mod_reqtimeout.so LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so # LoadModule log_config_module /usr/lib/apache2/modules/mod_log_config.so -- enabled by default in apache2 # LoadModule logio_module /usr/lib/apache2/modules/mod_logio.so -- enabled by default in apache2 LoadModule env_module /usr/lib/apache2/modules/mod_env.so LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so # LoadModule unixd_module /usr/lib/apache2/modules/mod_unixd.so -- enabled by default in apache2 LoadModule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User www-data Group www-data # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # definition. These values also provide defaults for # any containers you may define later in the file. # # All of these directives may appear inside containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. admin@your-domain.com # ServerAdmin admin@localhost # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # #ServerName www.example.com:80 # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # blocks below. # AllowOverride none Require all denied # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # Require all denied # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a # container, that host's errors will be logged there and not here. # # Make sure we log to stdout and stderr ErrorLog /proc/self/fd/2 CustomLog /proc/self/fd/1 combined # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel info # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined #LogFormat "%h %l %u %t \"%r\" %>s %b" common # You need to enable mod_logio.c to use %I and %O #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a # container, they will be logged here. Contrariwise, if you *do* # define per- access logfiles, transactions will be # logged therein and *not* in this file. # #CustomLog "logs/access_log" common # # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # #CustomLog "logs/access_log" combined ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" # # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # AllowOverride None Options None Require all denied # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type. # TypesConfig /etc/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 # # AddEncoding 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 # # 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 # # Specify a default charset for all content served; this enables # interpretation of all content as UTF-8 by default. To use the # default browser choice (ISO-8859-1), or to allow the META tags # in HTML content to override this choice, comment out this # directive: # AddDefaultCharset UTF-8 # # 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 # # EnableMMAP and EnableSendfile: On systems that support it, # memory-mapping or the sendfile syscall may be 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. # Defaults if commented: EnableMMAP On, EnableSendfile Off # # EnableMMAP off # EnableSendfile on # Supplemental configuration # # Load config files in the "/etc/httpd/conf.d" directory, if any. IncludeOptional conf-enabled/*.conf Require all denied Order allow,deny Deny from all Satisfy All # Do not reveal more than is required ServerSignature Off ServerTokens Prod MaxRequestWorkers 1024 ServerLimit 1024 # Add conservative timeouts that can still protect against bad actors RequestReadTimeout header=10-30,MinRate=500 body=20,MinRate=500 # All the stuff that used to be in .htaccess and custom configs are now in the our vhost block ServerAdmin webdev-alerts@theorchard.com DocumentRoot /var/www/html/public RewriteEngine On LimitRequestLine 65504 KeepAlive On KeepAliveTimeout 60 # Load additional modules, including php from custom location LoadModule mime_magic_module /usr/lib/apache2/modules/mod_mime_magic.so LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so LoadModule php_module /usr/lib/apache2/modules/libphp8.4.so AddType application/x-httpd-php .php LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %{Host}i \"%{Referer}i\" \"%{User-Agent}i\"" combined AddType image/svg+xml svg svgz AddEncoding gzip svgz Require all denied Require all denied Require all denied Options None AllowOverride None Require all denied RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L] Options FollowSymLinks AllowOverride None Require all granted SetHandler server-status Require host localhost, 127.0.0.1 Require host localhost, 127.0.0.1 Require host localhost, 127.0.0.1