# list loaded modules/usr/sbin/apache2ctl -M
# list avaiable modulesapachectl -t -D DUMP_MODULES
# check configapache2ctl -S
a2dismod status - disable module
apachectl -V
# enable default SSL sitea2ensite default-ssl
# disable default SSL sitea2dissite default-ssl
htaccess
http://www.panticz.de/apache-htaccess
Enable mod_rewrite module
sudo a2enmod rewritecat < /etc/apache2/conf-available/allow-override.confAllowOverride all
EOF
a2enconf allow-override
service apache2 reload
Graceful restart
apachectl -k graceful
# /etc/apache2/sites-available/default fchange"AllowOverride None" to "AllowOverride All"
or the directory in which you will use the mod_rewrite module
debug mod_rewrite rules (Apache vhost config)
RewriteLogLevel 8
RewriteLog /var/log/apache2/rewrite.log
redirect all requests to SSL
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
DirectoryIndex
DirectoryIndex index.php index.php4 index.php3 index.html index.htm index.shtml
apt-get install apache2-utilsab -n 100 -c 10 http://www.google.com/ > ad.out
deny referrer
RewriteEngine on
# Options +FollowSymlinksRewriteCond %{HTTP_REFERER} ^http://.*example\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*bad-website\.com/ [NC]
RewriteRule ^(.*)$ – [F,L]
test
# echo "SetEnv REGISTER_GLOBALS 0" >> .htaccess# if this not work disable global php.ini (if you have permisions for this)#dep# sed -i 's|register_globals = ON|register globals = OFF|g' /etc/php5/apache2/php.ini
# enable mod_rewritea2enmod rewrite
service apache2 restart# change AllowOverride in /etc/apache2/sites-available/defaultfrom: AllowOverride None
to: AllowOverride All
# view php limitphp5 -i | grep memory_limit