Ubuntu Server – Very Quick FTP Setup

ubuntu-server-logo

To get an FTP daemon running on Ubuntu Server we will install vsftpd (Very Secure FTP Daemon) as follows:

sudo apt-get update
sudo apt-get install vsftpd

The next step is to configure vsftpd by editing the /etc/vsftpd.conf file. Issue the following commands to install the nano editor (if you haven’t installed it before) and edit the file:

sudo apt-get install nano
sudo nano /etc/vsftpd.conf

The basic configuration of vsftpd.conf involves simple editing and un-commenting of the existing parameters:

Un-commenting is the removal of the # sign from the start of a line. For example changing #local_enable=YES to local_enable=YES (which we will do later).

  • To disable anonymous access change anonymous_enable=YES to anonymous_enable=NO.
  • Un-comment #local_enable=YES to allow local users to login to the FTP server.
  • Un-comment #write_enable=YES if you want users to be able to upload to the FTP server.

Vsftp.conf contains an explanation of its parameters – so it should be relatively self-explanatory if you wish to configure other options.

The final step is to restart the vsftp daemon. On older Ubuntu servers you will probably use sudo /etc/init.d/vsftpd restart but a more recent installation will prefer:

sudo service vsftpd restart

Enjoy!

ViMP – Upgrading From Version 2.2.x to 2.5 (Ubuntu Server 10.4 Lucid)

Yesterday I finally upgraded ViMP Community Edition to 2.2.x and so today I am upgrading to 2.5.x.

At the time of writing the latest version of ViMP is vimp.framework-2.5.4-r19900-community.tar.gz – which can be downloaded from here.

For clarification my system variables are as follows (obviously you may need to change them if yours are different):

  • ViMP installation directory – /var/www/showvid/data/
  • MySQL user – root
  • MySQL ViMP database – showvid

The upgrade process was as follows.

First backup the ViMP directory and copy the ViMP tarball to your server.

Copy the tarball to /var/www/showvid/data:

sudo cp vimp.framework-2.5.4-r19900-community.tar.gz 
/var/www/showvid/data/

Change directory to /var/www/showvid/data/:

cd /var/www/showvid/data/

Extract the vimp-framework tarball:

sudo tar xvzf vimp.framework-2.5.4-r19900-community.tar.gz

Delete lib/auth/stAuthProvider.php

cd /lib/auth/
sudo rm stAuthProvider.php

Next we need to run the data/sql/updates.sql file from the ViMP tarball – make sure that you extract the tarball on your computer so that you can import it to your server.

Note: there are other .sql files in the sql folder but they are only used if you have modules installed etc.

Updates.sql can be run from the command line but I found it easier to use phpmyadmin – which can be installed as follows:

sudo apt-get install phpmyadmin

I selected Apache2 as the webserver to reconfigure and then selected No to configure a database for phpmyadmin. Open a browser and open phpmyadmin on your ViMP server: http:\\<server-ip>\phpmyadmin. Log in with root and your mysql password.

Select the showvid database in the left hand panel and then click the import tab. Click the Browse button and select updates.sql in the data/sql folder. Then click the Go button.

Finally change directory to /var/www/showvid/data and rebuild the ViMP installation:

sudo ./symfony rebuild
sudo ./symfony i18:import

I did get an error when I imported updates.sql but ViMP did successfully upgrade.

ViMP – Upgrading From Version 2.1.x to 2.2 (Ubuntu Server 10.4 Lucid)

This post has been in my drafts folder for about a year as I had an unresolved issue trying to upgrade to ViMP version 2.2x. I finally had time to look at it again today and everything went smoothly – and I can’t remember what I did differently when it was not working. Note that I do not have any modules installed in ViMP and so I am not covering how to upgrade them (see here).

For clarification my system variables are as follows (obviously you may need to change them if yours are different):

  • ViMP installation directory – /var/www/showvid/data/
  • MySQL user – root
  • MySQL ViMP database – showvid

The upgrade process was as follows.

First I updated my Ubuntu 10.4 Server:

