Installing and Configuring UnrealIRCd on Linux

From SwiftIRC Wiki
Jump to: navigation, search

This article will demonstrate an UnrealIRCd [v3.2.8.1. - SSL] setup on an Ubuntu Linux v8.04 [64-bit] system, purely via command line.

What is UnrealIRCd?

UnrealIRCd is an open-source irc server daemon (ircd) that allows users to run their own IRC server from their system. Unreal is just one of the many ircds out there for use. It created and is edited daily by their own support staff, who can be found at irc.unrealircd.com. The development of Unreal started in 1999. Unreal can be ran and configured on Windows and Linux, however, this guide was written specifically for the installation of Unreal on a Linux distro, Ubuntu.

Note: Even though this configuration of UnrealIRCd was designed for Linux, the configuration file is interchangeable between the Linux and Windows versions of UnrealIRCd.

UnrealIRCd Security Threat

On June 12th, 2010, the UnrealIRCd staff members sent out an email stating that their current version of Unreal has been backdoored. Apparently the corrupted version has been replaced with a secure version. The corrupted version allowed the user who backdoored UnrealIRCd to control and do anything to the system which had UnrealIRCd installed. Reinstall the updated version of UnrealIRCd.

If you currently have UnrealIRCd installed and want to check if it is corrupted or not:

  • If you still have the unreal*.tar.gz file, type md5sum Unreal3.2.8.1.tar.gz
    • If you receive: 752e46f2d873c1679fa99de3f52a274d, then you're running the bad version
    • If you receive: 7b741e94e867c0a7370553fd01506c66, then you're running the good version
  • If you don't have the *.tar.gz file, type grep DEBUG3_DOLOG_SYSTEM include/struct.h (in the Unreal3.2 directory)
    • If it outputs two lines, you're running the bad version
    • If it doesn't output lines, you're running the good version


Pre-Installation

First, download the UnrealIRCd v3.2.8.1 source, located here. If you have wget installed on your Linux system, you can download the source package by typing:

 wget http://www.unrealircd.com/downloads/Unreal3.2.8.1.tar.gz

If you do not have wget installed, type apt-get install wget as root (optional).

After you install it, run a few checks on the gzip file to make sure it is the secured version.

 gpg --recv-keys 0x9FF03937 --keyserver keys.gnupg.net
 gpg --verify Unreal3.2.8.1.tar.gz.asc Unreal3.2.8.1.tar.gz

Next, we have to extract the contents of the compressed file. Type

 tar zxvf Unreal3.2.8.1.tar.gz

You will now have a folder named Unreal3.2. We will leave it for now as we need to install a few other components first, to take full advantage of our future irc server. (You may choose to skip installation of some or all of these components)

SSL Support

If you want users to be able to connect to your IRC server via a secure connection, you will need to install a package called libcurl4-openssl-dev. This is a bundle that includes everything needed for SSL, plus what is needed for remote includes which are discussed below.

You will need to install the packages as root. Type these:

 apt-get install build-essential
 apt-get install openssl
 apt-get install libcurl4-openssl-dev

You now have what is required for SSL connections to your server.

Ziplinks Support

Ziplinks reduce the amount of bandwidth used by your servers by compressing data before it is sent to another server.

zlib1g is the library required for ziplinks, which is usually installed already, so you don't have to do anything.

Remote Includes Support

A remote include is pretty much like a normal include, the difference being that remote includes are obtained from a remote FTP server. This makes it so there could be one central FTP server with most of the configuration files that are not server-specific. This will make updates to the configuration files much easier, since you only have to update the files on the FTP server, then rehash all of the IRC servers.

For remote include support, we will need libcurl, which is already installed with the libcurl4-openssl-dev package above.

Installation

We are now ready to install UnrealIRCd. Switch back to the account that you will be installing UnrealIRCd on, and navigate to the Unreal3.2 folder. Type:

 ./Config

