Unreal IRCd Setup - Инсталиране на Unreal IRCd сървър върху *nix платформи .

Ако ви се е повредил Windows, не знаете какво да правите с Linux или не знаете как се правят аквариуми - това е мястото за вас
Аватар
LuD
The Sinner's Priest ;-]
The Sinner's Priest ;-]
Мнения: 205
Регистриран на: 10 Окт 2012 15:44
Местоположение: Sofia
Обратна връзка:

Unreal IRCd Setup - Инсталиране на Unreal IRCd сървър върху *nix платформи .

Непрочетено мнение от LuD »

Как да инсталирате Unreal... Влезте във вашата home директория.

$ cd

Можете да вземете IRCD-то от тук.

$ wget -cb http://download.freeunibg.eu/
Continuing in background, pid 214.
Output will be written to `wget-log'.

Ако нямате wget изтеглете го с lynx или каквото си искате. След това просто дезархивирайте и влезте в директорията, която направи.

$ tar zxf Unreal3.2-beta9.tar.gz
$ rm -f Unreal3.2-beta9.tar.gz
$ cd Unreal3.2/

Ако използвате система различна от Linux трябва да дезархивирате source-а като напишете:

$ gzip -d Unreal3.2-beta9.tar.gz
$ tar -xf Unreal3.2-beta9.tar
$ rm -f Unreal3.2-beta9.tar
$ cd Unreal3.2/

Сега да стартираме configure script-а (не би трябвало да покаже никакви грешки, но ако все пак покаже обърнете се към webmaster секцията за помощ).

$ ./configure
creating ./config.status
creating Makefile
creating src/modules/Makefile
creating unreal
creating include/setup.h

До тук добре :) Сега трябва да редактираме файловете в директорията include/.

$ cd include/

След това редактирайте с важия любим текстов редактор (не говоря за vi, пробвайте с mcedit ;)) Можете да конфигурирате като пуснете ./Config script-а от user директорията, но ние не харесваме много тези script-ове. Taka че ще ви покажем как става със script и на ръка.

НА РЪКА:

$ mcedit config.h

Ако използвате services тук трябва да зададете nick-овете на services.

#define ChanServ "ChanServ"
#define MemoServ "MemoServ"
#define NickServ "NickServ"
#define OperServ "OperServ"
#define HelpServ "HelpServ"
#define StatServ "StatServ"
#define InfoServ "InfoServ"
#define BotServ "BotServ"

Aко искате да смените порта, който се изпозва по подразбиране::

#define PORTNUM 6667

Напишете id и вижте какво дава в uid= и gid=.

$ id
uid=1000(user) gid=100(users) groups=100(users)

Тогава сменете следните две неща с вашите:

#define IRC_UID un_uid
#define IRC_GID un_gid

на:

#define IRC_UID 1000
#define IRC_GID 100

За да се предпазите от flood сменете това:

#define CLIENT_FLOOD 8000

на:

#define CLIENT_FLOOD 2400

Сега save-айте. Продължаме с директорията include/. След примерите в директорията ще ви покажем как се конфигурира с командата ./Config.

$ mcedit version.h

Файловете, които не са споменати, няма да се редактират така че не ги пипайте. Сега напишете ./Config.

$ cd /home/user/Unreal3.2/
$ ./Config
Do you have an insecure operating system and therefore want to
use the server anti-spoof protection?
[Yes] ->

What directory are all the server configuration files in?
[/home/ircd/Unreal3.2] -> /home/user/ircd

What is the path to the ircd binary including the name of the binary?
[/home/ircd/Unreal3.2/src/ircd] -> /home/user/ircd

Ако сте HUB напишете HUB, ако не - leaf

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

What is the hostname of the server running your IRCd?
[DarkChiLd] -> // 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] ->
// Hit Enter

Много IRC клиенти не поддържат SSL connection така че не я използвайте.

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

Ако искате сървъра да поддържа IPv6 напишете yes. (ако не знаете какво е това напишете No)

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

След това натиснете enter.

Искате на направите IRCd-то си смешно. Да показва забавни съобщения? Това е възможно, да:)

$ cd ..
$ cd src/
$ mcedit s_err.h

Сега компилирайте IRCd-тo

$ cd ..
$ make

Ако се е компилирало без грешки, ще трябва да сложите изпълнимия файл на IRCd-то в SPATH.

$ make install

Сменете директорията в 'make config' (при мен е /home/user/ircd).

$ ls
Donation aliases/ badwords.message.conf doc/ ircd* modules/ unreal*
LICENSE badwords.channel.conf bugreport* help.conf makeconf* networks/ unrealircd.conf

Сега ще трябва да направим някои други файлове.

$ touch ircd.motd
$ touch ircd.rules
$ touch ircd.notes
$ touch oper.motd
$ touch ircd.log

Например, акоо искате oprers motd направете файл opers.motd.

$ cat > oper.motd
You are now a bad motherfucker Go /kill someone!

CTRL+C

Сега... важната част (други конфигурации) - ircd.conf. Върнете се в инсталационната директория и напишете:

$ cd /home/user/Unreal3.1.2/
$ sh makeconf

What will your server name be? (ie: Server.IRC.net)
[Server.IRC.net] -> irc.myserver.com

What is your IRC server's IP? (ie: 1.2.3.4)
Use * to bind to all interfaces
[1.2.3.4] -> 127.0.0.1

Server comment? (ie: Main Hub Server)
[IRC server!] -> My Main Home Ircd server

Main port? (ie: 6667)
[6667] ->

What server numeric does the server have (range = 1..256)
Must NOT be the same as other servers you link with
[] ->256

What is your real name? (ie: John Doe)
[Admin-name] -> Randal Smitzh

What is your IRC nickname? (ie: JD)
[Admin] -> Randal

What is your e-mail address? (ie: [email protected])
[[email protected]] -> [email protected]

What will your opername be for your O:line? (ie: johndoe)
[Admin] -> Randal

What oper flags do you want to have? (ie: OAWZ)
Some flags to choose from:
o = local oper
O = global oper
N = network administrator
A = server administrator
C = co administrator
T = technical administrator
read unrealircd.doc for more info about O:line flags)
[OAZHWe] -> // Hit Enter

Do you use encrypted oper passwords?
[Yes] -> // Hit Enter
Compile the file called mkpasswd.c in the 'crypt' directory
Then run it (./mkpasswd) and input the passwd to be encrypted
Then copy the output into the passwd slot in the O:line
NOTE: You can encrypt on irc via /mkpasswd <passwd>

What will your /oper password be? (ie: snoopy67)
[password] -> mypassword

What is your user@host mask on IRC? (ie: *@*.toronto.globalserve.net)
[*@*] -> *!IDENT@*.DOMAIN.COM

What do you want your die password to be?
[diepass] -> mydiepasswd

What do you want your restart password to be?
[restartpass] -> myrestartpasswd

If your running services, or linking to a network that has
services, please state the services servername.
If you are running a non-services network, just type 'next'
[Services.IRC-Net.Org] -> my.services.com

Would you like to configure any servers for linking?
Type the servername, or type 'done' when finished.
[done] -> // Hit Enter

Would you like any extra ports, other than 6667? Enter them here.
Type 'done' when you are finished. Type 'default' to use 6665-6669/7000.
[default] -> 9000

OK, ircd.conf has been generated according to what you specified.
Make sure you double check for errors in ircd.conf. We recommend that
you take a look at your ircd.conf right now. Thanks for using UnrealIRCd

Have a nice day.

Копирайте unrealircd.conf в /home/user/ircd

$ cp unrealircd.conf /home/user/ircd
$ cd /home/user/ircd
$ mcedit unrealircd.conf
loadmodule "src/modules/commands.so";
loadmodule "src/modules/scan.so";
loadmodule "src/modules/scan_socks.so";
loadmodule "src/modules/scan_http.so";
Change to:
loadmodule "modules/commands.so";
loadmodule "modules/scan.so";
loadmodule "modules/scan_socks.so";
loadmodule "modules/scan_http.so";

Добавете това:

set {
kline-address "[email protected]";
modes-on-connect "+xw";
modes-on-oper "+xwgs";
options {
enable-opermotd;
enable-chatops;
hide-ulines;
identd-check;
show-connect-info;
};

dns {
nameserver 127.0.0.1; // Тук добавете вашия NameServer
timeout 2s;
retries 2s;
};

maxchannelsperuser 10;
};

set {
network-name "My Network"; // Your NETWORK name
default-server "irc.myserver.org"; // Your SERVER name
services-server "services.myserver.org"; // Your SERVICES name
stats-server "stats.myserver.org"; // Your STATS name
help-channel "#helpchan"; // The HelpChannel Of Your NETWORK
prefix-quit "no";

cloak-keys {
93666; // Cloak-keys the syntax is: cloak-keys { 39999; 99398; 99397; };
33213;
333920;
};

hosts {
local "locop.roxnet.org"; // Host That Local Opers Will Have After They Ident Themselves
global "ircop.roxnet.org"; // Host That Gloval Opers Will Have After They Ident Themselves
coadmin "coadmin.roxnet.org"; //Host That Coadmins Opers Will Have After They Ident Themselves
admin "admin.roxnet.org"; // Host That Admin Opers Will Have After They Ident Themselves
servicesadmin "csops.roxnet.org"; //Host That ServicesAdmin Opers Will Have After They Ident Themselves

techadmin "techadmin.roxnet.org"; //Host That TechAdmin Opers Will Have After They Ident Themselves

netadmin "netadmin.roxnet.org"; //Host That NetAdmin Opers Will Have After They Ident Themselves

host-on-oper-up "no";
};
};
log "ircd.log" {
maxsize 2097152;.
flags {
oper;
kline;
connects;
server-connects;
kills;
errors;
};
};

alias NickServ { type services; };
alias ChanServ { type services; };
alias OperServ { type services; };
alias HelpServ { type services; };
alias StatServ { type stats; };


IRCd-то е готово за стартиране. С опцията -l може да log-вате. Ако системата ви поддържа crontab можете да добавите IRCd-то да бъде проверявано всеки 10 минути.

$ ./ircd -f ircd.conf


$ cat > crontab
0,10,20,30,40,50 * * * * /home/user/ircd/ircdcheck >/dev/null 2>&1

CTRL+C

Чудите се какво е ircdcheck? То трябва да съдържа следните редове... всъщност това е за services, но може да работи и за IRCd.

$ cat > ircdcheck

#!/bin/sh

# Set this to the directory where IRCd is located
hpath="/home/user/ircd"

# Set this to the name of the pid file
hpidfile="ircd.pid

# Set this to the path to the configuration file
conffile="ircd.conf"

if test -r $hpath/$hpidfile; then
hpid=`cat $hpath/$hpidfile`
if `kill -CHLD $hpid >/dev/null 2>&1`; then
# still running
exit 0
fi
fi

echo ""
echo "Restarting IRCd..."

if test -x $hpath/ircd; then
$hpath/ircd $conffile -l ircd.log
exit 0
fi

echo "Unable to execute $hpath/ircd"
exit 0

CTRL+C

Пуснете crontab:

$ crontab crontab
$ chmod a+x ircdcheck

Всичко върви добре. Проверете:

$ crontab -l

Ако искате да добавите друг oper добавете нещо като този пример във вашия config:

oper operatornickname {
class clients;
from {
userhost [email protected];
};
password "f00";
flags
{
netadmin;
global;
};
};

Ако искате да link-нете сървъра си към някои друг трябва да добавете в conf файла link {} (старите C/N линии).

link hub.mynet.com
{
username *;
hostname 1.2.3.4; // тук сложете IP-to на сървъра с който ще се свързвате
bind-ip *;
port 9000; // Port To Connect To
hub *; // If This Is A Hub, * Works, Or Servermasks It May Bring In, Rr leaf *;
password-connect "LiNk"; // Here Add The Link Passwords Must Be The Same In Both Servers
password-receive "LiNk";
class servers;

options {
autoconnect;
zip;
};

ulines {
services.mynetwork.org;
stats.mynetwork.org;
};

Happy new IRCd!!
The quieter you become, the more you are able to hear! :AR! https://www.FreeUniBG.eu :YMDEVIL:
Публикувай отговор

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 2 госта