Apache - PowerCram Blog

Securing Linux & PHP

MOD_REWRITE OVERVIEWhttp://www.sitepoint.com/article/guide-url-rewritinghttp://www.jeffdarlington.com/tag/mod_rewrite/ LINUX SECURE CONFIGhttp://aymanh.com/tips-to-secure-linux-workstation PHP SECURE CONFIGhttp://aymanh.com/checklist-for-securing-php-configuration MOD_REWRITE SCRIPTS FOR APACHESIMPLEST SET OF RULES================================================================== #Turn on mod_rewriteRewriteEngine OnRewriteOptions inheritRewriteLog “/var/log/httpd/rewrite_log” # Prevent harmful binary execution through injectionRewriteCond %{REQUEST_URI}?%{QUERY_STRING} (.*)chmod(.*) [OR]RewriteCond %{REQUEST_URI}?%{QUERY_STRING} (.*)chown(.*) [OR]RewriteCond %{REQUEST_URI}?%{QUERY_STRING} (.*)wget(.*) [OR]RewriteCond %{REQUEST_URI}?%{QUERY_STRING} (.*)cmd(.*) [OR]RewriteCond %{REQUEST_URI}?%{QUERY_STRING} (.*)cd%20(.*) [OR]RewriteCond %{REQUEST_URI}?%{QUERY_STRING} (.*)scp(.*) [OR]RewriteCond %{REQUEST_URI}?%{QUERY_STRING} (.*)curl(.*) [OR] # Disable TRACE & TRACK methodsRewriteCond %{REQUEST_METHOD} TRACE [OR]RewriteCond […]

Linux shell script backup system configuration httpd mysql apache files

# THE FOLLOWING DIRECTORIES MUST EXIST# /var/backup# /var/backup/tmp# /var/backup/conf# /var/backup/tmp/conf # GATHER SYSTEM INFORMATIONcp /etc/php.ini /var/backup/tmp/conf/php.inicp /etc/my.cnf /var/backup/tmp/conf/my.cnfcp /etc/hosts /var/backup/tmp/conf/hostsrpm -qa > /var/backup/tmp/conf/rpms # GATHER HTTPD INFORMATIONtar -cvf /var/backup/tmp/conf/etc-http-conf.tar /etc/httpd/conf/ # TAR & COMPRESS ALL INFOtar -cvf /var/backup/conf/confbak.tar /var/backup/tmp/conf/gzip -f /var/backup/conf/confbak.tar # COPY TO DAILY CRONTAB (without # sign) TO RUN EVERY DAY# cp /root/bin/confbak.sh /etc/cron.daily/ # CLEANUPrm […]