Creare un server IRC con UnrealIRCd e Anope
Indice |
Introduzione
Quseto tutorial spiega come installare e configurare un server IRC utilizzando UnrealIRCd.
Verrà spiegato anche come installare i servizi IRC (NickServ, ChanServ, etc) che verranno forniti da Anope IRC services.
Componenti necessari
Servono:
- GNU/Linux Slackware ;-)
- Diritti di root nella macchina su cui andremo ad installare;
- Un po' di tempo.
Preparazione
Permessi e cartelle
Creo il gruppo e l’utente:
# groupadd ircadmin # useradd -d /home/ircadmin -g ircadmin -s /bin/bash ircadmin
Ora creo le cartelle dove verranno memorizzati gli eseguibili e la configurazione:
# mkdir /home/ircadmin # cd /home/ircadmin # mkdir bin # mkdir conf
Download dei sorgenti
Scarico ed estraggo i sorgenti di UnrealIRCd e Anope:
# cd /home/ircadmin # wget -c http://unreal.brueggisite.de/Unreal3.2.8.1.tar.gz # wget -c http://downloads.sourceforge.net/project/anope/anope-stable/Anope%201.8.2/anope-1.8.2.tar.gz # tar xzvf Unreal3.2.8.1.tar.gz # tar xzvf anope-1.8.2.tar.gz
UnrealIRCd
Configurazione
Spostiamoci nella directory contenente i sorgenti e lanciamo lo script di configurazione:
# cd Unreal3.2 # ./Config
Questo script mostrerà questa schermata alla quale bisogna premere invio, successivamente mostra la licenza... basta premere q e poi invio:
_ _ _ ___________ _____ _ | | | | | |_ _| ___ \/ __ \ | | | | | |_ __ _ __ ___ __ _| | | | | |_/ /| / \/ __| | | | | | '_ \| '__/ _ \/ _ | | | | | / | | / _ | | |_| | | | | | | __/ (_| | |_| |_| |\ \ | \__/\ (_| | \___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_| Configuration Program for Unreal3.2.8.1 This program will help you to compile your IRC server, and ask you questions regarding the compile-time settings of it during the process. regarding the setup of it, during the process. If you have problems regarding the setup & compile, read Unreal.nfo to get more information on where to get help. Please, before running this setup, read the documentation in the "doc" folder. Docs are also avail online @ http://www.unrealircd.com/unreal32docs.html [Enter to continue]
Verranno ora richieste alcuni dati di configurazione:
Many older operating systems have an insecure TCP/IP stack which may be vulnerable to IP spoofing attacks, if you run an operating system that is vulnerable to such attacks enable this option. This option can also be useful to prevent blind proxies from connecting (eg: HTTP POST proxies). Do you want to enable the server anti-spoof protection? [No] -> Yes What directory are all the server configuration files in? [/home/ircadmin/Unreal3.2] -> /home/ircadmin/conf What is the path to the ircd binary including the name of the binary? [/home/ircadmin/Unreal3.2/src/ircd] -> /home/ircadmin/bin/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? [virgilio] -> virgilio 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] -> 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 [] -> <ENTER> Do you want to enable IPv6 support? [No] -> 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 [] -> <ENTER> Do you want to enable remote includes? [No] -> 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] -> 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] -> 5 How far back do you want to keep the nickname history? [2000] -> 2000 What is the maximum sendq length you wish to have? [3000000] -> 300000 How many buffer pools would you like? This number will be multiplied by MAXSENDQLENGTH. [18] -> 18 How many file descriptors (or sockets) can the IRCd use? [1024] -> 1024 Would you like any more parameters to configure? Write them here: []-> <ENTER>
Finita la configurazione chiederà altri dati:
Country Name [US]:IT State/Province [New York]:Italy Locality Name (eg, city) []:Cagliari Organization Name (eg, company) [IRC geeks]:<ENTER> Organizational Unit Name (eg, section) [IRCd]:<ENTER> Common Name (Full domain of your server) []:virgilio Generating self-signed certificate .. /usr/bin/openssl req -x509 -days 365 -in server.req.pem \ -key server.key.pem -out server.cert.pem Generating fingerprint .. /usr/bin/openssl x509 -subject -dates -fingerprint -noout \ -in server.cert.pem subject= /C=IT/ST=Italy/L=Cagliari/O=IRC geeks/OU=IRCd/CN=eikichi notBefore=Sep 10 07:58:00 2009 GMT notAfter=Sep 10 07:58:00 2010 GMT SHA1 Fingerprint=67:0B:4F:1B:1E:A6:14:36:B8:59:B1:39:55:81:0A:5C:C8:99:75:07 Setting o-rwx & g-rwx for files... chmod o-rwx server.req.pem server.key.pem server.cert.pem chmod g-rwx server.req.pem server.key.pem server.cert.pem Done!. If you want to encrypt the private key, run make encpem |-------------------------------------------------------------------------| | Congratulations on your new SSL self-signed certificate for your IRCd. | | However, wouldn't it be better that you get your certifcate signed by | | some kind of Certification Authority (CA), so your users can check that | | they are really connected to the real server, so they feel secure? | | | | There is an initiative at CACert.org - They offer SSL Certificates | | for use with your IRCd for free, so your users can be sure that they | | can trust you and your server. | | | | To get a free signed certificate please visit http://www.CACert.org | | _________________________| | | Press enter to continue | --------------------------------------------------------------------------- ________________________________________________________________________ | | | UnrealIRCd Compile-Time Config | |_______________________________________________________________________| |_______________________________________________________________________| | | | Now all you have to do is type 'make' and let it compile. When that's | | done, you will receive other instructions on what to do next. | | | |_______________________________________________________________________| |_______________________________________________________________________| | - The UnrealIRCd Team - | | | | * Stskeeps stskeeps@unrealircd.com | | * codemastr codemastr@unrealircd.com | | * Syzop syzop@unrealircd.com | |_______________________________________________________________________|
Compilazione
Lanciamo la compilazione e l’installazione con:
# make # make install # cd ~ircadmin/conf/ # ln -s $(pwd)/unreal ~ircadmin/bin/unreal
Ultimi ritocchi
Infine è necessario copiare i seguenti file:
# cp -R ~ircadmin/Unreal3.2/src/modules ~ircadmin/conf/
Anope
Configurazione
Passiamo alla configurazione e installazione di Anope:
# cd ~ircadmin/anope-1.8.2/ # ./Config
Anche questo chiederà alcuni dati di configurazione:
___
/ _ \ http://www.anope.org
| /_\ | _ __ _ _ _ _ ___
| _ || '_ \/ _ \/ _ \ / _ \
| | | || | | |_| |_| | __/
|_| |_||_| |_\___/| _/ \___|
| |
|_| IRC Services
1.8.2
This program will help you to compile your Services, and ask you
questions regarding the compile-time settings of it during the
process. For more options type ./Config --help
Anope is a set of Services for IRC networks that allows users to
manage their nicks and channels in a secure and efficient way,
and administrators to manage their network with powerful tools.
For all your Anope needs please visit our portal at www.anope.org
Beginning Services configuration.
Note: press Return for the default, or enter a new value.
In what directory do you want the binaries to be installed?
[/root/services] /home/ircadmin/services
/home/ircadmin/services does not exist. Create it?
[y] y
Where do you want the data files to be installed?
[/home/ircadmin/services]<ENTER>
Which group should all Services data files be owned by? (If Services
should not force files to be owned by a particular group, just press
Return.)
[]<ENTER>
What should the default umask for data files be (in octal)?
(077 = only accessible by owner; 007 = accessible by owner and group)
[077]<ENTER>
Allow anope to automatically check for mysql libaries?
unless you get errors with make, there is no need to
change this setting.
[yes]<ENTER>
Compilazione
Compiliamo con:
# make # make install
Ultimi ritocchi
Infine re-impostiamo i permessi:
# cd ~ircadmin/ # chown -R ircadmin:ircadmin ./
Script di avvio
Inseriamo gli script per l’avvio automatico:
/etc/rc.d/rc.unreal
#!/bin/bash
DIR="/home/ircadmin/bin"
PROG="unreal"
case "$1" in
"start" | "stop" )
su ircadmin -c "cd ${DIR} && ${DIR}/${PROG} $1"
sh /etc/rc.d/rc.anope $1
;;
*)
echo "Usage: $(basename $0) start|stop"
;;
esac
/etc/rc.d/rc.anope
#!/bin/bash
DIR="/home/ircadmin/services"
PROG="services"
case "$1" in
start)
su ircadmin -c "cd ${DIR} && ${DIR}/${PROG}"
;;
stop)
for ITEM in $( ps aux | grep services | grep -v 'grep' | awk '{print $2}' ); do
kill -9 ${ITEM} > /dev/null 2>&1
done
;;
*)
echo "Usage: $(basename $0) start|stop"
;;
esac
/etc/rc.d/rc.local
Modifico il file /etc/rc.d/rc.local aggiungendo le seguenti righe:
if [ -x /etc/rc.d/rc.unreal ]; then
/etc/rc.d/rc.unreal start
fi
Credits
- Autore: Luca Cireddu
- Ultima revisione: 10-09-2009