Read the information it gives you. At the end, press enter again and you will be brought to the first question. The first question is:

 Do you want to enable the server anti-spoof protection?

It is a good idea to enable this, just in case. The default answer is No, but just type "Yes" and press Enter.

 What directory are all the server configuration files in?

Keep the default answer for this question.

 What is the path to the ircd binary including the name of the binary?

Keep the default answer for this question.

 Would you like to compile as a hub or as a leaf?

If you are planning on linking to a network, type in Leaf and press Enter. If your server is going to be standalone or will be the hub for other servers to link to, just press Enter.

 What is the hostname of the server running your IRCd?

Keep the default answer for this question.

 What should the default permissions for your configuration files be?

Keep the default answer for this question.

 Do you want to support SSL (Secure Sockets Layer) connections?

If you elected to install the SSL libraries above, type Yes and press Enter. Otherwise, keep the default value and press Enter.

If the answer to the above question was Yes, this question will pop up:

 If you know the path to OpenSSL on your system, enter it here. If not leave this blank

Press Enter.

 Do you want to enable IPv6 support?

If you want BNCs that are using IPv6 to connect to your server, type Yes and press enter. Otherwise, keep the default value and press Enter.

 Do you want to enable ziplinks support?

If you want ziplinks support, type Yes and press Enter. Otherwise, keep the default value and press Enter.

If the answer to the above question was Yes, this question will pop up:

 If you know the path to zlib on your system, enter it here. If not leave this blank.

Leave it blank and press Enter.

 Do you want to enable remote includes?

If you are planning on using remote includes, type Yes and press Enter. Otherwise, keep the default value and press Enter.

If the answer to the above question was Yes, this question will pop up:

 Specify the directory you installed libcurl to

You cannot skip this question. Type /usr then press Enter.

 Do you want to enable prefixes for chanadmin and chanowner?

This usually boils down to personal preference. Either keep Yes or type No and press Enter.

 What listen() backlog value do you wish to use?

Just press Enter.

 How far back do you want to keep the nickname history?

Just press Enter.

 What is the maximum sendq length you wish to have?

Just press Enter.

 How many buffer pools would you like?

Just press Enter.

 How many file descriptors (or sockets) can the IRCd use?

Just press Enter.

 Would you like any more parameters to configure?

Just press Enter.

After the series of questions above, UnrealIRCd will be configured.

SSL

If you opted to support SSL, you will be asked to create an SSL certificate for your server. If not, skip this section.

You will be asked some questions. You should answer them from the server's point of view; that is, pretend you are the server, so if your server is in the United States and you are in Canada, put United States in the SSL certificate.

 Question 1: Country Name. Enter the country name that the server is located in, eg. US for United States.
 Question 2: State/Province. Input the state or province that your server is located in.
 Question 3: Locality name. Enter the city that your server is located in, eg. Miami.
 Question 4: Organization Name. Enter the name of your entity, eg. TestIRC.
 Question 5: Organizational Unit Name. An example could be "Technical Dept."
 Question 6: Common Name. Enter the domain that points to your server, eg. servername.TestIRC.net. 
 Make sure that it is registered and functioning.

You are now finished creating your server's SSL certificate. Press Enter.

Now, type make and press Enter.

Configuration

We will now be configuring UnrealIRCd. This is a basic configuration; there are many other advanced options available that are not within the scope of this article.

We have created an example configuration file that we will be using for the rest of this article. Download it here.

After downloading our unrealircd.conf, copy or move it to the main Unreal3.2 directory. (Usually located where you extract the TAR archive)

When you've done that, open up unrealircd.conf with a command such as nano or pico.

Necessary Modules

Locate the Linux and Windows module section near the top of the configuration file. Uncomment (Remove the two slashes in front of the lines) the two loadmodule lines for Linux.

Me Block

After opening unrealircd.conf, locate the me {} block. Edit the name and the info lines with the server name and description that you want.

Admin Block

Locate the admin {} block and add in some information about the server admin (you). You can have as many or as little lines as you want here.

