Ubuntu Server 14.04 (Trusty Tahr) – Zentyal 3.5 Installation

ubuntu-server-logo

Zentyal Server is an open source Linux small business server, that can act as a Gateway, Infrastructure Manager, Unified Threat Manager, Office Server, Unified Communication Server or a combination of the above.

I am performing this setup on a minimal virtual machine installation of Ubuntu Server 14.04. At the time of writing Zentyal 3.5 is the most current Zentyal release.

First make sure that repositories and software are up to date:

sudo apt-get update
sudo apt-get upgrade

Add the Zentyal 3.5 repository to /etc/apt/sources.list:

echo "deb http://archive.zentyal.org/zentyal 3.5 main extra" | sudo tee -a /etc/apt/sources.list

Import public keys for Zentyal 3.5:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 10E239FF
wget -q http://keys.zentyal.org/zentyal-3.5-archive.asc -O- | sudo apt-key add -

Update repositories:

sudo apt-get update

Install Zentyal:

sudo apt-get install zentyal
  • When prompted enter a password for the MySQL root user.
  • Confirm port 443 as the Zentyal https port.

From here we simply setup Zentyal using the web-gui. Open Firefox (the only officially supported browser) and enter the url for your Zentyal install: https://zentyal-server-ip.

Confirm the security exception in Firefox and then log in to Zentyal using your Ubuntu Server credentials:

Zentyal - login

Ubuntu Server 14.04 (Trusty Tahr) – Quick MediaDrop Installation

ubuntu-server-logo

MediaDrop is a open source online video platform for managing and delivering video, audio and podcasts.

mediadrop

Sadly I found the official documentation to be lacking and had to cross reference it with other install guides to even get a basic setup running.

This guide will take you through a basic installation of MediaDrop that utilizes the built in Paste Server provided by Python. If you prefer a more permanent solution you can setup an Apache 2 or Nginx web server yourself. For the time being I am happy enough to just have MediaDrop running – having experienced a couple of bugs I do not want to mess with my working configuration any further right now.

My working environment is a minimal installation of Ubuntu 14.04 Server on VMware vSphere 5.x.

Let’s begin our installation – first we will elevate ourselves to the root user and then install MySQL, System libraries, development headers, python libraries and tools:

sudo -i

apt-get install mysql-server mysql-client libjpeg-dev zlib1g-dev libfreetype6-dev libmysqlclient-dev python-dev python-setuptools python-virtualenv git

When prompted enter a password for the MySQL root user.

Setup Python virtual environment:

cd /

virtualenv --no-site-packages venv

Activate the virtual environment:

source venv/bin/activate

Install MediaDrop from Git:

git clone git://github.com/mediadrop/mediadrop.git mediadrop-git

Download and install all the necessary dependencies for MediaDrop into your virtual environment:

cd mediadrop-git

python setup.py develop

Generate the deployment.ini file:

paster make-config MediaDrop deployment.ini

We will now bring up a mysql> prompt to administer the MySQL database:

mysql -u root -p

Enter your MySQL password when prompted.

Create the MySQL database mediadrop_db and the MySQL user mediadrop_user and a password for mediadrop_user:

mysql> create database mediadrop_db;
mysql> grant usage on mediadrop_db.* to mediadrop_user@localhost identified by 'mysecretpassword';
mysql> grant all privileges on mediadrop_db.* to mediadrop_user@localhost;
mysql> exit;

Note: Change ‘mysecretpassword‘ to the password you want for mediadrop_user.

Edit the delpoyment.ini file:

nano deployment.ini

Under the [app:main] heading, look for the sqlalchemy.url setting:

sqlalchemy.url = mysql://username:pass@localhost/dbname?charset=utf8&use_unicode=0

Change the username, pass, and dbname entities to mediadrop_user, password and mediadrop_db:

Note: password here refers to the password that you designated earlier for mediadrop_user.

sqlalchemy.url = mysql://mediadrop_user:mysecretpassword@localhost/mediadrop_db?charset=utf8&use_unicode=0

Setup the built in server:

paster setup-app deployment.ini

Enable simple full text searching:

mysql -u root mediadrop_db < setup_triggers.sql -p

Enter your MySQL password when prompted.

Now that MediaDrop itself is installed and the basics are configured, we can test it out using the Paste server:

paster serve --reload deployment.ini

Open a browser and enter the ip address for your server using port 8080. For example – http://server-ip:8080

To access the admin dashboard you need to append /admin to the above url. The default administrative username is admin, and the password is also admin. Remember to change your password!

