Jorge Albaladejo

Hard & Soft design…

Archive for the ‘SysAdmin’ Category

FTP server on Ubuntu

without comments

I write this post more as a reminder for myself than as a generic tutorial. Anyway, it is about a precise FTP server configuration on Ubuntu that might or might not be useful for other people. It is just useful in the environment I am using (web server, just one Unix user, some FTP accounts). Here we go:

The server that I’ve used in several cases, and which I prefer just because it is simple enough to have it running quickly, is VSFTP (Very Simple FTP). It works in integration with the machine’s users so that we only need to add users to the server in order to have them available for the FTP daemon.  Once the server is installed, a few configurations must be done. In file /etc/vsftpd.conf:

Read the rest of this entry »

Written by Jorge Albaladejo

July 6th, 2010 at 9:12 pm

Start a service or execute a script on boot on Ubuntu/Fedora

without comments

I have a couple of servers with different Linux distributions (Ubuntu/Fedora) on my hands, which normally work continuously well. However, from time to time they reboot as they are hosted in a shared farm of virtual servers. It was in the first of those reboots when we noticed that neither Apache, neither MySQL servers were automatically launched on start-up, which should be the default configuration in an environment like ours.

So, I’d like to add another new trick to my the knowledge pool, which I expect to be useful for others as well: how to configure scripts and services to run after the system boots?

Read the rest of this entry »

Written by Jorge Albaladejo

May 27th, 2010 at 8:25 pm

Posted in SysAdmin

Tagged with , , , ,

Tunneling a multipart POST message through PHP and CURL

without comments

In this post I’m going to cover a particular solution to a given problem we’ve faced up in our last project. Let’s set the background: there is a complex web application under development on a shared virtual machine, installed on a subdomain of a public network that will change when going to production. We have also a commercial website hosted in a shared server under a domain that should not change, since it is our first step out of this virtual farm.

For this project, we require to integrate some cameras which send pictures via GPRS connections to the server, and we want to provide some user authentication to avoid having anybody posting whatever to this web service. So, we have developed a controller in Code Igniter which gets a camera ID / password from POST, and also the bytes for the image, and proceeds to do some filtering. For instance, camera ID and password should match with the values previously registered in the database, and the picture should be MIME image/jpeg, with a limit of 2MBs. Up to now, nothing special, tested and working with POSTS from the within the website.

The problem came when we found out that cameras only allow to send their information to a root domain, to a particular file, let’s say upload.php. So, we would only need to put this file in the root path and it’s done. Unfortunately, doing so in the application virtual server would result on flashing again all the cameras once we move to a new server and set up a final domain name. We might be able to install this receiver in the commercial website root path, but then we would require to send the message back to the application server in any way, so it is not the best solution we want to solve this issue.

‘Just add a domain that points to this subdomain and you are done’ would you say. Well, yes, that would have done the trick. Unfortunately, we cannot host this domain in the machine since we have no administrator rights on the servers farm. Nor can we just use this external domain because it produces an HTTP redirection which, to make things worse, is not supported by the camera. We’ve even tried with cloaking the url of the receiver with an external subdomain, with no success – since cloaking wraps the real content inside an iframe and it breaks the POST message.

What a headache! it seemed there was no way to implement the system with the full functionality we wanted…

Read the rest of this entry »

Written by Jorge Albaladejo

May 5th, 2010 at 3:50 pm

Installing Trac on a Ubuntu server

without comments

Despite I’ve worked before with Trac (a well-known bug tracking system), this is the first time I’ve been in the need for installing it. This post covers in a few steps what I’ve done. Maybe in your particular case it would be helpful, maybe not. So, these are the steps…

Read the rest of this entry »

Written by Jorge Albaladejo

January 30th, 2009 at 9:11 pm

This site is protected with Urban Giraffe's plugin 'HTML Purified' and Edward Z. Yang's Powered by HTML Purifier. 7051 items have been purified.