Results 1 to 2 of 2
  1. #1

    Webhosts and Webserver Gurus: Is this possible or impossible?

    Is this possible?

    I want all my hosting customers to have a directory (let call it 'padlock') under the public_html directory, that only allows access from a list of domains/ipaddresses.

    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.

    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?

    Thanks in advance?

  2. #2
    Join Date
    Apr 2001
    Location
    Palm Beach, FL
    Posts
    1,095

    Re: Webhosts and Webserver Gurus: Is this possible or impossible?

    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.
    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:

    <Directory "/home/pablo/public_html/padlock">
    Order allow,deny
    Deny from all
    Allow from 1.2.3.4
    </Directory>

    Something like that. Fiddle with the orders of the denies and allows so that it works the way you want it to.


    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?
    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.

    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!
    Alex Llera
    Professional Server Management
    FreeBSD|Linux|HSphere|Cpanel|Plesk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •