Disable Apache’s following of Symbolic Links


Environment : APache webserver

-          By default Apache webserver follows symlinks,
-          We can turn off this feature with FollowSymLinks with Options directive.
-          Open the HTTD.conf file and add the below line.
# Options -FollowSymLinks

-          If there is a need for FollowSymLinks feature, can be enabled by writing in the rule in “.htaccess” file from that website.
# Enable symbolic links
              # Options +FollowSymLinks
Note: To enable rewrite rules inside “.htaccess” file “AllowOverride All” should be present in the main configuration globally.

How to upgrade Apache version regulaly


Environment : Apache Web server


Solution :

1.       Check the apache version by using #httpd –v
2.       Run the below command to update the version
 # yum update httpd
#apt-get install apache2
3.       That’s it!, again check for the version of apache post upgrade #httpd -v

How to Disable Directory Listing in Apache Webserver



Environment: Apache Webserver


Solution :

-       In the absence of index file by default apache server will list the default content root directories
-       We can turn off the directory listing by using Options directive in the httpd.conf or apache2.conf configuration file for any specific directory

1.       Open the Httpd.conf or apache2.conf file
Options –Indexes

2.       Restart the server
3.       Go to website and access for the content root -/var/www/html or /content
4.       You must see the Forbiden error(You don’t have permission to access/ on this sever.