LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-03-2010, 03:23 AM   #1
Winanjaya
Member
 
Registered: Sep 2003
Posts: 239

Rep: Reputation: 32
only allow user access my web-server on working hours


Hello All,

I only allow my users to access my web-server (apache) on working hours (mon to fri and 08:00 to 17:00).. how to configure my Apache?

any help is appreciated .. thanks
 
Old 08-03-2010, 03:31 AM   #2
carlmarshall
Member
 
Registered: Jan 2004
Location: North Yorkshire, UK
Distribution: Centos 5
Posts: 133

Rep: Reputation: 16
Hi to you too.

I don't think there's anything in apache which would allow limited access by time. We have the situation on one of our web servers when we don't allow access to users as the system is gathering a large amount of data via FTP and then inserting it into an SQL database which is used by the web server.

To do this we simply use cron to stop and start the httpd daemon at the required times. In our case, the script file to stop the httpd daemon also triggers the FTP process, but the restart is done via another crontab entry having allowed plenty of time for the FTP routines to complete.

Carl.
 
Old 08-03-2010, 03:55 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can use mod_rewrite to forbid access at non-working hours:
Code:
RewriteEngine on

RewriteCond  %{TIME_HOUR}%{TIME_MIN} >0000
RewriteCond  %{TIME_HOUR}%{TIME_MIN} <0800
RewriteRule  (.*) - [F]
RewriteCond  %{TIME_HOUR}%{TIME_MIN} >1700
RewriteCond  %{TIME_HOUR}%{TIME_MIN} <2359
RewriteRule  (.*) - [F]

Last edited by bathory; 08-03-2010 at 04:01 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
after port forwarding to web server, lan user cant access by typing www via browser shio Linux - Networking 6 02-24-2008 10:38 AM
blocking the user from download between working hours using squid nesargha Linux - Security 5 05-20-2006 08:10 PM
Web Server to able to Access by Authorise User. Kitara Red Hat 0 06-04-2004 01:52 PM
Can't access Linux web server web pages from LAN client jaydave Linux - Networking 4 03-16-2003 02:38 AM
Web page user access Cristian Negres Linux - Newbie 2 01-05-2002 12:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration