Tag Archives: ubuntu

Holiday with Computer Lab Setup

It’s been a long holidays in Philippines.
I was able to visit a private school in my hometown again.
Last summer, I’ve setup their Edubuntu linux lab.

The 2 servers are compose of a LDAP and a NFS which contains a centralized
storage for students and teachers. Thirty client machines are running linux
validates through LDAP server which also acts an internet gateway.
There are two more servers replicated for standby purposes.

To setup LDAP, I’ve used http://www.majen.net/smbldap.
Install it on the server and for the clients.
The NFS server is simply an ldap client which is
capable to maintaining file permissions to its filesystem
when it is accessed by students from another machine.

The NFS exported its /home dir to each client machines and running backups
at the end of the week.

Several shell scripts were made for the admin user. These includes
enable/disable internet using IPTables, smbldap change password
(wrapped using expect), mass password change for students, and
backup scripts.

It’s cool to see these Linux lab running smoothly.

Just another part of my happy holidays.

Configure Ubuntu and CentOS Webserver using Puppet

As I’m playing with the EC2 Puppet setup, here’s my simple web server in CentOS and Ubuntu puppet recipe. (need to edit more the Ubuntu installed packages ex. add php_mysql etc)

Tested in CentOS 5.0 and Ubuntu 8.04 AMI by Eric Hammond found at http://alestic.com.

class apache {
    # CentOS v.5 only
    case  $operatingsystem { 
     "CentOS":  { 
        $wantedpackages = [ "httpd","php","php-mysql","php-mcrypt","php-mhash","php-mbstring" ]
        package { $wantedpackages: 
                  ensure => installed 
        }
        service { "httpd":
                ensure => running,
                hasstatus => true,
                hasrestart => true,
                require => Package["httpd"],
                restart => true;
        }
      } 

    "Debian": { 
        # assume Debian base..
        $wantedpackages = [ "apache2" ]
        package { $wantedpackages: 
                  ensure => installed 
        }

        service { "apache2":
                hasstatus => true,
                hasrestart => true,
                ensure => running,
                require => Package["apache2"]
        }
    } 
  } # end case
} 

Obviously a web node will have the config:

node webA.sample.org {
   include apache 
}

Running it on EC2, pass a user-data script to the AMI during launch. A script that will set the hostname, adds default puppet master for the current instance and installs the puppetd. The puppetd program will then connect to the puppet server, and get all it’s needed configurations.

🙂 Thanks to Reductive labs.