Archive for the ‘Lenny’ Category.
3 January 2011, 03:36
We can utilize the power (.. or lack?) of mod_rewrite in Apache2 to dynamically add subdomains for all subdirectories in a certain folder. I cannot recall where i first read how to do this, but all creds goes to someone on the Internet! Also, this only works “out-of-the-box” for Debian Lenny running latest stable version of Apache2, but it should work on all systems running Apache2, with slight modification.
First we need to enable some modules:
a2enmod rewrite vhost_alias
/etc/init.d/apache2 restart
Next up we do some rewrite magic, you need to change some paths and domains to reflect your setup, personally I just use some search and replace in nano to reflect whatever domain and site I’m setting up.
<VirtualHost *:80>
ServerName eksempel.no
ServerAlias *.eksempel.no #wildcard catch all
VirtualDocumentRoot /var/www/%1
UseCanonicalName Off
IndexOptions FancyIndexing
### Use mod_rewrite to direct eksempel.no to www.eksempel.no
RewriteEngine On
RewriteCond %{HTTP_HOST} ^eksempel.no
RewriteRule (.*) http://www.%{HTTP_HOST}$1 [R=301,L]
### Logging
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /var/log/apache2/access_log_eksempel combined
<Directory /var/www>
AllowOverride None
</Directory>
</VirtualHost>
You must also restart Apache2 for your changes to apply.
/etc/init.d/apache2 restart
21 August 2010, 01:21
Rdiff-backup is a small nifty python-based incremental backup software. Rdiff is similar to rsync, but adds support for incremental and revision-based backup. This way you can keep, in this example, up to 14 days of changes. Rdiff-backup also differs (!) from rsnapshot as it only stores the changes over time of a certain file, and this saves you a lot of storage. It’s extremely usable for database-backups, as they tend to change little but grow huge.
You might have to do small adjustments to stuff like users and parent directory. In this guide i use /root/ as parent directory for most actions, and all commands should work then.
Continue reading ‘Using rdiff-backup to keep your files safe and secure!’ »
14 March 2010, 06:20
In this article I will focus on how to squeeze (No, not the SID/testing release of Debian) the last drop of juice from your Apache2-installation with small measurements, focusing on PHP performance. And if you’re really serious you might want to look into my articles about Varnish as well! Welcome to the world of caching dynamic data! Not really, just some parts of it… Continue reading ‘Benchmarking opcode php-cachers with Apache2 on Debian Lenny’ »
Tags:
apache2,
apc,
Cache,
eaccelerator,
memcache,
php5,
php5-memcache,
scale,
xcache Category:
Cache,
Debian,
Lenny,
Linux,
how-to |
2 Comments
12 March 2010, 00:49
In this article i will i will focus on how to install, configure and setup Nginx. Nginx is a popular web server, load balancer and reverse caching proxy for many high traffic sites. Personally I prefer to use Apache2 with proper configuration and Varnish as frontend. In some cases you might want to use Nginx as frontend for compressing data after it has been received from the backend server, either to ease the load on the backend servers or because the backeds does not support this feature, as is the case with Varnish. Continue reading ‘Setting up nginx on Debian Lenny’ »
Tags:
build,
Debian,
how-to,
Lenny,
Nginx,
scale,
source,
static Category:
Debian,
Lenny,
Linux,
Nginx,
how-to |
Comment
1 March 2010, 22:49
Update 12.2001: Varnish-software.com now offers an official debian repo, you should use that instead of installing it via source. Check www.varnish-software.com for more information!
Due to the strict rules of Debian many of the packages in stable releases are very old. In some cases though we want to run the latest version of a program, mainly due to new features and increased speed. The latest version of Varnish under Debian Lenny’s repositories is 1.1.2 (apt-cache show varnish), but in most cases we’d want to run the latest, especially with rapidly developed programs like Varnish. Varnish 2.0.6 is alos available in the Debian repository for SID/Squeeze or via backports.
Continue reading ‘Setting up Varnish 2.0.6 on Debian Lenny’ »
Tags:
build,
Cache,
Debian,
how-to,
Lenny,
scale,
source,
Varnish Category:
Debian,
Lenny,
Linux,
Varnish,
how-to |
2 Comments