Sign in to follow this  
Followers 0
seplomaniac

Apache Config

11 posts in this topic

I was wondering if it were possible through the apache config files to make it so on a certain date no matter which file you try to access on the server, you will be redirected to one html file. Can it be done?

0

Share this post


Link to post
Share on other sites

Replacing the httpd.conf on that date via cronjob and doing a apachectl reload would do it, just change the DocumentRoot for the host; You would need to directly use a cronjob to change the file however, its not part of apache that I know of.

0

Share this post


Link to post
Share on other sites

do a cron job to change the read access of your htdocs and set a custom 403 error doc, everything will go there

0

Share this post


Link to post
Share on other sites

damn, i dont have access to cron jobs... looks like im manually changing it at midnight...

0

Share this post


Link to post
Share on other sites

No, apache by itself does not do this (that I am aware of). The chronjob suggested is exactly how I would do it as well.

Since you do not have access to chron on this box, you COULD write a script on ANOTHER box to FTP the new apache.conf file over to the server and schedule THAT job to run at midnight. This would have to be set to overwrite your file but it would end up accomplishing the same thing.

Make sure you have a backup of the original file beforehand though. :voteyes:

0

Share this post


Link to post
Share on other sites

could try this,

in your .htaccess file, add a deny everything and set an errordocument 403 to a specific file

0

Share this post


Link to post
Share on other sites

How in the hell does one have access to the apache.conf file but not have cron access?

0

Share this post


Link to post
Share on other sites

i assumed by apache conf files he meant .htaccess rather than httpd.conf. if he has access to all apache config files then he should have access to cron

0

Share this post


Link to post
Share on other sites
i assumed by apache conf files he meant .htaccess rather than httpd.conf. if he has access to all apache config files then he should have access to cron

Correct.

0

Share this post


Link to post
Share on other sites
No, apache by itself does not do this (that I am aware of). The chronjob suggested is exactly how I would do it as well.

Since you do not have access to chron on this box, you COULD write a script on ANOTHER box to FTP the new apache.conf file over to the server and schedule THAT job to run at midnight. This would have to be set to overwrite your file but it would end up accomplishing the same thing.

Make sure you have a backup of the original file beforehand though. :voteyes:

Hmmm, I like this idea...

0

Share this post


Link to post
Share on other sites

i actually did some testing and this works

the entire website is shut down and all you get is one specific page

i created a .htaccess file, in this file i had 2 directives

Deny From All

ErrorDocument 403 index.html

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0