El hidrógeno es un gas ligero e inodoro que, con el tiempo suficiente, se convierte en gente. Anónimo

Unreal3.2.8 (irc)

2010-01-06 20:38:46-06                  Esta entrada ha sido vista 171 veces.

Miscelania

irc log

Hace tiempo tuve que montar un servidor irc, y ahora que por asares del destino vuelvo a necesitarlo dejo un pequenio tutorial por si a alguien mas se le ofrece.

Bien, para el ejemplo estare usando freebsd, pero vamos esto se puede hacer en cualquier maquina y en cualquier sistema operativo, incluyendo a windows.

Lo primero que tenemos que hacer es descargarnos el paquete que ara de servidor, asi como para http esta apache, cherokee, lightttp, nginx, etc y como para ftp hay filezilla, serv-u (el de las revistas de hack-X-crack), pureftp, etc. Para irc tambien hay software disponible como:

Bahamut
InspIRCd
Etc

Las redes como dalnet, undernet, freenode, etc, tienen muchos de estos demonios (bueno, usan sus propios programas) corriendo en varias maquinas y estas se sincronizan entre ellas para que todos puedan comunicarse simultaneament e, asi que si una maquina se cae, la red se puede seguir comunicando (obviamente los que hayan estado conectados a ese servidor perderan la conexion), sin embargo, si asi lo requerimos (o no tenemos muchas maquinas) todo esto se puede hacer desde una sola computadora, que es el ejemplo que veremos.

$ wget http://unreal.brueggisite.de/Unreal3.2.8.tar.gz
$ untar zxvf Unreal3.2.8.tar.gz
$ cd Unreal3.2.8/ 
$ ./Config      (observen como en lugar de ./configure se utiliza ./Config)

Les saldra un letrero como este:
_   _                      _ ___________  _____     _
| | | |                    | |_   _| ___ \/  __ \   | |
| | | |_ __  _ __ ___  __ _| | | | | |_/ /| /  \/ __| |
| | | | '_ \| '__/ _ \/  _ | | | | |    / | |    /  _ |
| |_| | | | | | |  __/ (_| | |_| |_| |\ \ | \__/\ (_| |
 \___/|_| |_|_|  \___|\__,_|_|\___/\_| \_| \____/\__,_|

                               Configuration Program
                                for Unreal3.2.8
                                    
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]
 

Le dan enter y continuan...

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] ->

Respondemos Yes y continuamos...

What directory are all the server configuration files in?
[/usr/home/chilicuil/Unreal3.2.8] ->

Aqui pongan lo que quieran, pero recuerden que deben tener permisos de escritura sobre ese directorio, ya despues pueden cambiarlos, para que nadie mas tenga acceso a ellos, en mi caso utilice: /usr/local/etc/Unreal3.2.8

What is the path to the ircd binary including the name of the binary?
/usr/local/etc/Unreal3.2.8/src/ircd] ->

Le damos enter

Would you like to compile as a hub or as a leaf?
Type Hub to select hub and Leaf to select leaf.
[Hub] ->

Hub se refiere a "lider", mientras que "leaf" vendrian siendo los repetidores, se acuerdan que les dije que una red como dalnet estaba compuesta de muchas computadoras?, pues bueno, una de ellas es la que ordena a las demas como organizarse, ese es el hub, como nosotros solo montaremos una sola maquina esta sera la 'Hub', cualquier otra duda, chequen la documentacion.

Bien, entonces damos enter y continuamos...

What is the hostname of the server running your IRCd?
[fulano] ->

Aqui pueden ponerle lo que quieran, pero debe ser algo que tenga mas o menos logica, por ejemplo yo lo monte este servidor para el dominio josefina.zapto .org entonces aqui puse irc.josefina.z apto.org ven como solo se le agrega el "irc" adelante? si tienen problemas para decidir un nombre, solo denle enter.

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] ->

Le damos enter

Do you want to support SSL (Secure Sockets Layer) connections?
[No] ->

Si le ponen que si, entonces tendran que crear un certificado, aqui le daremos que "yes", aunque si para uso personal podria perfectamente No y no tendrian ningun problema, todo depende del nivel de paranoia.

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

Le dan enter, ya nos encargaremos mas tarde de esto.

Do you want to enable IPv6 support?
[No] ->

Le dan enter a menos que sepan que su red/equipo/so lo soporta

Do you want to enable ziplinks support?
[No] ->

Esto sirve para comprimir la comunicacion entre los servidores y asi disminuir el trafico, como solo estamos montando 1, le damos enter (por default no lo habilita), pero no olviden que aqui esta la opcion.

Do you want to enable remote includes?
[No] ->

Ijole, esta opcion quien sabe para que sea, bueno la dejamos como esta, no vaya a ser que la reguemos,

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] ->

Esta cosa, solo sirve para cambiar el "look" de los operadores, le damos enter (como ven, ya viene practicamente configurado por su cuenta, en la mayor de los casos solo hay que ir dando enter.

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] ->

Ponemos 10 y le damos enter

How far back do you want to keep the nickname history?
[2000] ->

Enter, o pueden cambiarle a 1000, total se supone que es semipersonal

What is the maximum sendq length you wish to have?
[3000000] ->

Enter

How many file descriptors (or sockets) can the IRCd use?
[1024] ->

Por default en freebsd tendran problemas, porque el kernel limita a 980 procesos por default (recuerdan las bombas fork?), asi que cambienlo a 800 y ponganle enter, si han modificado /etc/security/limits.conf  vean que no sobrepase el limite.

Would you like any more parameters to configure?
Write them here:
[]->

Si han leido la documentacion y tienen alguna otra cosa que agregar, ahora es el momento, de lo contrario solo denle enter.

Veran algo parecido a esto:

./configure --with-showlistmodes --enable-nospoof --enable-hub --enable-ssl --enable-prefixaq --with-listen=5 --with-dpath=/usr/home/chilicuil/Unreal3.2.7 --with-spath=/usr/home/chilicuil/Unreal3.2.7/src/ircd --with-nick-history=2000 --with-sendq=3000000 --with-bufferpool=18 --with-hostname=fulano --with-permissions=0600 --with-fd-setsize=800 --enable-dynamic-linking
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler..

Ya se esta configurando, facil no?, esperamos unos momentos... Si habilitaron ssl (security socket layer) entonces veran algo como esto, solo sigan las instrucciones y no hay pierde:

Generating certificate request ..
/usr/bin/openssl req -new  -config src/ssl.cnf -out server.req.pem  -keyout server.key.pem -nodes
Generating a 1024 bit RSA private key
.............. .............. ........++++++
............++++++
writing new private key to 'server.key.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name [US]:

En mi caso, pongo MX (mexico) y asi se van, hasta que obtengan esto:

|-------------------------------------------------------------------------|
| Congratulation s 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 |
---------------------------------------------------------------------------

Listo, ya tienen un certificado firmado por ustedes mismos -.-', si quieren tener "mas seguridad" vayan http://www.CACert.org y sigan las instrucciones de aca: https://www.cacert.org/help.php?id=6

Regresando a la configuracion, ya les abra salido un letrero como este:

______________ ______________ ______________ ______________ ______________ _
|                                                                       |
|                    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                                      |
|_______________________________________________________________________|

Compilamos:

$ make

Esto puede tomarles de 10 a 30 minutos...

______________ ______________ ______________ ________ 
| Compile is now complete.                         |
| You should now read the documentation and learn  |
| how to configure your IRCd.                      |
|                                                  |
| If you really like UnrealIRCd, and would like to |
| make a donation, please read the Donation file in|
| this archive.                                 |
|                                                  |
| Thanks for using Unreal IRCd! If you are in need |
| for any kind of help regarding the IRCd please   |
| read the Unreal.nfo file.                        |
|__________________________________________________|

Esto significa que han compilado con exito su demonio de irc, solo falta configurarlo, para hacer esto, hagan una copia del archivo doc/example.conf, adicionalmente podriamos instalarlo (make install), pero esto a mi consideracion abre las puertas para que todos puedan usarlo, y en mi opinion con un servidor basta y sobra.

$ cp doc/example.conf unrealircd.conf

Y comiencen a configurarlo, debe quedar claro que si no lo modifican el servicio no funcionara, aqui les menciono las partes mas importantes.

include "help.conf";
/*
include "badwords.chann el.conf";
include "badwords.messa ge.conf";
include "badwords.quit. conf";*/
include "spamfilter.con f";
include "sysusers.conf";
include "servers.conf";
/*

Hay que descomentar los anteriores include

/*
 * NEW: me {}
 * OLD: M:Line
 * me {} defines the name, description and unreal server numeric for
 * this server. Syntax is as follows:
 * me {
 *  name "server.name";
 *  info "Server Description";
 *  numeric (server numeric*);
 * };
 * If linking, this numeric may not be used by any other server on the network.
 */
me
{
    name "josefina.zapto .org";
    info "josefina inc";
    numeric 1;
};

Aqui va su dominio e informacion extra, comparen estos datos con su archivo doc/example.conf y llenenlo.

listen         *:6697
{
    options
    {
    /*  ssl;*/
        clientsonly;
    };
};

listen         *:8067;
listen         *:6667;

Dependiendo de como hayan configurado su servidor comenten o descomenten la parte de ssl, clientonly, zlink, etc.

ulines {
    services.josefina.zapto.org;
    stats.josefina.zapto.org;
};

Solo agregenle su dominio a services y a stats

set {
    network-name        "JSNet";
    default-server      "josefina.zapto .org";
    services-server     "services.josef ina.zapto.org";
    stats-server        "stats.josefina .zapto.org";
    help-channel        "#help";
    hiddenhost-prefix   "hidden";
    /* prefix-quit      "no"; */
    /* Cloak keys should be the same at all servers on the network.
     * They are used for generating masked hosts and should be kept secret.
     * The keys should be 3 random strings of 5-100 characters
     * (10-20 chars is just fine) and must consist of lowcase (a-z),
     * upcase (A-Z) and digits (0-9) [see first key example].
     */
    cloak-keys {
        "aoAr1HnR6gl3sJ 7hVz4Zb7x4YwpW ";
        "90jioIOjhiUIOH 877h87UGU898hg F";
        "IOjiojiio8990U HUHij89KJBBKU8 98";
    };
    /* on-oper host */
    hosts {
        local       "locop.josefina .zapto.org";
        global      "ircop.josefina .zapto.org";
        coadmin     "coadmin.josefi na.zapto.org";
        admin       "admin.josefina .zapto.org";
        servicesadmin   "csops.josefina .zapto.org";
        netadmin    "netadmin.josef ina.zapto.org";
        host-on-oper-up "no";
    };
};

Llenenlo segun sea su caso, recuerden que las "cloak-keys" deben ser diferentes, para poder escoder de forma adecuada las ips de sus clientes, no queremos que otros a parte de nosotros puedan la ip de los clientes que se conecten, jeje.

set {
    kline-address "fco.plj@gmail.com";
    modes-on-connect "+ixw";
    modes-on-oper    "+xwgs";
    auto-join "#cph";
    oper-auto-join "#operadores";
    options {
        hide-ulines;
        /* You can enable ident checking here if you want */
         identd-check;
        show-connect-info;
    };

Igual llenenlo segun sea su caso, esto solo tomenlo como un layout general. Despues de haber terminado, por fin sera momento de ejecutarlo.

./unreal start

No paren hasta que vean un letrero como este:

Starting UnrealIRCd
_ _ _ ___________ _____ _
| | | | | |_ _| ___ \/ __ \ | |
| | | |_ __ _ __ ___ __ _| | | | | |_/ /| / \/ __| |
| | | | '_ \| '__/ _ \/ _` | | | | | / | | / _` |
| |_| | | | | | | __/ (_| | |_| |_| |\ \ | \__/\ (_| |
\___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
v3.2.6
using TRE 0.7.2 (GPL)
using OpenSSL 0.9.8d 28 Sep 2006
using zlib 1.2.3

* Loading IRCd configuration ..
* Configuration loaded without any problems ..
* Initializing SSL.
* Dynamic configuration initialized .. booting IRCd.
---------------------------------------------------------------------


Deben verificar que no tenga ni un error, abran su cliente favorito, pidgin, xchat, irssi, etc. y conectense si pueden ver un letrero que les da la bienvenida ya lo han logrado, ahora hay que agregarlo al arranque de su computadora, asi cada vez que inicie/reinicie, el servidor correra por su cuenta, tambien es una buena idea agregarlo al cron para que en caso de que se pare por cualquier motivo, se recupere solito.

# cp /usr/local/etc/Unreal3.2.8/unreal    /etc/rc.d/

O en caso de linux hay que copiarlo al nivel adecuado, en la mayoria de las distribuciones el 5 es el bueno.

# cp /usr/local/etc/Unreal.3.2.8/unreal    /etc/init.d/ # ln -s /etc/init.d/unreal   /etc/rc5.d/ $ crontab -e

Entraran a un editor, probablemente sea vi, y deberan pegar esto:

*/2 * * * * /usr/local/etc/Unreal3.2.7/ircdcron/ircdchk >/dev/null 2>&1

Listo a otra cosa.

Permalink: http://www.mononeurona.org/entries/view/chilicuil/2033


Comments Commentblogs:
1.- rnstux wrote:

Documentar es lo mejor que puedes hacer!! La pinche memoria humana se chinga despues de un rato.

Saludos chilicuil buen Post!

2010-01-06 21:53:47-06
2.- asarch wrote:

Deberia de existir una opción de "Versión PDF" de cada post.

Que mejor que leer mientras estás concentrado y sin interrupciones (además de las anotaciones que le podrías hacer al post).

Excelente post chilicuil.

2010-01-06 23:02:21-06
3.- saidjose wrote:

Excelente tutorial chilicuil, la verdad una muy buena forma de hacerce de un irc

2010-01-07 11:34:44-06
4.- chilicuil wrote:

Gracias por sus comentarios, saludos rnstux, asarch, saidjose o/

2010-01-07 13:38:52-06
5.- azimov wrote:

Ese asarch siempre con ideas geniales...sería excelente, y a como está la situación imaginense: Sincronizar todo en uno, desde noticias, sus feeds, correos, etc, etc, sin servicios para cada cosa que es lo que ya hay...y eso incluye descargar versiones de PDF para ciertos artículos y blogs. Tomaría unos minutos descargartelo, si ayudaría si no tienes conexión pemanente.

Que se yo, sólo divagué...saludos y buen post chilicuil!!!

2010-01-07 15:08:36-06
New Commentblog
CAPTCHA Image




Join us!
Forgot your password?
This blog has been visited
18,867 times
chilicuil
A random 26 years old guy living at México city
Powered by
Despabilando la MonoNeurona.org
Livechat
<-Nombre

reiken wrote:
http://tinyurl.com/782vp5u
4 days, 4 hours ago

e17_easy wrote:

on 26/10/11

chilicuil wrote:
musica, videos y programas chingones!
on 8/3/11

chilicuil wrote:
claro que si!, http://rockerboymexico.blogspot.com/
on 8/3/11

rockerboy wrote:
q onda!! chilicuil!!! pon un link de mi blog!!!
on 18/12/10

chilicuil wrote:
Vara, $250 porque puse como pretexto que era estudiante :&#41;, en realidad eran $350
on 21/2/08

aarkerio wrote:
Cuánto te costo el CONSOL?
on 20/2/08

scarecrow wrote:
Bienvenido!
on 19/1/08


clonando discos
2 weeks ago
xD
on 4/1/12
feliz año nuevo MNes, cuendo sea viejo y decrepito les contare historias a mis nietos sobre los MNes, vamos por uno mas.., 2012, alla vamoooos __~~~o/
on 31/12/11
jajaja, es cierto @aarkerio, sobrevivimos!
on 20/12/11
gracias por las recomendaciones, aplique la del caldo de pollo, sin embargo creo que voy a peor, es lo malo cuando no te enfermas todo el año y el karma te cobra todas juntas al final
on 20/12/11
con dolor en la garganta, creo que morire en mi cama, @vendaval xD, no se si reir o llorar, creo que poco a poco me voy convirtiendo en un sysadmin
on 17/12/11
asi es, a mi me desperto
on 10/12/11
jajajaja @rnstux eso te pasa por no usar ubuntu ;), xD, ntc
on 1/12/11
que le paso al anterior @humusanito?
on 30/11/11
@aakerio ok, no lo habia visto x.x
on 30/11/11
FirefoxjEdit.orgGimpOpenOffice.orgHacker
Top
Colectivo MonoNeurona.org © 2002-2011.