Monthly Archives: May 2013

Own IRC Server on Debian with Anope and MySQL

** Pre-Installation **

First, download the UnrealIRCd source, located hier


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

gpg --keyserver --recv-keys 0x9FF03937
gpg --verify Unreal3.2.10.1.tar.gz.asc Unreal3.2.10.1.tar.gz

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

tar zxvf Unreal3.2.10.1.tar.gz

** 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:


… answers to questions that ask configurator …
with SSL support!
And type make

** Anope **
Download Anope Services.

Decompress them
tar zxvf anope-1.8.8.tar.gz

Change to anope directory and start the installation:
cd anope-1.8.8

Configuration answers:

install binaries to? I suggest /path/to/Unreal3.2.10.1/services
create dir? yes
install data files to? hit enter
group? hit enter
default umask? hit emter
MD5 passwd encryption? no (unless you really want it)
auto-check for mysql libs? hit enter

Type make and make install to complete the compilation process
When everything is done, cd to the services directory and copy the example conf:

cd /path/to/Unreal3.2.10.1/services
cp example.conf services.conf
Open services.conf in your favorite editor and modify/add these values:
IRCDModule "unreal32"
RemoteServer 6667 "services"
ServerName ""
ServicesRoot "YourNicknameHere"

** Configuration **
Copy the example configuration file
cd Unreal3.2.10.1/
cp doc/example.conf unrealircd.conf

Lines that start with # are my comments so you don’t have to add them to the config file.

/* FOR *NIX, uncomment the following 2lines: */
loadmodule "src/modules/";
loadmodule "src/modules/";

Set your IRCD info:

name "";
info "your IRC network name";
numeric 1;

Show users you’re the admin

admin {
"Your Name";
"Your Nickname";

Add an O:Line for yourself
You can edit the one already there
O:Lines define the IRCops

oper YourNickHere {
class clients;
from {
userhost *@*;
password "YourPassHere";
g lobal;

Add a C/N Line for IRC Services
Don’t edit the link block already there.
C/N Lines allow other IRCDs or IRC Services to link with you

   username   *;
   bind-ip    *;
   port       7070;
   hub             *;
   password-connect "password";
   password-receive "password";
   class           servers;
   options {
listen         *:6697

listen *:7070
	username	*;
	bind-ip 	*;
	port 		7029;
	hub             *;
	password-connect "password";
	password-receive "password";
	class           servers;
		options {
			/* Note: You should not use autoconnect when linking services */

You can edit the ulines block already there

ulines {;;

Network configuration is the most important part
You can use the block already there

/* Network configuration */
set {
network-name "YourNetworkNameHere";
default-server "";
services-server "";
stats-server "";
help-channel "#help";
hiddenhost-prefix "hidden";
/* prefix-quit "no"; */
/* Cloak keys should be the same at all servers on the network.
/* [..etc..]
cloak-keys {
/* on-oper host */
hosts {
local "";
global "";
coadmin "";
admin "";
servicesadmin "";
netadmin "";
host-on-oper-up "no";

Server configuration
You can edit the block already there

/* Server specific configuration */
set {
kline-address "";
auto-join "#lobby";
modes-on-connect "+ixw";
modes-on-oper "+xwgs";
oper-auto-join "#opers";
dns {
nameserver Your.DNS.IP.Here;
timeout 2s;
retries 2;

** Anope
Corrected that but in services.conf where i had:

RemoteServer 7070

MysqlHost “”
MysqlUser “user”
MysqlPass “pass”
MysqlName “anope”
MysqlSock “/tmp/mysql.sock”
MysqlPort 3306

and import tables.sql to mysql

Save and close the config file
Start Anope IRC Services with debug mode enabled in order to spot:

./services -debug -nofork

If the services didn’t show any errors in the console and connected (and stayed connected) to the IRC server, it’s safe to run them normally:


Start your new IRCD server by typing:

./unreal start

Nginx proxy_pass

From to

  1. server {
  2. #  listen;
  3.    server_name;
  4.    access_log  /var/log/nginx/access.log;
  5.    error_log   /var/log/nginx/error.log;
  7.    location / {
  8.         proxy_pass;
  9.         proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
  10.         proxy_redirect off;
  11.         proxy_buffering off;
  12.         proxy_set_header        Host  ;
  13.         proxy_set_header        X-Real-IP       $remote_addr;
  14.         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
  15.     }
  16. }

FIX ping: command not found

root@nsa310:~# ping
-bash: ping: command not found

here is simple solution

# aptitude install inetutils-tools inetutils-ping

test it

root@nsa310:~# ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.128 ms
64 bytes from icmp_seq=1 ttl=64 time=0.091 ms
^C--- ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.091/0.110/0.128/0.000 ms