Category Archives: Ubuntu Linux

How to start Apache OFBiz demo under Ubuntu Server 12.04

Install JDK 6 with the following command:

apt-get install default-jdk

Download the latest OFBiz version, extract it in your home directory and do the following steps described in the README file.

Having apache-ofbiz-XX.XX.XX as the current directory execute the following command:

./ant load-demo

(more…)

How to install Apache Tomcat 7 on Ubuntu Server 12.4 LTS

Today I successfully installed Tomcat 7 on Ubuntu Server 12.4 LTS with the following commands (executed as root):

apt-get install default-jdk
apt-get install tomcat7
apt-get install tomcat7-admin
apt-get install tomcat7-examples

(more…)

How to add an existing website to Git

I’ve been making small changes to my Joomla 1.5 (PHP) website for about two years without using any kind of version control, but recently I heard that Git is a good one and it is even supported by MS Visual Studio 2012. So I installed Git Client on my Ubuntu Server and did typical steps to add my website to the local repository.

cd ~
git init
git add www/
git commit -m "First commit" www/

(more…)

Installing Git on Ubuntu 12.04

Git installs as a normal package on Ubuntu Server 12.04.2 LTS:

sudo apt-get install git

Configuring Git user is an optional step:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Type the following command to create an empty repository wherever your code is:

cd ~
git init

(more…)

Setting up Shared Hosting with Nginx on Ubuntu – step by step guide

This is a draft version of the post. It’ll be revised.

Installing Ubuntu Server

  1. Download the latest version of Ubuntu Server. Note that it is not possible to convert Ubuntu 32 bit to 64 bit. The only way is to do a clean install.
  2. Create a bootable USB stick using Pen Drive Linux’s USB Installer.
  3. Boot up from USB and install Ubuntu Server. During the installation you can switch to terminal mode by pressing Alt+F2 and switch back by pressing Alt+F1.

Update the server:

aptitude update
aptitude safe-upgrade

(more…)

Installing and configuring FTP server on Ubuntu

Install FTP server:

apt-get install proftpd

To jail all users in their home directories uncomment line

DefaultRoot                     ~

in /etc/proftpd/proftpd.conf. To jail all but one users modify this line as follows:

DefaultRoot                     ~ !<user1>

note that there is a space after ‘~’.

(more…)

How I configured sendmail for PHP on Ubuntu Server 12.04

Preventing sendmail from been very slow

The first thing that I did after installing sendmail with

aptitude install sendmail

is I put “gate.localhost” (gate is my server name) to /etc/hosts so it looks like this:

127.0.0.1       localhost.localdomain localhost
127.0.1.1       gate.localhost gate

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

With default /etc/hosts containing only “gate” and “localhostsendmail hangs up for a while and writes to /var/log/mail.log the following message:

My unqualified host name (gate) unknown; sleeping for retry.

(more…)

Securing Apache web server on Ubuntu Linux

Running Apache virtual hosts as different users

By default, Apache on Ubuntu executes all PHP scripts under www-data user, hence in situations where multiple mutually distrusting users have the possibility to put their PHP scripts on the server they could potentially spy on each other private data.

For example, the user user1 could put a PHP script that access file ‘file1.txt’ belonging to user2:

echo file_get_contents("/home/user2/www/file1.txt");

(more…)