Step Ten • DNS • Webalizer • Webmail

22. DNS server

  1. Preparing the system for MyDNS installation
  2. Download and build MyDNS
  3. Static external IP address or dynamic IP update service

23. Vlogger, Webalizer, Jailkit, Fail2ban

  1. Install Vlogger and Webalizer
  2. Install Jailkit
  3. Install Fail2ban

24. SquirrelMail

  1. Install SquirrelMail
22. DNS server

22a. Preparing the system for MyDNS installation

The MyDNS name server, used to convert domain names to IP addresses on the world wide web, requires some pre-installed modules like g++ and gcc.

Select and copy:


Prepare

Paste and run the code in Terminal. Continue? Type y and ...

Continue
... hit Enter.

22b. Download and build MyDNS

Debian Lenny comes without MyDNS, so we have to download and build it ourselves.

First change directories and go to tmp (temporary). In Terminal, run:

cd /tmp

cd

Terminal will show you're inside the tmp directory:

tmp

Download MyDNS. Select and copy:


Paste and run the code in Terminal.

Get MyDNS

In order to extract (untar) the file, select and copy into Terminal:


Paste

Run the code to untar the file. This will create directory mydns-1.2.8. Switch to this directory by using the cd (change directories) command.

TIP Now here is a trick: you don't have to type the complete name of the new directory. Type cd and the first character – in this case m – and then hit your keyboard's Tab key. The system will complete the name for you.

Type cd m

Type cd /m

Now hit the Tab key:

Tab

The system has completed the name. Hit Enter to swap directories.

Then it's time to configure MyDNS. Run: ./configure

./configure

After the process you get this message:

Message

The system tells you what to do next.

First run: make in Terminal, as shown above.

After that, run: make install

Make install

You'll get a message stating MyNDS has been installed:

Installed

We have to create a script to start or stop MyDNS. Opening a non-existant file in vi always makes vi create a brand new one. Select and copy:


Then run this code in Terminal:

Create

Select and copy the code for the new file:


In the newly created file, with the cursor in the top line ...

Cursor

... hit the i on your keyboard to start editing (--INSERT--) ...

Insert

... and then paste the script code (Ctrl-V).

Stop editing by hitting Esc, then save the file and quit by running :wq as shown below.

Finish

Now add execution permissions for the script.

Select and copy:


Paste and run the code in Terminal:

chmod

Finally, make the script run at boot time.

Select and copy:


Paste and run the code in Terminal:

Run at boot time

You're ready installing and configuring MyDNS when you see something like this:

Ready
23. Vlogger, Webalizer, Jailkit, Fail2ban

23a. Install Vlogger and Webalizer

Vlogger is a piece of code dealing with large amounts of virtualhost logs. Webalizer is a server log file analysis program producing usage reports for viewing with a web browser.

Select and copy:


Paste and run the code in Terminal:

Vlogger and Webalizer

Continue? Yes, so type y and ...

Yes

... hit Enter.

When installation is ready, you could choose to have your Webalizer reports automatically numbered up.

Edit webalizer.conf in vi. Select and copy:


Paste and run the code in Terminal:

Open

The line you have to edit is probably not immediately visible, as you see here:

Not visible yet

Using the arrow keys on your keyboard, scroll down to the line:

#Incremental no

Scroll down

Put vi in editing mode by hitting the i key, then remove the hash # and change no to yes to make the line look like:

Incremental yes

Save the file and exit vi by hitting Esc, typing :wq and hitting Enter.

23b. Install Jailkit

Jailkit is a set of utilities to chroot (limit) SSH users to specific files. It's necessary to do this now, before installing additional software like hosting control panels such as ISPConfig.

First, install code-generating tools like flex and bison.

Select and copy:


Paste and run the code in Terminal:

Code generators

Continue? Yes, so type y and...

Yes

... hit Enter.

Then go to the tmp directory. In Terminal, type:

cd /tmp

cd

Download Jailkit. Select and copy the following code:


Paste and run the code in Terminal:

Paste and run

