UnrealIRCd
From NeoWiki
UnrealIRCd is Internet Relay Chat server software that the NeoturbineNET network uses exclusively. If you would like to learn how to run your own IRC server, and potentially become a link, you will first need to setup Unreal (and preferably BOPM).
The NeoturbineNET IRC Network is in the process of converting to a highly available configuration.
This entire article may be moved or revamped in the next few weeks due to these massive changes.
This is a step-by-step guide on how to compile and configure Unreal from the latest tarball.
We don't guarantee any of the steps here actually will work for you in the end, but they most likely will not break your system (not a promise!). If you have a problem following this guide, and need some advice/hand-holding/guidance/help/whatever, or just want to hang out, you can probably join the NeoturbineNET IRC channel and eventually get someone to stop idling just long enough to talk to you.
Contents |
[edit] Installation
A few things have to be setup before Unreal can be downloaded, installed, and configured.
You need to start out as either root, or a user with the ability to sudo.
A user account dedicated specifically to running Unreal should be created.
sudo useradd ircd --home /home/ircd --create-home --shell /bin/bash
It should prompt you for a password and ask you to confirm said password. It may also ask for information such as name, phone number, etc.. but that's up to you as long as the shell is /bin/bash.
If it doesn't require a password when creating the user account, create a password with:
sudo passwd ircd
Switch to the account with:
su ircd
Enter the password you created for the account.
Be sure you're in the ircd user's home directory by running:
cd ~
Now, Unreal must be built from it's distributed source code. Don't worry; it's not as hard as it sounds.
[edit] Downloading
The most recent, stable version of Unreal is 3.2.8.1, which was released on April 13th, 2009[1] as a security fix for version 3.2.8.
- The tarball can be downloaded at one of the following mirrors.
- http://www.unrealircd.com/downloads/unreal/source
- http://unrealircd.icedslash.com/Unreal3.2.8.1.tar.gz (Paris, France)
- http://unreal.brueggisite.de/Unreal3.2.8.1.tar.gz (Erfurt, Germany)
- http://eric.neoturbine.net/Unreal3.2.8.1.tar.gz (Dallas, TX, US)
- Use The Coral Content Distribution Network (suffix the domain with
.nyud.net) to reduce load on UnrealIRCd's mirrors - If you're feeling paranoid make sure you verify checksums.
Still logged in as your ircd user account, you should begin by getting the source code for Unreal from one of the sources listed above. For example:
wget http://unreal.brueggisite.de/Unreal3.2.8.1.tar.gz
If you're a developer-type person, Unreal does have a development SVN [2], but NeoturbineNET isn't currently allowing instances of Unreal 3.3.x or Unreal 4 onto our network.
[edit] Building
Once you've got the source code, you'll want to decompress it (assuming it's in a .tar.gz)
tar xzfv Unreal3.2.8.1.tar.gz
This will create a directory called Unreal3.2 in /home/ircd/.
Switch to this directory by running:
cd Unreal3.2/
Now you can prepare for the compiling by running Unreal's handy guided configuration tool:
./Config
You will see a welcome screen to the UnrealIRCd Configuration Program; hit enter to continue as it says. At this point, the Unreal3.2.8.1 Release Notes will be displayed (e.g. General Information, ChangeLog, and so forth). Simply hit space a few times to scroll through the release notes and eventually it will tell you to hit Enter to continue; do so.
[edit] Pre-Build
At this point, you're creating the settings for how Unreal will be compiled. It's going to ask a few (about twenty) questions. The values in brackets [] are the default values, and in most cases, are acceptable. Simply hitting Enter will accept the default value for the questions; so below, a blank answer means we chose the default value. Items which need a value other than the default are in bold. Our comments begin with a hash mark (#). Answer as follows:
Do you want to enable the server anti-spoof protection? [No] -> Yes What directory are all the server configuration files in? [/home/ircd/Unreal3.2] -> What is the path to the ircd binary including the name of the binary? [/home/ircd/Unreal3.2/src/ircd] -> Would you like to compile as a hub or as a leaf? Type Hub to select hub and Leaf to select leaf. [Hub] -> Hub What is the hostname of the server running your IRCd? # Use an exterior (not LOCAL!) hostname; preferably a dynamic DNS hostname, such as from http://dyndns.org/ or http://www.yi.org [yourlocalhostname] -> yourserver.dyndns.org What should the default permissions for your configuration files be? (Set this to 0 to disable) It is strongly recommended that you use 0600 to prevent unwanted reading of the file [0600] -> Do you want to support SSL (Secure Sockets Layer) connections? [No] -> Yes If you know the path to OpenSSL on your system, enter it here. If not leave this blank [] -> Do you want to enable IPv6 support? # Type "Yes" here if your server/ISP supports IPv6; otherwise, default of No is fine [No] -> Do you want to enable ziplinks support? [No] -> Yes If you know the path to zlib on your system, enter it here. If not leave this blank [] -> Do you want to enable remote includes? [No] -> Do you want to enable prefixes for chanadmin and chanowner? This will give +a the & prefix and ~ for +q (just like +o is @) Supported by the major clients (mIRC, xchat, epic, eggdrop, Klient, PJIRC, irssi, CGI:IRC, etc.) This feature should be enabled/disabled network-wide. [Yes] -> What listen() backlog value do you wish to use? Some older servers have problems with more than 5, others work fine with many more. [5] -> How far back do you want to keep the nickname history? [2000] -> What is the maximum sendq length you wish to have? [3000000] -> How many buffer pools would you like? This number will be multiplied by MAXSENDQLENGTH. [18] -> How many file descriptors (or sockets) can the IRCd use? [1024] -> Would you like any more parameters to configure? Write them here: []->
Once you've answered all the questions, the Config utility will run a bunch of checks and prepare for the actual compiling of Unreal.
Since we asked for SSL support, the Config utility will get to a point about Generating an RSA key. It asks for some information for your security certificate (such as Country Name, State/Province, Locality Name [city], Organization Unit & Name, as well as Common Name).
The only really important thing here is Common Name, which should be the same as that dynamic DNS hostname you put in when you first ran ./Config. This is important!
After this, it will congratulate you on your new certificate, hit Enter to continue.
If all the checks are successful, it will say so and tell you to run make.
If it's unsuccessful (e.g. fails with some sort of error; anything other than "Congratulations!"), visit the NeoturbineNET IRC channel for some help.
[edit] Compiling
Compile Unreal, just like the on-screen message says to, with:
make
This will complete the actual compilation of Unreal. When this step is complete (it can take anywhere from 1 to 30 minute[s], depending on processor speed), Unreal will be installed!
[edit] Configuration
The software configuration needed to get Unreal up and running mostly involves the unrealircd.conf configuration file that Unreal uses to set up all its links, operators (IRCops), and networking.
If you have a firewall, it may need adjusting so that Unreal can play nice with your clients and any servers you plan on linking to.
[edit] unrealircd.conf
The default configuration file (example.conf) that comes with Unreal is a pain to work off of. DO NOT even try to use it!
This section is under construction.
- For now, you can use our pretty, commented UnrealIRCd configuration (mirror) as a template.
- This configuration file is somewhat tailored to the NeoturbineNET network, but we'd like to think that it's useful to anyone interested in Unreal.
UnrealIRCd 3.2 Official Documentation contains in-depth information for all of the configuration file's options.
[edit] Firewall
The ports we recommend unblocking in order to get Unreal working are below.
[edit] What Ports?
- Client ports
- 6667 - De-facto client port.
- 8067 - Alternate port for client connections.
- You don't need to unblock this; it's just a friendly thing to do for people who may be trying to connect from school/work where port 6667 could be blocked.
- 6697 - SSL ("secure") client port. [This is what that whole certificate creation thing was about, in case you were wondering.]
- Server ports
- 7150 - Server linkage port.
- If you're not joining a network and just keeping a standalone server without IRC services or any other servers, then you can keep this port closed.
- If you ARE running services (such as Anope), but it's on the same computer as Unreal, you shouldn't need to unblock 7150 since you'll probably just be linking to localhost.
- 7150 - Server linkage port.
If you're using the example configuration linked in the unrealircd.conf section, unblocking 6667, 6697, 8067, and 7150 is highly recommended.
[edit] iptables
The most common Linux firewall is iptables. The commands to run (as root/with sudo) to unblock the above ports with iptables would be:
iptables -I INPUT -p tcp --dport 6667 -j ACCEPT iptables -I INPUT -p tcp --dport 8067 -j ACCEPT iptables -I INPUT -p tcp --dport 6697 -j ACCEPT iptables -I INPUT -p tcp --dport 7150 -j ACCEPT
[edit] NAT/Port Forwarding
If you're using your home connection and you have a home (wireless?) router such as a Linksys/D-link/Netgear - it's likely that the router is using NAT (Network Address Translation) which will require you to forward ports in the router.
You can get detailed step-by-step instructions on how to forward ports in your router at http://portforward.com/.
- You'll be able to choose your make/model of router, then it should ask for the IP address and service you are interested in forwarding.
- For the IP address, you can run the following command and go with the IP address listed directly after the text "inet addr":
ifconfig | grep 'inet addr' | grep -v '127.0.0.1'
The output will be something like:
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
If the IP address isn't 192.168.x.x, 10.x.x.x, or between 172.16.x.x and 172.31.x.x - you probably don't have NAT and shouldn't worry about any of this section.
- For the service, just choose something like mIRC Chat.
- Instead of the port numbers that portforward.com lists, create rules for each of the ports, listed above in the What Ports? section, that you intend to forward.
[edit] Starting
You'll want Unreal to start on it's own if you plan to have a usable IRC server. The two major ways to have Unreal start are either:
- There's an
ircdchkscript that comes with Unreal that can check if it's running every 10 minutes - Start upon booting the computer
Having both methods setup is even better!
[edit] ircdchk
One way to automatically start Unreal is by using cron with the provided shell script (ircdcron/ircdchk). To add it to the crontab run:
crontab -e
Add this:
0,10,20,30,40,50 * * * * /home/ircd/Unreal3.2/ircdcron/ircdchk >/dev/null 2>&1
This script will check if Unreal is running every 10 minutes. If Unreal isn't running, then the script will start Unreal.
The only problem with this is that if your machine reboots for some reason at 1 minute past the hour, Unreal will be down for nine whole minutes. So, it may be wise to make Unreal start on boot as well.
[edit] Boot-time
Starting Unreal automatically when your computer boots is done by adding a line to your /etc/rc.local file. You will need to be the root user, or at least have sudo privilege to do this.
Add the following line to the /etc/rc.local file, making sure that it comes above the "exit 0" line - if there is one.
su -c /home/ircd/Unreal3.2/src/ircd ircd
If your rc.local file doesn't exist in /etc/ - it probably has the same name, just somewhere else. Try running the command locate rc.local (as root/with sudo) to find it and replace /etc/ in the command above with the path to your rc.local file.
Unreal should be coming up on it's own, whether it be at boot or from the ircdchk script within 10 minutes.

