Password protecting an Apache Server

If you need to protect a web server so that a folder cannot be access without entering a password first. First ensure that the option is turned on vim /etc/apache2/sites-available/default change AllowOverride None to AllowOverride All Now, create a .htaccess file AuthUserFile /var/htpasswd AuthName “Authorization Required” AuthType Basic require valid-user Instead of “valid-user”, you can […]

vim Cheat Sheet

Modes Vi has two modes insertion mode and command mode. The editor begins in command mode, where the cursor movement and text deletion and pasting occur. Insertion mode begins upon entering an insertion or change command. [ESC] returns the editor to command mode (where you can quit, for example by typing :q!). Most commands execute […]

Install s3fs on Ubuntu from SVN

s3fs mounts an Amazon AWS S3 bucket into your files system as a directory. This is fantastic for backup folders – backups are automagically off-site. Here is a better way of installing s3FS using SVN. Install Pre-requisites apt-get install build-essential libfuse-dev fuse-utils libcurl4-openssl-dev libxml2-dev mime-support Install s3fs svn checkout http://s3fs.googlecode.com/svn/trunk/ s3fsbr>cd s3fs/ autoreconf –install ./configure […]

Install MongoDB with Nginx + PHP on Ubuntu

Assuming you already have Nginx and PHP installed and want to add MongoDB support. Install pre-requisites apt-get update apt-get install php5-cli php5-common php5-suhosin php5-cgi php5-curl php5-fpm php5-json php5-mcrypt php5-mysql php5-sqlite php5-dev php-pear php-apc Enable Mongo pecl install mongo echo “extension=mongo.so” >> /etc/php5/fpm/php.ini Install MongoDB apt-get install mongodb mongodb-server Restart Services service nginx restart service php5-fpm […]

Forward all root email to an external email address

There are two easy ways of doing this. First, you could set up a forward for the root email account. All emails to root will be forwarded. `echo “you@yourmail.com” > /root/.forward` OR, Secondly, set up an alias for root as an external email address echo “root: you@yourmail.com” >> /etc/aliases && newaliases Beware that you only […]