Posts Tagged: Apache

Apache restrict access based on IP address to selected directories

apacheApache web server allows server access based upon various conditions. For example you just want to restrict access to url http://subdomain.domain.com/ (mapped to /var/www/subdomain directory) from 192.168.1.0/24 network (within intranet).

Apache provides access control based on client hostname, IP address, or other characteristics of the client request using mod_access module.

Continue reading

How to use different user and group for just one Virtual Host in Apache

apacheWith the mpm-itk that is a multi-processing module (MPM) you can run each virtualhost with it’s own user id and group id. This is basically used to make a shared hosting secured, since you don’t have to make all virtualhosts folders readeable by apache user.

mpm-itk is based on the traditional prefork MPM, which means it’s non-threaded; in short, this means you can run non-thread-aware code (like many PHP extensions) without problems.

Continue reading

How to disable apache logs

apacheTo disable apache logs (access and error log) to avoid excessive writes on local server just open your /etc/apache2/apache2.conf file and change the following two configurations:

Change the ErrorLog to:

ErrorLog /dev/null

Now, open /etc/apache2/conf.d/other-vhosts-access-log and comment the following line

#CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

In addition, you might have to change these files:

/etc/apache2/sites-available/default-ssl

/etc/apache2/sites-available/default

and change the ErrorLog and comment out the CustomLog:

ErrorLog /dev/null

#CustomLog ${APACHE_LOG_DIR}/access.log combined

If you have more VirtualHosts, you need to make the same configuration for them.

Source; lleess