Build An IRC Server With IRCD
Build An IRC Server With IRCD
1. About IRC
2. Prerequisites
9. Step 7 - Testing
10. Conclusion
This tutorial shows the installation of an IRC server with IRCD-Hybrid and Anope on Ubuntu
15.04 and how to secure the IRC connections with SSL.
About IRC
IRC (Internet Relay Chat) is a text-based chat protocol which has an open specification. There
are several IRC servers and clients available which implement IRC.
Anope is a set of IRC Services that provides flexibility and ease of use with support for 15
IRCds including IRCD-Hybrid. Anope is available in 2 versions: Stable and Development. We
will use the Stable version here.
Prerequisites
An Ubuntu 15.04 server, I will use the IP 192.168.1.109.
Root Privileges
4. Configure IRCD-Hybrid.
7. Testing.
sudo su
cd ~
wget http://prdownloads.sourceforge.net/ircd-hybrid/ircd-hybrid-8.2.8.tgz
tar -xzf ircd-hybrid-8.2.8.tgz
cd ircd-hybrid-8.2.8
3. Now before you compile and install the software, you have to set a directory for ircd, and the
user to run the software. This what i will do:
Install ircd-hybrid under user "mavis".
If you dont have a user "mavis" yet, add one with the command:
adduser mavis
Now run this command with "root" privileges to configure and compile ircd:
./configure --prefix=/home/mavis/hybrid
make && make install
Now go to the mavis home directory and change the owner of the "hybrid" directory.
cd /home/mavis
chown -R mavis:mavis hybrid
sudo su
cd ~
wget https://github.com/anope/anope/releases/download/2.0.2/anope-2.0.2-source.tar.gz
tar -xzf 2.0.2.tar.gz
cd anope-2.0.2-source/
3. And compile and install anope. These are the same steps that we used to install ircd-hybrid. I
will install it under user "mavis" as well into the directory "services".
./Config
and you will be asked "where do you want to install" anope. Enter the following
directory "/home/mavis/services/" and then press "Enter".
Next enter the "build" directory and then use a command "make && make install" to compile
and install anope services.
cd build
make && make install
When the installation is complete, go to the mavis home directory and change the owner for
directory "services" to user "mavis".
cd /home/mavis/
chown -R mavis:mavis services/
cd ~/hybrid/bin
./mkpasswd
type your password
2. Now switch to user mavis to configure ircd-hybrid. Please go to the directory "hybrid/etc/"
and copy a file "reference.conf" to a new file "ircd.conf".
su - mavis
cd hybrid/etc/
cp reference.conf ircd.conf
3. Edit the file ircd.conf with the vim editor.
vim ircd.conf
Go to line 40 - the serverinfo block - and change it to your server info, below my example:
name = "mavis.local";
description = "ircd-hybrid Mavis server";
network_name = "MavisNet";
network_desc = "This is Mavis Network";
and in the auth block on line 428, comment "flag" the option:
# flags = need_ident;
and set the oprator or admin for irc server in line 437 :
And finally you have to "define a server to connect to" in the connect block line 566. The
configuration is use by ircd-hybrid for the connection to anope :
name = "services.mavis.local";
host = "192.168.1.109"; #server ip
send_password = "12345"; #use your password
accept_password = "12345";
port = 6666;
cd ~/hybrid/bin/
./ircd
Try connect to your IRC server with an IRC client like mIRC, hexchat or xchat.
/server 192.168.1.109
su - mavis
cd ~/services/conf
cp example.conf services.conf
2. Edit the configuration file with the vim editor.
vim services.conf
Edit the uplink block in line 154 - this is used by anope for the connection to ircd. Make sure
this configuration matches with connect block in the ircd configuration.
#Server IP
host = "192.168.1.109"
port = 6666
#default port is 7000
password = "12345"
Then change the serverinfo block in line 198 and make sure it is matches with the connect
block in the ircd-hybrid configuration.
name = "services.mavis.local"
Finally you have to define the ircd software that you use in the module block in line 260.
Change "inspircd20" to "hybrid".
name = "hybrid"
cd ~/services/bin
./anoperc start
Now you can check that the anope services are connected with ircd-hybrid. Connect to the IRC
server and check with this command:
/whois ChanServ
Step 6 - Add SSL to IRCD-Hybrid
1. Before you edit the ircd-hybrid configuration, you have to generate a SSL certificate for ircd.
Please go to the "hybrid/etc/" directory.
cd ~/hybrid/etc/
And generate a private rsa.key with the openssl command, change the permission to 600 with
chmod:
Now generate the SSL certificate for the encrypted client connection with our rsa.key private
key:
openssl req -new -days 365 -x509 -key rsa.key -out cert.pem
cd ~/hybrid/etc/
vim ircd .conf
And finally you have to comment the host in the listen block at line 353.
# host = "192.168.0.1";
killall ircd
~/hybrid/bin/ircd
~/services/bin/anoperc start
Step 7 - Testing
Try to connect to your IRC server with an IRC client, I'll be using Hexchat here and see what
happens:
Conclusion
Internet Relay Chat(IRC) is an open (client/server) protocol for text-based chats, it is one of the
foundations of the internet and still used by many developers and sysadmins. The IRC Server is a
computer/server running an IRC daemon, the IRC client is a small program that the user can
install on their system as chat client. IRCD-Hybrid is an lightweight and easy to configure IRC
Daemon with support for SSL connections to secure the IRC network. Anope is a set of services
for IRC Networks. With anope you can easily manage your IRC network. IRCD-Hybrid, Anope
and SSL are one of the best solutions to build your own IRC Server.