Tip of the day: The Security article gives hands-on tips on how to deal with drone attacks, flooding, spammers, (D)DoS and more.

Instalando da origem

From UnrealIRCd documentation wiki
Jump to navigation Jump to search
This page is a translated version of the page Installing from source and the translation is 52% complete.
Outdated translations are marked like this.
Other languages:

Para instalar o UnrealIRCd no Linux, FreeBSD, OpenBSD, OS X e outros sistemas *NIX você geralmente compila e instala a partir do código fonte. Além disso, você também precisará configurar o UnrealIRCd. Esta página explica como fazer tudo isso. Mesmo que você seja completamente novo no UnrealIRCd, todas essas etapas para colocar o IRCd em funcionamento não devem levar mais de 30 minutos no total.

Prerequisites

At a minimum, UnrealIRCd needs a compiler and the OpenSSL library. Even better is if you install a few other libraries, but this is not required as UnrealIRCd will fallback to its own libraries if you miss them.

  • Ubuntu 20.*/21.*: sudo apt-get install build-essential pkg-config libssl-dev libpcre2-dev libargon2-dev libsodium-dev libc-ares-dev libcurl4-openssl-dev
  • Ubuntu 18.*: sudo apt-get install build-essential pkg-config libssl-dev libpcre2-dev libargon2-0-dev libsodium-dev libc-ares-dev libcurl4-openssl-dev
  • Ubuntu 16.*: sudo apt-get install build-essential pkg-config libssl-dev libpcre2-dev libsodium-dev libc-ares-dev libcurl4-openssl-dev
  • Debian 9/10: sudo apt-get install build-essential pkg-config libssl-dev libpcre2-dev libargon2-0-dev libsodium-dev libc-ares-dev libcurl4-openssl-dev
  • For unlisted Linux distro's which use apt-get, the minimum requirement is: sudo apt-get install build-essential libssl-dev
  • For Linux distro's that use yum: you need a compiler and the openssl-dev/openssl-devel/libssl-dev package.
  • For FreeBSD: your system normally already has a compiler and the openssl development library installed, so you are good to go.

If, for some reason, you are curious what libraries UnrealIRCd uses or can use, then see Libraries used by UnrealIRCd.

Don't run as root

Be sure to build and run the IRCd as a regular user and not as root. If you are on a VPS / root shell then create a user 'unrealircd' or similar (sudo adduser unrealircd) and do all steps below as that user (login as user 'unrealircd'). See also Do not run as root.

Upgrading?

If you are upgrading an existing UnrealIRCd installation, then we recommend using ./unrealircd upgrade which will do all the work for you. See also Upgrading.

Agarre a fonte (.tar.gz)

A partir da shell

Conecte-se ao servidor *NIX via SSH. Todos os seguintes comandos são executados no servidor *NIX.

wget --no-check-certificate --trust-server-names https://www.unrealircd.org/downloads/unrealircd-latest.tar.gz

No FreeBSD você pode ter que usar:

fetch https://www.unrealircd.org/downloads/unrealircd-latest.tar.gz

Se nenhum dos dois funcionar, por exemplo, você recebe um 'comando desconhecido', então você deve instalar o pacote 'wget' no seu sistema ou tentar fazer o upload (veja a seguir).

Alternativa: fazer o upload para a shell

Você também pode optar por baixar o .tar.gz do UnrealIRCd através do seu navegador, salvá-lo em disco e enviá-lo para a shell via SCP ou SFTP.

Extraia a fonte

Extraia o .tar.gz e entre no directório unrealircd-x.y.z:

tar xzvf unrealircd-4.0.X.tar.gz
cd unrealircd-4.0.X

NOTA: Existe alguma lógica aqui. Se o arquivo for chamado, digamos, unrealircd-4.0.0.tar.gz, ele será extraído para o directório unrealircd-4.0.0/. Como você pode ver, o nome do directório é diferente para cada versão, para garantir que você não substitua acidentalmente a instalação existente.

Compilando

Primeiro, execute o script ./Config que fará uma série de perguntas. Você pode simplesmente pressionar Enter para aceitar as respostas padrão.

./Config

Agora, compile o UnrealIRCd executando make, isso pode levar um minuto (ou dois):

make

Finalmente, execute make install (importante!):

make install

Criando um arquivo de configuração

  1. Mude para o directório UnrealIRCd instalado, isto é /home/yourusername/unrealircd por padrão (Para mais informações sobre a estrutura de directório veja Arquivos e directórios do UnrealIRCd).
    cd ~/unrealircd
  2. Copie conf/example/example.conf para o seu diretório conf/ e renomeie para unrealircd.conf
    syzop@vulnscan:~/unrealircd$ cp conf/examples/example.conf conf/unrealircd.conf
  3. Abra o arquivo com um editor (por exemplo: nano conf/unrealircd.conf)
  4. Leia o artigo Sintaxe do Arquivo de Configuração. Demorará apenas alguns minutos e poupará muitos problemas no(s) passo(s) seguinte(s)!
  5. Percorra o bloco unrealircd.conf por bloco / linha por linha e edite as configurações para atender às suas necessidades. Isso leva de 10 a 20 minutos.
  6. Inicie o UnrealIRCd executando ./unrealircd start no seu directório ~/unrealircd.
  7. Erros? Edite o arquivo unrealircd.conf, corrija-os (veja a FAQ para problemas comuns), e tente iniciar o UnrealIRCd novamente.
  8. Funcionando? Conecte-se com um cliente de IRC ao seu servidor e divirta-se. Veja a próxima secção também.
  1. Change to the installed UnrealIRCd directory, this is /home/yourusername/unrealircd by default (For more information on the directory structure see UnrealIRCd files and directories).
    cd ~/unrealircd
  2. Copy conf/example/example.conf to your conf/ directory and rename it to unrealircd.conf
    cp conf/examples/example.conf conf/unrealircd.conf
    TIP: Is your native language not English? Then check the conf/examples directory. We ship with several example configuration files in different languages. If you want to use one of those, simply copy that one instead.
  3. Open the file with an editor (eg: nano conf/unrealircd.conf)
  4. Read the Configuration file syntax article. It will only take a few minutes and will save you a lot of trouble in next step(s)!
  5. Walk through the unrealircd.conf block by block / line by line and edit the settings to suit your needs. This takes 10 - 20 minutes.
  6. Boot UnrealIRCd by running ./unrealircd start from your ~/unrealircd directory.
  7. Errors? Edit your unrealircd.conf, fix them (see the FAQ for common problems), and try starting UnrealIRCd again.
  8. Up and running? Connect with an IRC client to your server and have fun. See next section too.

Leitura adicional

  • Veja Características para vários recursos disponíveis no UnrealIRCd e Configuração para todas as coisas possíveis que você pode configurar no UnrealIRCd.
  • Novamente, veja a FAQ se você tiver algum problema. Muitos problemas comuns são respondidos lá.
  • Adicione um Cron job para garantir que o UnrealIRCd seja (re)iniciado após a inicialização do sistema ou uma falha.