1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 How can I create a Firewall for protection Control admin ?

Discussion in 'XenForo Questions and Support' started by Qaseem, Aug 18, 2013.

  1. Qaseem

    Qaseem Member

    I know how to create Firewall
    But I do not know the name of the folder to be laid on him the Firewall
    Please indicate the name of the folder only
  2. Amaury

    Amaury Well-Known Member

    Probably requires a resource.
  3. Tracy Perry

    Tracy Perry Well-Known Member

    For password protecting it do the below. You will need to create an htaccess password file, put it in a directory that is not available to be browsed to and then use that path for the below.

    In nginx, in your vhost file in the above the base Location / directive you need to place
    location ~/admin\.php$ {
        allow XXX.XXX.XXX;
        deny all;.
        auth_basic "Administrator Login";
        auth_basic_user_file /path/to/your/password_file;
        root /path/to/root/forum/directory;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME
        include /etc/nginx/fastcgi_params;
    In Apache2 it would be defined in your .htaccess
    <Files admin.php>
        AuthType Basic
        AuthName "Protected Access"
        AuthUserFile /path/to/your/htaccess.pwd.file
        Require valid-user
    Order deny, allow
    Deny from all
    Allow from XXX.XXX.XXX
    There is also a way to do it by IP in htaccess, but I'd have to look that up since I don't use it.

    EDIT: I have placed code in both the nginx and Apache2 directives. I know that the nginx one works. I think the above Apache 2 IP stuff will work, where XXX.XXX.XXX is your IP address.
    Last edited: Aug 18, 2013
    Qaseem and Sheratan like this.
  4. Brogan

    Brogan XenForo Moderator Staff Member

Share This Page