If you restart your server you will need to activate the virtual environment again and run the Paste server again. A basic script to handle this looks like this:

#!/bin/bash
cd /
source venv/bin/activate
cd mediadrop-git
paster serve --reload deployment.ini

Save this as something like mediadrop-start.sh and then make it executable:

chmod +x mediadrop-start.sh

Run the script as follows:

sudo ./mediadrop-start.sh

As a closing note I did encounter issues accessing the admin panel after changing the admin password when using Firefox. I could access the admin panel using Internet Explorer though.

Sources:

http://mediadrop.net/docs/install/index.html

https://docs.google.com/document/pub?id=1DAikm-mCYiNFddClW21S0G-EwzINIC_gUl7pn2jq2zA

Ubuntu Server 14.04 (Trusty Tahr) – Quick Headless Transmission Setup

ubuntu-server-logo

This is a quick post with a brief explanation of how to set up transmission on Ubuntu Server (currently 14.04 (Trusty Tahr)).

First make sure your repositories are up-to-date:

sudo apt-get update

Install transmission:

sudo apt-get install transmission-cli transmission-common transmission-daemon

Check to make sure that the transmission-daemon is not running – if it is it will overwrite any configuration changes that we make later:

sudo service transmission-daemon stop

Locate the transmission-daemon settings file:

sudo find / -iname settings.json

Two locations are found for this file:

/etc/transmission-daemon/settings.json
 /var/lib/transmission-daemon/info/settings.json

We will edit /etc/transmission-daemon/settings.json:

sudo nano /etc/transmission-daemon/settings.json

The changes that I made to settings.json are in red. You will need to provide your own settings to configure your setup:

"download-dir": "your-download-location",
"incomplete-dir": "your-download-location",
"rpc-password": "password",
"rpc-username": "username",
"rpc-whitelist": "127.0.0.1,192.168.0.*",
  • download-dir and incomplete-dir are directories where complete and incomplete torrents are stored. They do not have to be different directories.
  • rpc-password and rpc-username are the username and password for web access administration.
  • rpc-whitelist defines access to transmission. Localhost (127.0.0.1) is defined by default. I added ,192.168.0.* to allow any machine on my LAN access.

Start the transmission-daemon:

sudo service transmission-daemon start

Verify that everything is working by opening a broswer and pointing it to http://server-ip:9091.

Sources:

https://forum.transmissionbt.com/viewtopic.php?f=8&t=8361

http://www.webupd8.org/2009/12/setting-up-transmission-remote-gui-in.html

Ubuntu Server 14.4 (Trusty Tahr) – add-apt-repository: command not found

ubuntu-server-logo

The last time I encountered the add-apt-repository: command not found error I was using Ubuntu Server 12.4 Lucid. The solution then was to install python-software-properties as follows:

sudo apt-get install python-software-properties

 

This did not resolve the issue on my minimal virtual machine installation on Trusty so I installed apt-file – which is an apt package searching utility:

sudo apt-get install apt-file

 

Update apt-file:

apt-file update

 

Finally use apt-file to search for the add-apt-repository package:

apt-file search add-apt-repository

 

As you can see add-apt-repository is in software-properties-common:

software-properties-common: /usr/bin/add-apt-repository
software-properties-common: /usr/share/man/man1/add-apt-repository.1.gz

 

After installing software-properties-common I was able to use add-apt-repository without any further issue:

sudo apt-get install software-properties-common

Ubuntu Server – Installing Tiny Tiny RSS

ubuntu-server-logo

I have been using Gregarius as my web-based RSS aggregator for quite some time now but have wanted to try Tiny Tiny RSS for a while.

Now that WebUpd8 have created a PPA (Personal Package Archives) for Tiny Tiny RSS I really had no excuse for not installing it.

Note: I am installing Tiny Tiny RSS on Ubuntu Server 12.04. PPAs have been available for Ubuntu since Ubuntu 9.10 – so this will not work on prior editions of Ubuntu Server.

The first step is to update our repositories and install Apache and MySQL:

sudo apt-get update
sudo apt-get install mysql-server mysql-client apache2 libapache2-mod-php5

When prompted enter a password for your MySQL root user:

MySQL Password

Confirm your MySQL password:

Confirm MySQL Password

Now that we have our prerequisites installed we can add the Tiny Tiny RSS PPA.

Note: On a minimal virtual machine installation of Ubuntu Server we need to install the  python-software-properties package to be able to add a PPA:

sudo apt-get install python-software-properties

Add the Tiny Tiny RSS PPA:

