10 Free Scripts to Create Your Own Url Shortening Service

Since the popularity of Twitter started to rise and the 140 characters mania began, there has been an outburst of Url shortening services which allow you to sqeeze a long url in the given limited space. There are many url shortening services out there which are both free and easy to use. There is no […]

How to install Cacti on Debian or Ubuntu

Cacti is a web based PHP/MySql graphing solution using the RRDtool engine. Classically, it can graph network bandwidthes with SNMP. But in fact, a lot of different graphs can be done with snmp, shell or perl scripts. Cacti’s strength lies in the fact that it can be installed and used incredibly easily. You don’t need […]

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 […]

PCI Audit Remediation for TRACE and TRACK issues on apache

PCI Audits often reveal TRACE & TRACK as issues that must be handled before the website can be considered PCI compliant. If you are running apache 2.x, the following directives will disable TRACE & TRACK functionality. This change needs to be made in /etc/httpd/conf/httpd.conf:ServerTokens OSTraceEnable OFF The Mod_rewrite directives below need to be added to […]

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 […]

Linux Shell Script backup web apache httpd content

# THE FOLLOWING DIRECTORIES MUST EXIST# /var/backup# /var/backup/www # GATHER WEB FILEStar -cvf /var/backup/www/html.tar /var/www/html/ # COMPRESS ALL INFOgzip -f /var/backup/www/html.tar # TO AUTOMATE, COPY TO WEEKLY CRONTAB (without # sign)# cp /root/bin/wwwbak.sh /etc/cron.weekly/

Set Apache Password Protected Directories With .htaccess File

There are many ways you can password protect directories under Apache web server. This is important to keep your file privates from both unauthorized users and search engines (when you do not want to get your data indexed). Here you will see the basics of password protecting a directory on your server. You can use […]