I want to redirect to a maintenance page when my apache server is down.I tried through
htacess
and nothing worked.. Please direct me to some working blog.
Thanks...
The .htaccess file contains no executable program code to do some activities. If you want to show a webpage then you need a running webserver. If you have no one bad luck.
Take a look at this post about the technicel enviroment to reach your goal.
Edit: I found another post about this topic, though the same thing is the use of an additional webserver.
Related
So, I just set up a brand new VPS, installed LAMP, all systems and services working.
I've tried almost everything I could find here on Stack Overflow and other guides, ranging from adding things to Apache's default.conf, to including almost every possible directive in .htaccess known to man (though I hear I technically don't need to use .htaccess, since I have root access?).
I do know that .htaccess is working because I can successfully used DirectoryIndex.
Not sure if relevant, I am using PHP 7.0.
If anyone needs more specific information, I can quickly find it. I really want SSI to be working!
Thanks!
I figured it out finally, for some reason I stumbled upon an entirely different SO thread which had the answer.
I never enabled include.
SOLUTION: a2enmod include.
For months we have been struggling with a weird issue on 1 of our Wordpress Network installations. We have 4 installations on 1 VPS and only one of the four installations generates this error.
The problem is that pages on all sites that run on that Wordpress Network installation, randomly(?) seem to try and parse the page as being RSS content. See this screenshot:
Full image
This only happens once per session (if it does at all) and after refreshing the page, all is good. This makes it extremely hard to fix, because debugging is almost impossible.
Whenever the issue seems to appear, the (RSS) content that is being displayed, is that of a different page..
Could this be a Wordpress issue, or could this be an issue in the Apache config?
Some domains we are encountering this on:
http://www.skynetsg.co.za/
http://www.workplacestrategies.co.za/
http://www.beachbreaks.co.za/
I hope there is someone that could help me solve this issue!
Update:
I just had the issue on the page: http://www.skynetsg.co.za/peter-sserwanga/ that was newly created. I checked the apache logs and they show nothing strange, just a 200 OK header..
Below is a link that may fix your problem. If your running WHM/Cpanel, you may have to recompile apache with out certain modules.
rss-feed-displayed-instead-of-html-page
I am setting up a pre-built website built in php. The site was actually hosted on the linux server. Now I am trying to set it up on a Window machine with WAMP server. In this website almost every page request passes through a particular file called redirect(which is basically a php file without extension).
Now the problem is that when I inspected the configuration(httpd.conf, apache.conf,.htaccess, vhost.conf etc) of the apache server on the linux machine, I nowhere found the redirect rules for doing so. Neither mod_rewrite nor mod_alias rules for this redirection were found there. But is still redirects the request properly. I also noticed that Zend Framework library is there in the exact same directory where the redirect file is. This library is included in the include_path in php.ini. However, the web site is still not developed using Zend MVC and I have seen NO proof of ZEND being used there.
So I am really confused how this redirection is working there? I am unable to set up this on window machine without rewrite rules of mod_rewrite or mod_alias. Do you guys know any alternative of both the said modules for redirection?
I know the site is really weird, but i have to set it up. :)
Thanks in advance for your help.
I found the answer!!! :)
It was NGINX being used as Web Server Proxy before the request get passed to Apache daemon. So , there was NO redirect rules using mod_alias or mod_rewrite modules of Apache. The rule was written in configuration of NGINX.
It was really hard for me to find out this because the application was setup by somebody elsea and I had to fix that application. :)
Any how problem is resolved!!!!!! :)
I just installed MediaWiki on a website and I am having some problems.
Whenever I go to "www.something.com/wikidir" the server gives me the PHP index file as an unnamed download instead of displaying it.
However, if I go to "www.something.com/wikidir/index.php" everything works as expected.
I'm not familiar with Apache and was wondering if someone could tell me how to fix this or point me in the right direction?
I'm using a LAMP stack and Mediawiki 1.7.1 (old I know).
In my .htacces file I have:
AddType application/x-httpd-php5 .php
Sounds like Apache (or PHP?) is serving the page as an application/octet-stream. You can check this by looking at the response headers on the non-index.php page. Firefox can do this using the Web Developer Toolbar > Information > View Response Headers. Look for "Content-Type"
Or, Does the non-index.php link work in IE? Does it go straight to download in Firefox (or another browser)? If the answer is yes, that's the problem.
How to fix it is more complex because there could be a bunch of different things that are causing this. My guess is that's it's an Apache config issue.
Edit
Check your .htaccess file. Make sure it's readable by Apache. I bet that's the issue.
I just upgraded my browser to Safari 4 and find that our website is having some major issues specific to that browser version. As I click through pages on our site it takes one or two clicks before the browser window simply goes blank. When the window goes blank, there is no source to view and no matter how many times I try to reload or if I try to load other pages of the site, I still get the blank window. It's as if the server takes the request and simply returns a blank page.
If I wait over 15 seconds and then hit refresh again, the page loads fine. Not sure why it starts working again... Maybe a cache issue???
It's a PHP site and I've tried turning on error_reporting(E_ALL);, but that doesn't give any information. I also tried putting an echo statement at the very beginning of the index.php file and verified that the page still goes blank without echoing that statement, so I'm thinking the problem is not php code specific. The Apache error log does not show any issues. I have the same site on my local development server and it doesn't have the problem.
Safari 4 is the only browser that shows this problem. Does anyone have any ideas how to debug/fix this?
My webserver is ubuntu Hardy running Apache 2 an Mysql 5.
We have an nginx load balancer in front of the apache server and I just figured out that Safari 4 requires the nginx keepalive_timeout setting to be 0. Took all day to figure that one out...
I've been having the same issue with Safari 4 on my site but found that when reloading pages that return blanks, the request never even makes it to the server. No entry shows up in Apache's logs.
The keepalive setting for your LB sounds like a direction I could sniff in. Not sure what leeway I will have though, being on shared hosting.
Mike
This looks to be a safari bug. We experience it too, and I have read other reports.
http://discussions.apple.com/thread.jspa?threadID=2064488&start=0&tstart=0