Re: Webhosts and Webserver Gurus: Is this possible or impossible?
You can do it in the httpd.conf file. You do it just like in the .htaccess file, but you have to specify the directory:
Originally posted by netline5000
[B]Rather than having customers setup .htaccess files in their individual 'padlock' directories, is it possible to setup the webserver to automatically setup 'hostwide' access blocking 'padlock' directories on all accounts without using .htaccess.
Thereby eliminating the performance slowdown associated with individual .htaccess files.
Deny from all
Allow from 188.8.131.52
Something like that. Fiddle with the orders of the denies and allows so that it works the way you want it to.
public_html and cgi-bin directories aren't automatically created by default unless you're using a control panel that does it for you. You'll need to modify your adduser script (linux, CP, your own, wherever) to create the padlock directory for the user. You'll then need to add the appropriate lines to httpd.conf for that padlock directory.
Hence how are cgi-bin and public_html directories automatically created for all hosting accounts without the customer creating themselves? Isn't it possible to use the same process to automatically create a 'Padlock' directory for all hosting accounts but with the same restricted access to certain IP addresses?
Unless you plan on binding the padlock concept to a control panel the user can use, I would personally use .htaccess, in case the user needs to access that directory while using another IP (traveling, for instance). They can then just change the values in that file instead of contacting you.
Hope that helps!
Professional Server Management