Apache Page Not Found Error
Contents |
In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: Justin Ellingwood Subscribe Subscribed Share Contents Contents We hope you find apache custom error page this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure apache custom 404 error page for developers. Learn more → 6 How To Configure Apache to Use Custom Error Pages on Ubuntu 14.04 Posted Jun 9, 2015 apache default error page 44.8k views Apache Ubuntu Introduction Apache is the most popular web server in the world. It is well-supported, feature-rich, and flexible. When designing your web pages, it is often helpful to customize every piece of content that
Apache 503 Error Page
your users will see. This includes error pages for when they request content that is not available. In this guide, we'll demonstrate how to configure Apache to use custom error pages on Ubuntu 14.04. Prerequisites To get started on with this guide, you will need a non-root user with sudo privileges. You can set up a user of this type by following along with our initial set up guide for Ubuntu 14.04. You will also apache page not found redirect need to have Apache installed on your system. Learn how to set this up by following the first step of this guide. Creating Your Custom Error Pages We will create a few custom error pages for demonstration purposes, but your custom pages will obviously be different. We will put our custom error pages in the /var/www/html directory where Ubuntu's Apache installation sets its default document root. We'll make a page for 404 errors called custom_404.html and one for general 500-level errors called custom_50x.html. You can use the following lines if you are just testing. Otherwise, put your own content in these locations:
- echo "
Error 404: Not found :-(
" | sudo tee /var/www/html/custom_404.html - echo "
I have no idea where that file is, sorry. Are you sure you typed in the correct URL?
" | sudo tee -a /var/www/html/custom_404.html - echo "
Oops! Something went wrong...
" | sudo tee /var/www/html/custom_50x.html - echo "
We seem to be having some technical difficulties. Hang tight.
" | sudo tee -a /var/www/html/custom_50x.html We now have two custom error pages that we can serve when client requests result in different errors. Configuring Apache to Use your Error Pages Now, we just need to tell Apache that it should be utilizing these pages whenever the correct error conditions occur. Open the virtual host filehere for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more wordpress apache page not found about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Apache Set 404 Page
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Php Custom Error Page
each other. Join them; it only takes a minute: Sign up 404 Not Found with Apache server up vote 2 down vote favorite 1 I am trying to get my website setup and whenever I try to use my https://www.digitalocean.com/community/tutorials/how-to-configure-apache-to-use-custom-error-pages-on-ubuntu-14-04 domain name to connect I get "404 Not Found" When I try and reach the site with my IP it works fine. I am on Debian x64. Can someone please help me get this resolved. If you need more information just ask. Httpd.conf Apache2.conf apache http-status-code-404 share|improve this question edited Nov 28 '12 at 9:33 Arnestig 1,231822 asked Nov 22 '12 at 6:04 Nicholas Brown 11113 @Arnestig: You don't know if the problem actually is http://stackoverflow.com/questions/13506716/404-not-found-with-apache-server debian specific or not. –Stefan Steinegger Nov 28 '12 at 9:35 @StefanSteinegger: Well we don't know if this problem is caused by a hardware issue, software issue or some other problem. It's good that Nicholas Brown informs us that he's running on Debian x64, but the question itself is not related to Debian. He's not asking a question regarding how Debian works / behaves etc. This question is entirely directed at getting apache up and running. Therefore the tag "apache". –Arnestig Nov 28 '12 at 9:37 @Arnestig: good points. –Stefan Steinegger Nov 28 '12 at 9:40 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote Where do you have your website ? On local network or on a hosting service provider? In any case you need to add your web-server ip to the DNS server (either local or www) depending upon your requirements, without knowing where your webserver is local or global it is difficult to give you an answer share|improve this answer answered Nov 22 '12 at 6:20 ajet 365313 Good point. I didn't even consider the DNS settings, but that should be looked at as well. –Kenzo Nov 22 '12 at 6:24 My site is on a providers VPS. –Nicholas Brown Nov 22 '12 at 6:25 @Nicholas Brown That doesn't necessarily me
generic error responses in the event of 4xx or 5xx HTTP status codes, these responses are rather stark, uninformative, and can be intimidating to site users. You may wish to https://httpd.apache.org/docs/2.4/custom-error.html provide custom error responses which are either friendlier, or in some language other than English, or perhaps which are styled more in line with your site layout. Customized error responses can be defined for any HTTP http://askubuntu.com/questions/621264/apache2-virtual-host-error-404-not-found status code designated as an error condition - that is, any 4xx or 5xx status. Additionally, a set of values are provided, so that the error document can be customized further based on the values of error page these variables, using Server Side Includes. Or, you can have error conditions handled by a cgi program, or other dynamic handler (PHP, mod_perl, etc) which makes use of these variables. Configuration Available Variables Customizing Error Responses Multi Language Custom Error Documents See alsoComments Configuration Custom error documents are configured using the ErrorDocument directive, which may be used in global, virtualhost, or directory context. It may be used in .htaccess files if AllowOverride is set to FileInfo. ErrorDocument 500 "Sorry, our script crashed. Oh dear" ErrorDocument 500 /cgi-bin/crash-recover ErrorDocument 500 http://error.example.com/server_error.html ErrorDocument 404 /errors/not_found.html ErrorDocument 401 /subscription/how_to_subscribe.html The syntax of the ErrorDocument directive is: ErrorDocument <3-digit-code>
where the action will be treated as: A local URL to redirect to (if the action begins with a "/"). An external URL to redirect to (if the action is a valid URL). Text to be displayed (if none of the above). The text must be wrapped in quotes (") if it consists of more than one word. When redirecting to a local URL, additional environment variables are set so that the response can be further customized. They are not sent to external URLs. Available Variables Redirecting to another URL can be useful, but only if some information can be passed which can then be used to explain or log the error condition more clearly. To achieve this, when the error redirect is sent, additional environment variables will be set, which will be generated from the headers provided to the original request by prepending 'REDIRECT_' onto the original header name. This provides the error document the context of the original request. For example, you might receive, in addition to more usual environment variables, the following. REDIRECT_HTTP_ACCEPT=*/*, image/gif, image/jpeg, image/png
REDIRECT_HTTP_USER_AGENT=Mocommunities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Apache2 - Virtual Host - Error 404 Not Found up vote 1 down vote favorite Just installed Apache2 on a dev box, no accessible from the Internet. After the install I can open a browser from my client (MAC) to the IP Address and it does display the default "Apache2 Ubuntu Default Page". I am trying to setup a virtual host. Found lots of references, but can't seem to make this work. In the directory /etc/apache2/sites-available I created a "audio-site.conf" it has the following ServerAdmin webmaster@localhost DocumentRoot /home/jason/web
Options FollowSymLinks AllowOverride All Order Allow,Deny AllowOverride all Order allow,deny allow from all Then ran commands sudo a2ensite audio-site sudo /etc/init.d/apache2 restart In the client browser I am trying to access using http://IP-address/audio-site I have tried several different settings based on researching this but nothing seems to work. Any assistance on what I am missing would be appreciated. Thanks much, J apache2 share|improve this question asked May 8 '15 at 21:14 Jason 612 This is duplicate. See here –Doug Smythies May 8 '15 at 21:26 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote That's not how virtual hosts work, I'm afraid ;) Virtual hosts are used to host multiple independent sites on the same web server. "Back in the day", one machine hosted one website under one address. Say, your webserver hosts the website "www.my-site.tld". The files for that site (html, css, javascript, images, scripts, ...) are stored at /var/www/. Therefore, in the Apache config the DocumentRoot would be set to that directory, /var/www/. If you now pointed your browser to http://www.my-site.tld/welcome.html, it'd display the file /var/www/welcome.html. To structure your site, you could use subfolders. So, for example, if you pointed your browser to http://www.my-site.tld/holidays/summer2001.html, it