Installing Learning With Texts on Ubuntu

For language learning, one of the best program, that I use is Learning with text. It is a program, that help with reading and make the online lookup of words much easier.

The only problem would be, that it need to have a server, in order for the program to work. The documentation have a nice way showing, how to do it in Windows and on Macs. Here is a way for Ubuntu users to enjoy the benefits of the program as well.

To start the installation, first the local server has to be installed on the computer. To do that, the easiest way for Linux users is to install tasksel, and then LAMP software. That is accomplished by witting in the terminal:

sudo apt-get install tasksel sudo tasksel install lamp-server

While installing the lamp-server, the user is promoted to give the user root (for MySQL) a password. User just needs to input password twice and the process can continue.

After that, the database for the lwt has to be created. The easiest way for me is, to enter the MySQL prompt and do it with the code. Entering happens by writting in the terminal:

sudo mysql -u root -p

-p is a switch, that is used to input password. Here the password is used, that was chosen in the lamp installation. If the password wasn't chosen at the time, the line used is:

sudo mysql -u root

Now, the user has entered the MySQL prompt. In order to create a database, the user inputs the next line:

CREATE DATABASE {the name of the database};

where the {the name of the database} is substituted with the name of the database, that you want to use. I used the name lwt. In configuration is the name learning-with-texts.

If the user want to add another user, who will be able to use that database, the next line is used:


To exit MySQL prompt, the next line is used:


Then the learning with texts program has to be download to the computer. The program can be found on ''.

Then the program files has to be moved to the directory /var/www/, since there are the files, that the server is reading. To do that, move the terminal location to download file (cd {location, if home file just ~}), create the folder that will contain the files and then extracting files to /var/www/:

cd {folder name} mkdir /var/www/ unzip {the name of the zip file - in my case} -d /var/www/lwt/

In order to make my next work easier, I moved to the folder containing the program. To do that, I used next command:

cd /var/www/lwt/

Next came renaming the files, so that the program is going to recognize them. The file has to be renamed to That can be achieved with the following command:


Then that file has to be changed. File can be opened with any text editor (gedit, nano, vim,...). I use vim, so I opened it with the command:

sudo vim

To use other editor just substitute the name vim with the name of your preferred text editor.

Here the information about the user has to be correctly entered. There are for lines starting with $, and these are the one that we are interested in.

$server = "localhost"; $userid = "{name of the user}"; $passwd = "{password of the user}"; $dbname = "{the name of the database}";

Leaving the first line alone, you then enter the name of the user (if another user was created, that user can be used, otherwise it is root), then the password of the above user, and last the name of the database, that was created (in MySQL prompt).

The last thing to do, before the program can be opened, is to restart apache server. That can be accomplished with next line:

sudo service apache2 restart

To start the program, open you favorite browser and then open the site 'http://localhost/lwt/' or ''.

One of the problems I encountered was not be able to save words.

The Apache server must have ability to write to the program in order to work. To do that, move to the folder, where the program is installed and give everybody ability to read and change it. The code to accomplishes that is:

cd /var/www/ sudo chmod -R 777 lwt

And again the link to the program is: