Friday, 9 January 2009

Make a redundant load balanced web or db server

OK, a clustered web server is not the same as a Beowulf (I never said it was).
However both projects can share practices such as diskless booting, BOOTP, DHCP (with fixed IPs for server MAC addresses) and so on. One thing I want to implement now is to have a service, such as mysqld or apache, on more than one node, with a load balancer (which also has a redundant node) serving requests on one incoming IP.

This can be acheived with UltraMonkey and heartbeat:

http://www.debianhelp.co.uk/ultramonkey.htm

Labels: , , , , , , , , , ,

Monday, 5 January 2009

Howto make your server highly available

Setting up a highly available NFS server (5 pages)
http://www.howtoforge.com/high_availability_nfs_drbd_heartbeat

Mirror Your Web Site With rsync (2 pages)
http://www.howtoforge.com/mirroring_with_rsync

How To Set Up A Loadbalanced High-Availability Apache Cluster (4 pages)
http://www.howtoforge.com/high_availability_loadbalanced_apache_cluster

How To Set Up A Load-Balanced MySQL Cluster (8 pages)
http://www.howtoforge.com/loadbalanced_mysql_cluster_debian

How To Set Up Database Replication In MySQL (2 pages)
http://www.howtoforge.com/mysql_database_replication

Labels: , , , , , , , , , ,

Sunday, 3 August 2008

RaQ::Security - htaccess

Another article I found from www.raqpak.com (site offline)

htaccess & directory security
HowTo secure your folders


There are a lot of posts to do with .htaccess file and how to use them correctly on Cobalt Raq products.

The most noted problem is the authentication actually seems to allow anyone whos registered with the RaQ to get behind the secured area. This is only true if the file hasn't been configured correctly, as when set correctly it will read only the users specified in the .htpasswd file as per any normal configuration.

Create the .htaccess file as follows:

# Access file
order allow,deny
allow from all
require valid-user
AuthPAM_Enabled off
Authname "My Secure Directory"
Authtype Basic
AuthUserFile /home/sites/home/path/to/.htpasswd


This is the same as any standard .htaccess except it includes the AUTHPAM setting, this is because Apache on the RaQ's have been compiled with PAM (Pluggable Authentication Module) support, and so will authenticate via the system if it cannot authenticate via the password file.

Create the htpasswd file in the usual way:
htpasswd -c /home/sites/home/path/to/.htpasswd myuser
And type the password in.

Labels: , , , , , , , , ,

Tuesday, 22 July 2008

Apache, MySQL and PHP (AMP Servers)

What is an AMP server? (also known as LAMP, WAMP, XAMPP...)
As the title suggests, Apache, MySQL and PHP (or sometimes PERL) running together make an AMP server. LAMP suggests that they are running on a Linux platform, WAMP denotes a Windows server and XAMPP is a package that can be used to setup an AMP server on Apple's OS X.

Apache is a web server
MySQL is a database engine
PHP & PERL are scripting languages typically used on web servers.

Whilst PERL (Practical Extraction and Reporting Language) is a very mature and powerful language, novice programmers may find it difficult to start with. PHP on the other hand, was intentionally written with the novice developer in mind, deliberately making it easy for novices to create web pages and applications. It has also matured, and supports Object Oriented Programming concepts, such as classes, Inheritance and so on, has a clean looking syntax resembling C/C++ (simmilar comments, and bracing styles).

It does upset some OO purists as in keeping with PHP's 'lets keep things simple for the webbie' approach meant it has done things in a way that might not be considered 'true'. For example, it is not a strongly typed language, and it recently changed its default behaviour for passing by value and passing by reference.

If none of that made any sense to you, don't worry!! You could start out with PHP writing things in a procedural style, and find that as your skills develop, you will discover that PHP can grow with you, and you can begin to adopt the OOP style.
(Object Oriented Programming, vs Procedural style.)

Now this post is deliberately short, and meant as an introduction to new users. There are other alternative databases, webservers, and scripting languages, and I am not suggesting they cannot be used instead. In fact, the concepts which apply to an AMP server could equally apply to IIS, PoorMan, Lighthttpd, PostgreSQL, Oracle, SQL server, and so on - feel free to experiment and find what works best for you! =)

The reason for covering AMP servers is that I use them myself, and they form the fundamental basis from which I create my sites and applications. When I cover the topics in more detail, I will most likely use AMP projects in the examples. By keeping to a common platform in this way, I only need to explain the basics once - and can focus on writing about the concepts, instead of the differences between all the competing technologies.

Labels: , , , , , , , , , , ,