sudo apt-get update
sudo apt-get upgrade

Next backup the ViMP directory and then download vimp.framework-2.2.1-r19622-community.tar.gz from here.

Copy vimp.2.2.1 to the home directory of your ViMP server and then copy it from the home directory to /var/www/showvid/data:

sudo cp vimp.framework-2.2.1-r19622-community.tar.gz 
/var/www/showvid/data/

Change directory to /var/www/showvid/data/:

cd /var/www/showvid/data/

Delete the lib directory:

sudo rm -Rf lib/

Change directory to config:

cd config/

Delete databases.yml and propel.ini:

sudo rm databases.yml
sudo rm propel.ini

Return to the data directory and delete the contents of the cache directory:

cd ..
sudo rm -Rf cache/*

Extract the vimp-framework tarball:

sudo tar xvzf vimp.framework-2.2.1-r19622-community.tar.gz

Configure the showvid database and rebuild the ViMP installation:

sudo ./symfony configure:database mysql://DBUSER:DBPASSWORD@localhost
/DBNAME
sudo ./symfony rebuild
sudo ./symfony i18:import

Here my DBUSER is root and DBNAME is showvid.

Now that I have finally upgraded to 2.2.1 I can start work on upgrading to 2.5.x!

Ubuntu Server – Configuring Exim4 to Send Email Via Gmail

I am in the midst of trying to get Kaltura to work on Ubuntu 10.4 but am experiencing an error that is a bit of a show stopper.

The good news is that I needed to configure Exim4 to send email via Gmail – and that is what this post is about.

First install Exim4:

sudo apt-get install exim4

Configure Exim with the following command:

sudo dpkg-reconfigure exim4-config

Press the down-arrow key to select mail sent by smarthost; received via SMTP or fetchmail then press Tab, followed by Enter:

Enter a system mail name – this might be your company-name.com or a dummy domain name like I used below:

Next we specify an IP address to listen for incoming SMTP connections. This field was already completed for me with the value 127.0.0.1 ; ::1

The next screen was auto-completed with my host-name (which I had previously edited in /etc/hosts). The guide that I followed said to leave this blank but I left it as it was:

I left the Machines to relay for blank:

Select No don’t Hide local mail name in outgoing mail:

Select No to Keep number of DNS-queries minimal (Dial on-Demand):

For Delivery method for local mail choose mbox format in /var/mail/:

For Split configuration into small files select No:

Now we need to make several changes to the configuration to Exim4 in the file etc/exim4/exim4.conf.template:

sudo nano etc/exim4/exim4.conf.template

Find the line .ifdef DCconfig_smarthost DCconfig_satellite and add the following in that section (you can press Ctrl + W to search in nano):

send_via_gmail:
    driver = manualroute
    domains = ! +local_domains
    transport = gmail_smtp
    route_list = * smtp.gmail.com

The guide that I followed said to remove any other smarthost defined with domains = ! +local_domains in /etc/exim4/exim4.conf.template but I did not find any.

Next find the comment begin authenticators section and add the following:

gmail_login:
    driver = plaintext
    public_name = LOGIN
    client_send = : yourname@gmail.com : YourGmailPassword

Find the comment transport/30_exim4-config_remote_smtp_smarthost and add the following:

gmail_smtp:
    driver = smtp
    port = 587
    hosts_require_auth = $host_address
    hosts_require_tls = $host_address

Finally comment out the login section of /etc/exim4/exim4.conf.template:

#Commented out so that Gmail’s Public_name can equal “LOGIN”
#login:
# driver = plaintext
# public_name = LOGIN
#.ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
# Return empty string if not non-TLS AND looking up $host in passwd-file
# yields a non-empty string; fail otherwise.
# client_send = “<; ${if and{\
# {!eq{$tls_cipher}{}}\
# {!eq{PASSWDLINE}{}}\
# }\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}”
#.else
# Return empty string if looking up $host in passwd-file yields a
# non-empty string; fail otherwise.
# client_send = “<; ${if !eq{PASSWDLINE}{}\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}”
#.endif
#####################################################
### end auth/30_exim4-config_examples
#####################################################

Press Ctrl + O and then Enter to save and then Ctrl + X to save the file and exit nano.

Update Exim4 with the following command:

Run update-exim4.conf

Restart Exim4:

 /etc/init.d/exim4 restart

Finally test your configuration by sending an email via the command line:

mail user@example.com

Type a Subject and then press Enter.

Type a message and then press Enter.

Type a single . (dot) and then press Enter.

Press Enter again for a blank CC address.

Within a few minutes you should receive an email at the specified email address.

Sources:

http://www.manu-j.com/blog/wordpress-exim4-ubuntu-gmail-smtp/75/

http://basskozz.wordpress.com/2008/12/07/how-to-setup-a-raid5-software-mdadm-array-w-email-notifications-via-gmail-the-easy-way/ 

Ubuntu Server 10.4 Lucid – add-apt-repository: command not found

Since Ubuntu 9.10 (Karmic Koala) users have been able to add PPAs (Personal Package Archives) to install packages via the command line as follows:

sudo add-apt-repository ppa:<repository name>

Typically this works out of the box, but not with a minimal Ubuntu Server installation (such as I use in my VMware vSphere environment) which produces the following error:

sudo: add-apt-repository: command not found

The solution is to install python-software-properties:

sudo apt-get install python-software-properties

Source: Ubuntu Forum

.

Ubuntu Server 10.4 Lucid – Upgrading Feng Office (Community Edition)

It turns out that upgrading Feng Office is actually very simple. I had installed Feng Office Community Edition version 1.7.4 recently and a few days ago found out that version 1.7.5 had been released.

It is advisable to backup your current installation before upgrading.

Log in to Feng Office as Admin and then click the Administration link:

Click the Upgrade button:

Click Start automatic upgrade:

Wait a couple of minutes and then log back in to your new version of Feng Office.

Ubuntu Server 10.4 Lucid – Installing and Configuring the Feng Office Backup v1.0 Plugin

In my previous post I configured Ubuntu Server with a set of scripts and cron jobs to backup (and restore) the Feng Office installation folder and the MySQL database to a Windows share.

The Feng Office wiki mentions an alternative backup method – in the form of a plugin that can be installed and configured from the Administration panel. The current version of the backup is v1.0 and it can be downloaded from here.

The plugin does include a basic readme.txt file but it does not clearly detail the steps that are needed to install the plugin.

First you will need to have wget and unzip installed on your server:

sudo apt-get update
sudo apt-get install wget unzip

You can either download the plugin (if the version has changed since this post was written) and upload it to your Feng Office server or use wget to download the file as follows:

wget http://sourceforge.net/projects/opengoo/files/plugins/backup/
backup_1.0.zip

Extract the plugin to your Feng Office installation folder – for me this is /var/www/feng_community:

sudo unzip backup_1.0.zip -d /var/www/feng_community/

Now open a browser and log in to Feng Office as the Administrative user.

Copy and paste the following URL to install the backup plugin (replace <server-ip> with the IP address of your Feng Office server):

http://<server-ip>/feng_community/index.php?c=backup&a=install

You should now see that the plugin is successfully installed:

Click the back to opengoo link to return to Feng Office and then click the Administration link:

In the Administration Panel click the Backup icon:

Click the Launch backup process link:

Once the backup is complete you can download it to your local machine and then delete the backup from the server:

If you check the Cron Events section of the Administration Panel you will see that the backup plugin can be scheduled and enabled quite simply.

The only problem that I see is that the backups are saved locally on the Feng Office server – this still requires the Admin user to download the backups to store them somewhere else.

Sadly as far as I can tell restoring the backup is a manual process. While it doesn’t look too taxing it would involve copying the backup to the Feng Office installation folder and then manually restoring the MySQL database backup.

While this backup process seemed to work quite nicely (and it is nice to be able to do from within the Feng Office interface) I plan to use the scripts and cron jobs that I already have set up to back up Feng Office.