Next, select and copy the following untar command including the first character of the Jailkit app:


Paste the code snippet in Terminal but don't run it yet:

Snippet

Hit the Tab key to complete the file name:

Complete code

This was another example of how to use autocomplete by hitting the Tab key.

Next, hit Enter to untar the file.

Following the untar process, switch to the Jailkit directory by first typing: cd /j

Snippet

... then hitting Tab to autocomplete the file name:

Autocomplete

Hit Enter, then type: ./configure

Configure

When the configuration is ready, run make:

Make

When the make process is ready, run make install:

Make install

You may now delete the Jailkit package from tmp directory.

First move up from the jailkit-2.5 directory to tmp by running cd ..

cd

Type the directory delete command rm -rf and the first character of the file name, j:

Snippet

Hit Tab to autocomplete the file name but don't run the code yet.

Autocomplete

Add an asterisk * to delete all files beginning with jailkit-2.5:

Asterisk

Hit Enter.

Now let's check what's inside the tmp directory. Run ls to list all files in the current directory, i.e. tmp:

List files

If you see this:

tmp

... it means there are still 2 items in the tmp directory. If you want to, you may delete these files by running:

rm -rf mydns-1.2.8*

23c. Install Fail2ban

Fail2ban scans log files like /var/log/pwdfail or /var/log/apache/error_log and bans IP addresses that make too many password failures.

Select and copy:


Paste and run the code in Terminal:

Fail2ban
24. SquirrelMail

24a. Install SquirrelMail

SquirrelMail is a webmail package allowing to send email from a web page at any location.

In order to install SquirrelMail, select and copy:


Paste and run the code in Terminal:

Squirrelmail

Continue? Yes, so type y and ...

Continue

... hit Enter.

When the installation is ready, create a symlink (symbolic link) inside the webmail directory. Select and copy:


Paste and run the code in Terminal:

Symlink

Then configure SquirrelMail. Select and copy:


Then, paste and run the copied code in Terminal:

Configure

You'll see this screen:

Configuration

You're told on the screen which options are available, for example: Set pre-defined settings for specific IMAP servers. That's option D.

Following Command >> type D

Type D

... and hit Enter.

In the next screen you have to choose your IMAP server. That's Courier.

Following Command >> type courier

Courier

... and hit Enter. In the next screen you'll see the line: Press any key to continue...

Hit Enter

Just hit Enter.

Then save the data. Following Command >> type S

Type S
... and hit Enter. The configuration has been saved ...
Saved

... so hit Enter to continue.

As you can see, it's time to quit. Following Command >>

Command

... type Q

Type Q

... and hit Enter.

You can now access SquirrelMail internally under http://192.168.178.99/webmail or under your equivalent for http://server01.yourdomain.com/webmail.

If your server is online, you may also access SquirrelMail using the external IP addres followed by /webmail.

Access SquirrelMail

The system is now ready for ISPConfig3. Go to the next page.

Drag this box to where you want it
vi | shell
command action command action
su become superuser rm foo delete file foo
ls show files & directories rmdir foo delete directory foo
ls -a show invisible items too rm -rf foo delete dir foo + content
ls -l show long names chmod change permissions
ls -la show long and invisible chmod 755 foo set 755 for foo
cd change directories vi /etc/foo open file foo in vi
cd / go to root directory apt-get install get and install application
cd /etc go to etc via root tar -xzvf extract zip file
cd /tmp go to temp via root exit finish Terminal session
/etc/init.d/restart apache2 restart the Apache server
/etc/init.d/status apache2 show if the Apache server is running
shutdown -h now shutdown the system immediately
shutdown -r shutdown and reboot the system
vi | shell
<= keyboard hits => action
  i   insert (start editing)
  arrows   move around
  backspace   delete to the left
  delete   delete to the right
  esc   stop editing
esc :w enter stop editing, save changes and keep vi open
esc :wq enter stop editing, save changes and exit vi
esc :q enter stop editing, exit vi without saving

Assistance

vi & shell

Contact