Archive for the 'Linux' Category

FTP support for Joomla 1.5 on SUSE 10

You may have noticed that if you do a new SUSE 10 install, you don’t get a good old FTP server by default anymore.  This is probably just the way things are going with FTP being somewhat insecure.  These days, you get SFTP and I think some hosting companies are starting to move this direction as well.  That is well and good unless you have some legacy need for FTP.  Here at work I have dozens of old batch processes that send data between Linux servers and the IBM mainframe via old school FTP.  Another example is Joomla 1.5 which pretty much requires FTP to manage installation of components and plugins.  I had a difficult time getting regular old FTP running right on SUSE 10 but finally figured it out with help from Ferdy Christant in an article I found.  I only needed a few extra steps to make the FTP account play nice with the web server:

Installation:

The nice thing with SUSE is installing software is easy with YaST like so from the console:

yast -i vsftpd

It will launch the text based YaST installer.  You can also do this from X Windows by choosing the “Install Software” option from the Computer button in the bottom left corner.

Permissions:

Permissions are so fun, I just love them, don’t you?  The key here is that you need to make sure that whatever group your ftp user belongs to has rights to the folder where you want them to upload files.  Additionally, your web server needs some write access to the Joomla folder as well.  Otherwise Joomla won’t be able to edit configuration files after you make changes in the Joomla Administrator?  I did this by creating a “web” group which I made the web server account “nobody” AND the ftp account I created called “ftpadmin” members. I created my ftpadmin account like so:

useradd -g web -d /srv/www ftpadmin
passwd ftpadmin

First we add the new user “ftpadmin” and at the same time we add the user to the group “web”.  Next we set the passwd for user ftpadmin with the passwd command.  Then you must set the group membership of your web servers folder to the “web” group and give group membership write access.  In my case it was:

chown -R web /srv/www
chmod -R g+w /srv/www

We need to make sure that the /etc/group file has the proper membership setup for BOTH the account apache is running as and your new ftpadmin account.  ftpadmin should already be listed properly from when we created the account.  Regardless is should look something like this:

web:x:1000:nobody,ftpadmin

The value 1000 will depend on your own system, however, you need to add the users “nobody” and “ftpadmin” as I have.  Also, “nobody” is the account my web server runs as, it may be different on your own server.  Just use whatever account apache is running as.

The last step is to configure the /etc/vsftpd.conf file.  There are only a few changes you need to make to the default configuration file:

write_enable=YES
local_enable=YES
anonymous_enable=NO
write_enable=YES

Save your changes and restart VSFTPD with:

/etc/rc.d/vsftpd restart

At this point, you should have a working ftp install and when you configure Joomla, just provide it the ftp account information for “ftpadmin” and you should now be in business and able to install components and manage files using the Joomla Administrator.