Tip of the day: The Security article gives hands-on tips on how to deal with drone attacks, flooding, spammers, (D)DoS and more. |
透過原始程式安裝
要將 UnrealIRCd 安裝於 Linux、FreeBSD、OpenBSD、OS X 以及其他 *NIX 系統,基本上需要取得原始程式進行編譯及安裝。除此之外,你也需要去手動設定 UnrealIRCd。本頁面將會解釋如何去完成這些動作,即使你對 UnrealIRCd 是完全的新手,根據教學步驟只需 30 分鐘以內就可以讓 IRCd 成功地運作。
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.
取得原始程式 (.tar.gz)
在 Shell 中進行安裝
透過 SSH 連線至 *NIX 機器。接下來所有的指令將會在 *NIX 機器上執行。
wget --no-check-certificate --trust-server-names https://www.unrealircd.org/downloads/Unreal3.4-latest.tar.gz
在 FreeBSD 上,你可以使用下面指令:
fetch https://www.unrealircd.org/downloads/Unreal3.4-latest.tar.gz
如果兩種方式都失敗,例如出現錯誤訊息 'unknown command',則代表你需要在你的機器中安裝 'wget' 套件,或透過上傳的方式安裝它 ( 參考下個部分 )。
替代解決案: 手動上傳
你可以選擇透過瀏覽器直接下載 Unreal3.4 的安裝檔,然後使用 SCP 或 SFTP 上傳至特定的機器中。
解壓縮原始程式
解壓縮 .tar.gz 並輸入 Unreal 3.4.x 資料夾:
tar xzvf Unreal3.4-alpha999.tar.gz cd Unreal3.4-alpha999
備註:如果檔案名稱為 Unreal3.4.0-lala1.tar.gz,執行解壓縮後檔案會存在於一個名為 Unreal3.4.0-lala1 的資料夾內。每一次釋出版本的檔案名稱都會不同,所以資料夾名稱也會不同,這樣可以避免你不小心在解壓縮時覆蓋已存在的檔案。
編譯
首先執行 "./Config",隨後會出現一些安裝相關的問題,若想使用預設值可直接 Enter 下一步。
./Config
接著,執行 "make" 指令來編譯 UnrealIRCd,這將會花費 1 至 2 分鐘。
make
最後重要的一步,執行 "make install":
make install
建立設定檔
- 進入 UnrealIRCd 所在路徑,預設值為 /home/yourusername/unrealircd ( 更多資訊請參考UnrealIRCd 檔案與路徑).
cd ~/unrealircd
- 複製 conf/example/example.conf 到 conf/, 並將檔案名稱改為 unrealircd.conf
syzop@vulnscan:~/unrealircd$ cp conf/examples/example.conf conf/unrealircd.conf
- 使用文字編輯器打開該檔案 ( 例如:nano conf/unrealircd.conf)
- 閱讀設定檔語法文章。閱讀該文章只花費你短短的時間就可以幫助你在接下來的步驟中避免許多問題!
- 透過修改 unrealircd.conf,逐一針對每個單元設定來符合你的需求。只需花費 10 - 20 分鐘。
- 於 ~/unrealircd 執行 ./unrealircd start 來啟動你的 UnrealIRCd。
- 發生錯誤 ? 修改 unrealircd.conf ( 一般問題請參考FAQ ),修改完請重新啟動 UnrealIRCd。
- UnrealIRCd 是否運作正常 ? 透過 IRC client 連線至伺服器,並請繼續參考下一章節。
- 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
- 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. - Open the file with an editor (eg: nano conf/unrealircd.conf)
- 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)!
- Walk through the unrealircd.conf block by block / line by line and edit the settings to suit your needs. This takes 10 - 20 minutes.
- Boot UnrealIRCd by running ./unrealircd start from your ~/unrealircd directory.
- Errors? Edit your unrealircd.conf, fix them (see the FAQ for common problems), and try starting UnrealIRCd again.
- Up and running? Connect with an IRC client to your server and have fun. See next section too.