Adding modules to Apache2

Discussion in 'Installation/Configuration' started by stealth, Aug 7, 2006.

  1. stealth

    stealth New Member

    I have a SUSE 10.1 server with ISPConfig, Apache2, MYSQL5,PHP5, Postfix and proftpd. I would like to know how to install the mod_access module into apache2 without breaking it.

    Thanks in advance.
     
    Last edited: Aug 7, 2006
  2. falko

    falko Super Moderator

    I think it should already be installed. Isn't it in your Apache configuration? If not, then use yast and search for an appropriate package.
     
  3. stealth

    stealth New Member

    How would I go about adding mod_access to apache2 using YAST. mod_access does not seem to be installed.
     
  4. falko

    falko Super Moderator

    Run
    Code:
    yast
    and go to Software -> Software Management and use the search function.
     
  5. stealth

    stealth New Member

    I have been unable to find mod_access using yast. Yast told me it couldn't find mod_access. It looks like the install mirror i'm using doesn't have mod_access. Does anyone know any mirrors that has mod_access on it?.
     
  6. themachine

    themachine HowtoForge Supporter

    mod_access is very standard. Are you certain this is not included already? I am not certain of where the files are located/laid out in SuSE but in RedHat it is loaded by default in '/etc/httpd/conf/httpd.conf':

    Code:
    [root@vs03 /]# cat /etc/httpd/conf/httpd.conf | grep -i mod_access
    LoadModule access_module modules/mod_access.so
    
    If you don't find it there, grep everything for it:


    Code:
    [root@vs03 /]# grep -ri "mod_access" /etc/httpd/*
    /etc/httpd/build/config_vars.mk:MOD_ACCESS_LDFLAGS =
    /etc/httpd/build/config_vars.mk:MOD_ACCESS_LIBS =
    /etc/httpd/conf/httpd.conf:LoadModule access_module modules/mod_access.so
    Binary file /etc/httpd/modules/mod_access.so matches
    

    If the configuration is not there, but the 'mod_access.so' module is, then simply add the configuration to load it:

    Code:
    LoadModule access_module </path/to/modules/dir/mod_access.so
    
     
  7. stealth

    stealth New Member

    mod_access.so file doesn't exist so I would need to install it and it doesn't appear in any config files.
     
  8. themachine

    themachine HowtoForge Supporter

    http://apache.hoxt.com/tomcat/tomcat-5/v5.5.17/bin/apache-tomcat-5.5.17-deployer.tar.gz


    I have a hard time believing that mod_access is not available... even by default. Have you tried to even use the directives for mod_access?

    Setup a basic directive to test it:

    Code:
    <Directory "/path/to/some/directory">
         Order Deny,Allow 
         Deny from all
    </Directory>
    

    After restarting Apache, acess to the Directory should be denid. If it is... Waallllaaaa mod_access is already enabled. If it doesn't, you should see something in the Error Log or even when restarting Apache.

    Otherwise... you'll need to read the documentation for SuSE as I haven't run it for a long time. Any other distro has mod_access enabled by default... so I think you may be over looking something.
     
  9. stealth

    stealth New Member

    Ok in that case mod_access is installed and working.

    I would like to have a directory on one of the virtual websites to be able deny access to the public and only allow access from the internal network. I would like to be able to do this using .htaccess file.
     
  10. falko

    falko Super Moderator

    Try this in your .htaccess file:

    Code:
    Order Deny,Allow
    Deny from all
    Allow from Allow from 192.168.0.0/255.255.255.0 
    Of course, you must change the network settings in there to your needs. :)
     

Share This Page