Oper Block

Locate the oper {} block. Edit YourName in the first line of the block to what you want your oper login to be. You'll also have to change the host in the userhost line to your own host. To find your own host, connect to a network (SwiftIRC) and type /whois <Your-Nickname>. Find the line that says something along the lines of:

 <nickname> is connecting from *@adsl-043-120-021-030.sip.jax.bellsouth.net 43.120.21.30

Take the long host that you see (the one in bold) and edit it into the userhost line. You'll also want to edit in your password that you'll use to oper up with to the password line.

Services Link Block

Next, move down to the services link block. (Note: Do not uncomment (remove the /* and */) the link block until you set up your services.) In the services link block, change services.TestIRC.net to your network's name, e.g. services.CoolIRC.net. Change the connect and receive passwords. It is best for both of them to be the same. Locate the ulines block and, once again, change services.TestIRC.net to your network's name.

Ban Blocks

Next are the ban blocks. Use the default examples given to add your own bans. It is also worth noting that bans can be made within the IRC network.

vHost Block

Next is the vHost block. Editing this block is optional, so feel free to skip this section.

Go to the vhost line and change the vhost to whatever you like. Copy the userhost used in the oper block and replace the default *@* host with your own. Change the login name and password for your vHost.

Network Settings Block

Find the network settings block and change TestIRC in the network-name, default-server, services-server and stats-server lines to your own network name. Change the hidden-host prefix to your network name also. The hidden-host prefix is what you see in place of a user's IP address. For example, on SwiftIRC you will see someone's host as ~ident@Swift-FD75464.cable.telstraclear.net. In this case, Swift is the hidden-host prefix. Next you'll have to change all three cloak keys to three random strings of numbers and letters. After that, change TestIRC.net in the host block within the network settings block to your own network name. The host-on-oper-up value can be either yes or no. Setting it to yes will automatically give people, when they oper up, the host specified for their position.

Server Settings Block

Next is the server settings block. Change the kline-address to a working email address so that people who get banned can contact you.

If you are an advanced user, feel free to change the remaining blocks and values that have not been mentioned.


You have now finished configuring UnrealIRCd.

Running UnrealIRCd

After confirming that unrealircd.conf is in the main Unreal3.2 directory, run UnrealIRCd by navigating to the Unreal3.2 folder (Example: If your Unreal3.2 folder is in the home folder for a user named unrealserver, you could type cd /home/unrealserver/Unreal3.2) then typing:

 ./unreal start
Running UnrealIRCd

Congratulations, you have just set up an IRC server!


To connect to your new IRC server, obtain the IP address of the server that is running UnrealIRCd. Then, in your favourite IRC client, type:

 /server <ip address> 6667

Note: If you want other people to connect, you may need to set up port forwarding. This is not covered in this article.

Some configuration extras

Message of the Day

You can create a Message of the Day (MotD) that will be displayed to all users that connect to your server. It can also be read by typing /motd. Create a file named ircd.motd in your Unreal3.2 directory and edit it with a text editor. Write in your MotD, save the file, and rehash Unreal. You can rehash UnrealIRCd by navigating to the Unreal3.2 directory then typing ./unreal rehash.

Network rules

You can create a rules file that can be read by typing /rules. Create a file named ircd.rules in your Unreal3.2 directory and edit it with a text editor. Write in your rules, save the file, and rehash Unreal.

Oper Message of the Day

You can create a Message of the Day just for IRC operators on your server. Create a file named oper.motd in your Unreal3.2 directory and edit it with a text editor. Write in your oper MotD, save the file, and rehash Unreal.

IRC bot Message of the Day

You can create a Message of the Day for IRC bots that connect to your server. Create a file named bot.motd in your Unreal3.2 directory and edit it with a text editor. Write in your bot MotD, save the file, and rehash Unreal.


Have fun!




   This tutorial has been created by SwiftIRC user Mp5shooter