sudo add-apt-repository ppa:webupd8team/tt-rss
sudo apt-get update
sudo apt-get install tt-rss

Set Apache as the Tiny Tiny RSS web server:

tt-rss apache

Set the URL for the Tiny Tiny RSS installation – for a local install on my LAN i used http://localhost/tt-rss/:

tt-rss url

Select Yes for database configuration:

tt-rss database config

Confirm MySQL as the database for Tiny Tiny RSS:

tt-rss database mysql

Enter your root MySQL password:

tt-rss root mysql password

Enter a password for Tiny Tiny RSS to register with MySQL – a random password will be generated if left blank:

tt-rss application password

Confirm your application password:

tt-rss confirm application password

Next we need to use nano to edit some configuration files.

First we need to edit our server address in /etc/tt-rss/config.php:

sudo nano /etc/tt-rss/config.php

Find the line  define('SELF_URL_PATH', 'http://yourserver/tt-rss/'); and change it to  define('SELF_URL_PATH', 'http://localhost/tt-rss/'); (as per the server address that we set previously):

tt-rss config.php

Press Ctrl + O then Enter to save the changes to config.php and then Ctrl +X to exit nano.

To get Tiny Tiny RSS to update feeds we need to edit /etc/default/tt-rss:

sudo nano /etc/default/tt-rss

Change DISABLED=1 to DISABLED=0 to allow the Tiny Tiny RSS daemon to be started:

tt-rss tt-rss

Press Ctrl + O then Enter to save the changes to config.php and then Ctrl +X to exit nano.

Start the Tiny Tiny RSS service:

sudo service tt-rss start

Obtain the IP address of your Ubuntu Server installation:

ipconfig

tt-rss ifconfig

Open a browser on another machine and navigate to your Tiny Tiny RSS URL:

tt-rss login

Login with the username: admin and the password: password.

Click Actions, Preferences and Users to change your admin password and add users. You can import feeds under the Feeds tab or click Exit Preferences and then Actions, Subscribe to feed to add feeds manually.

Source: http://www.webupd8.org/2013/05/tiny-tiny-rss-ubuntu-ppa-google-reader.html

Ubuntu – Change Hostname Permanently Using the Command Line

ubuntu-logo

On Ubuntu the hostname is stored in both the /etc/hosts and /etc/hostname files. There are several ways that we can change the hostname in these files.

1. Manually Edit the hostname

We can manually edit these files using a basic text editor like nano:

sudo nano /etc/hosts
sudo nano /etc/hostname

In /etc/hostname simply overwrite the existing hostname with a new one. In /etc/hosts you will find the hostname on the line beginning 127.0.0.1 – overwrite only the hostname with the new one, and then reboot.

Editing /etc/hosts using nano
Editing /etc/hosts using nano
sudo reboot

2. Use sed to change the hostname

Another way to achieve the same goal is to use the sed command to replace the existing hostname with a new one.

For example, my Ubuntu Server has the default hostname of ‘ubuntu’.

Use the hostname command to check what your hostname is.

With sed we can look for our hostname (in /etc/hosts and /etc/hostname) and then replace it with the desired new-hostname:

sudo sed -i 's/ubuntu/new-hostname/g' /etc/hosts
sudo sed -i 's/ubuntu/new-hostname/g' /etc/hostname

Reboot:

sudo reboot

3. Write a Bash Script

It’s always handy to have a script to do things – so here is a quick bash script that I put together that uses sed to change the hostname and then reboot:

#!/bin/bash
#Assign existing hostname to $hostn
hostn=$(cat /etc/hostname)

#Display existing hostname
echo "Existing hostname is $hostn"

#Ask for new hostname $newhost
echo "Enter new hostname: "
read newhost

#change hostname in /etc/hosts & /etc/hostname
sudo sed -i "s/$hostn/$newhost/g" /etc/hosts
sudo sed -i "s/$hostn/$newhost/g" /etc/hostname

#display new hostname
echo "Your new hostname is $newhost"

#Press a key to reboot
read -s -n 1 -p "Press any key to reboot"
sudo reboot

Ubuntu Server – Apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

ubuntu-server-logo

Restarting the Apache Web Server on Ubuntu Server (12.04 at the time of writing) gives me the following error:

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

To fix this error add ServerName localhost to /etc/apache2/httpd.conf, as follows:

echo 'ServerName localhost' | sudo tee -a /etc/apache2/httpd.conf

Restart Apache to make sure that the issue is resolved:

sudo /etc/init.d/apache2 restart