{"id":21317393,"url":"https://github.com/ibaca/apacheerrordocuments","last_synced_at":"2025-10-09T21:34:41.748Z","repository":{"id":7398485,"uuid":"8728509","full_name":"ibaca/apacheErrorDocuments","owner":"ibaca","description":"My customization of Apache's default error documents. I'm using Bootstrap 2.2.2.","archived":false,"fork":false,"pushed_at":"2012-12-12T22:58:32.000Z","size":1966,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T22:12:50.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibaca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-12T13:36:09.000Z","updated_at":"2014-06-23T14:21:24.000Z","dependencies_parsed_at":"2022-09-15T16:11:25.328Z","dependency_job_id":null,"html_url":"https://github.com/ibaca/apacheErrorDocuments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibaca/apacheErrorDocuments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2FapacheErrorDocuments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2FapacheErrorDocuments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2FapacheErrorDocuments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2FapacheErrorDocuments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibaca","download_url":"https://codeload.github.com/ibaca/apacheErrorDocuments/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2FapacheErrorDocuments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002054,"owners_count":26083286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T18:46:37.046Z","updated_at":"2025-10-09T21:34:41.717Z","avatar_url":"https://github.com/ibaca.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customizing Apache Error Documents\n\n## Debian\n* This is on Debian based systems. Written from Ubuntu 12.04 LTS\n\nApache's default error pages are served from: \n\n```\n/usr/share/apache2/error\n```\n\nTo customize these pages, we'll make a copy of them somewhere in `/var/www` that we'll edit and tell Apache to use our new ones instead. I usually only keep my default stuff in `/var/www/`, so I'll put them directly into `/var/www`.\n\n```\nroot@magikarp:/var/www# ll\ntotal 20\ndrwxr-xr-x  4 root root 4096 Dec 12 16:06 ./\ndrwxr-xr-x 13 root root 4096 Nov 18 16:55 ../\ndrwxr-xr-x  6 root root 4096 Dec 12 11:25 assets/\ndrwxr-xr-x  3 root root 4096 Dec 12 15:49 error/ \u003c- Our copy\n-rw-r--r--  1 root root 2300 Dec 12 16:00 index.html\nroot@magikarp:/var/www# \n```\nIf you `ls` our new `error` directory, you'll see a bunch of `.html.var` files for all of our different errors. To make these pages prettier, though, we're mostly interested in `error/include`.\n\n```\nroot@magikarp:/var/www/error/include# ll\ntotal 16\ndrwxr-xr-x 2 root root 4096 Dec 12 16:01 ./\ndrwxr-xr-x 3 root root 4096 Dec 12 15:49 ../\n-rw-r--r-- 1 root root  422 Dec 12 15:46 bottom.html\n-rw-r--r-- 1 root root    0 Dec 12 15:44 spacer.html\n-rw-r--r-- 1 root root 2264 Dec 12 16:01 top.html\nroot@magikarp:/var/www/error/include#\n```\n\n`top.html` is spit out before the error message. So this is where we want to put all our styles and whatnot. `bottom.html` is, as you guessed it, spit out after the error message. \n\n### Required modules\nYou need to make sure these three modules are enabled. \n\n - mod_negotiation\n - mod_include\n - mod_alias\n\n```\nroot@magikarp:/etc/apache2/conf.d# a2enmod negotiation include alias\nModule negotiation already enabled\nModule include already enabled\nModule alias already enabled\nroot@magikarp:/etc/apache2/conf.d# \n```\n\n### Config File\nTo add our changes to the apache config, there should be a template already at `/etc/apache2/conf.d/localized-error-pages`. Do a quick `cp localized-error-pages localized-error-pages.bak` to make a backup, and uncomment it to look like this:\n\n```\nroot@magikarp:/etc/apache2/conf.d# cat localized-error-pages\n\u003cIfModule mod_negotiation.c\u003e\n \u003cIfModule mod_include.c\u003e\n  \u003cIfModule mod_alias.c\u003e\n\n    Alias /error/ \"/var/www/error/\"\n\n    \u003cDirectory \"/var/www/error\"\u003e\n        AllowOverride None\n        Options IncludesNoExec\n        AddOutputFilter Includes html\n        AddHandler type-map var\n        Order allow,deny\n        Allow from all\n        LanguagePriority en cs de es fr it nl sv pt-br ro\n        ForceLanguagePriority Prefer Fallback\n    \u003c/Directory\u003e\n\n    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var\n    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var\n    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var\n    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var\n    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var\n    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var\n    ErrorDocument 410 /error/HTTP_GONE.html.var\n    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var\n    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var\n    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var\n    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var\n    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var\n    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var\n    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var\n    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var\n    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var\n    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var\n  \u003c/IfModule\u003e\n \u003c/IfModule\u003e\n\u003c/IfModule\u003e\nroot@magikarp:/etc/apache2/conf.d# \n```\n### Restart Apache\nRestart apache and your new error documents should be getting served!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaca%2Fapacheerrordocuments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibaca%2Fapacheerrordocuments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaca%2Fapacheerrordocuments/lists"}