[Windows][WSL] Canary + Uniform Server + MyAAC

1 - Install WSL:

2 - Install a Linux Distribution:

3 - Installation - Canary:

Debian
sudo apt update && sudo apt dist-upgrade -y
sudo apt install git cmake build-essential autoconf libtool ca-certificates curl zip unzip tar pkg-config ninja-build ccache linux-headers-generic -y

Update cmake:

sudo nano /etc/wsl.conf
- Append these lines:
[boot]
systemd=true
- Save the file.
- Close your WSL distro and run the command below from PowerShell to restart your WSL instances:
wsl.exe --shutdown
- After the restart, open WSL distro again.

sudo apt remove --purge cmake -y
hash -r
sudo apt install snapd -y
sudo snap install cmake --classic
- Close your WSL distro and run the command below from PowerShell to restart your WSL instances:
wsl.exe --shutdown
- After the restart, open WSL distro again.
cmake --version

Update gcc:

- Edit repository file: 
sudo nano /etc/apt/sources.list

- Append these lines to the end:
deb http://deb.debian.org/debian testing main contrib non-free
deb-src http://deb.debian.org/debian testing main contrib non-free
- Save the file.

sudo apt update
sudo apt install gcc-14 -t testing && sudo apt install g++-14 -t testing
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 14
gcc-14 --version
g++-14 --version

-

sudo apt install acl
cd ~

git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
cd ~

git clone --depth 1 https://github.com/opentibiabr/canary.git
sudo setfacl -R -m g:www-data:rx /home/$USER/
sudo setfacl -R -m g:www-data:rx /home/$USER/canary
sudo chmod -R 755 canary
cd canary
mv config.lua.dist config.lua
mkdir build && cd build

cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release
cmake --build linux-release -j4

cd ~
cd canary
cp -r build/linux-release/bin/canary .
sudo chmod +x canary
Ubuntu 20.04
sudo apt update && sudo apt dist-upgrade -y
sudo apt install git cmake build-essential autoconf libtool ca-certificates curl zip unzip tar pkg-config ninja-build ccache linux-headers-generic -y

Update cmake:

sudo apt remove --purge cmake -y
hash -r
sudo apt install snapd -y
sudo snap install cmake --classic
cmake --version

Update gcc:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt install gcc-11 g++-11 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
sudo update-alternatives --set gcc /usr/bin/gcc-11
gcc-11 --version
g++-11 --version

-

sudo apt install acl
cd ~

git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
cd ~

git clone --depth 1 https://github.com/opentibiabr/canary.git
sudo setfacl -R -m g:www-data:rx /home/$USER/
sudo setfacl -R -m g:www-data:rx /home/$USER/canary
sudo chmod -R 755 canary
cd canary
mv config.lua.dist config.lua
mkdir build && cd build

cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release
cmake --build linux-release -j4

cd ~
cd canary
cp -r build/linux-release/bin/canary .
sudo chmod +x canary
Ubuntu 22.04
sudo apt update && sudo apt dist-upgrade -y
sudo apt install git cmake build-essential autoconf libtool ca-certificates curl zip unzip tar pkg-config ninja-build ccache linux-headers-generic -y

Update cmake:

sudo apt remove --purge cmake -y
hash -r
sudo apt install snapd -y
sudo snap install cmake --classic
cmake --version

Update gcc:

sudo apt update
sudo apt install gcc-12 g++-12 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
sudo update-alternatives --set gcc /usr/bin/gcc-12
gcc-12 --version
g++-12 --version

-

sudo apt install acl
cd ~

git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
cd ~

git clone --depth 1 https://github.com/opentibiabr/canary.git
sudo setfacl -R -m g:www-data:rx /home/$USER/
sudo setfacl -R -m g:www-data:rx /home/$USER/canary
sudo chmod -R 755 canary
cd canary
mv config.lua.dist config.lua
mkdir build && cd build

cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release
cmake --build linux-release -j4

cd ~
cd canary
cp -r build/linux-release/bin/canary .
sudo chmod +x canary
Ubuntu 24.04
sudo apt update && sudo apt dist-upgrade -y
sudo apt install git cmake build-essential autoconf libtool ca-certificates curl zip unzip tar pkg-config ninja-build ccache linux-headers-generic -y

Update cmake:

sudo apt remove --purge cmake -y
hash -r
sudo apt install snapd -y
sudo snap install cmake --classic
cmake --version

Update gcc:

sudo apt update
sudo apt install gcc-14 g++-14 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 --slave /usr/bin/g++ g++ /usr/bin/g++-14 --slave /usr/bin/gcov gcov /usr/bin/gcov-14
sudo update-alternatives --set gcc /usr/bin/gcc-14
gcc-14 --version
g++-14 --version

-

sudo apt install acl
cd ~

git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
cd ~

git clone --depth 1 https://github.com/opentibiabr/canary.git
sudo setfacl -R -m g:www-data:rx /home/$USER/
sudo setfacl -R -m g:www-data:rx /home/$USER/canary
sudo chmod -R 755 canary
cd canary
mv config.lua.dist config.lua
mkdir build && cd build

cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release
cmake --build linux-release -j4

cd ~
cd canary
cp -r build/linux-release/bin/canary .
sudo chmod +x canary

Observations:

-- Running vcpkg install

This step will take a long time on the first run, as it needs to download and install all the dependencies, so be patient!

• How to update vcpkg:

If you already have vcpkg installed

To update vcpkg installation, run the commands below:

  • cd vcpkg

  • git pull

  • ./vcpkg upgrade

  • ./vcpkg upgrade --no-dry-run

  • ./bootstrap-vcpkg.sh

4 - Download Uniform Server:

5 - Installation of Uniform Server:

  • Install Uniform Server (15_0_1_ZeroXV) on the C:\ drive.

  • Example:

  • On unit C:\ after installation, the folder name is UniServerZ.

  • When you open Uniform Server, a window will open asking for the MySQL root password:

  • The default password in this case is root.

  • Uniform Server is ready for use.

  • Change thread stack:

  • MySQL -> Edit Config file my.ini and change:

  • thread_stack = 256K

  • Save the file.

  • Enable PHP Extensions:

  • PHP -> Edit Basic and Modules -> PHP Modules Enable/Disable and enable:

  • bz2, curl, mbstring, zip;

  • To start Uniform Server:

  • Click the Start Apache button;

  • Click the Start MySQL button.

5.1 - MySQL root password:

  • If you changed MySQL root password, you should change the authentication plugin using the MySQL Console with the command:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';

6 - Database:

  • In Uniform Server, click the phpMyAdmin button and will open in the browser the web application to manage database.

  • Go to Users, edit root user and add the IPv4 address of your computer.

  • On the left side click +New and create a database (e.g. canary)

  • Import the schema file.sql which is in the Canary folder.

7 - Config.lua:

• For data-canary:

-- Core settings
-- Note: If you want to use datapack folder canary (custom), put only "data-canary"
-- If you want to use the global datapack folder, put "data-otservbr-global"
-- If "useAnyDatapackFolder" is set to true then you can choose any datapack folder for your server
useAnyDatapackFolder = false
dataPackDirectory = "data-canary"
-- Don't change this unless you know what you're doing
coreDirectory = "data"

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
-- NOTE: If toggleDownloadMap if false, then the mapDownloadUrl will not be used
-- NOTE: If a map with the name already exists in the world folder, the map will not be downloaded even if the toggleDownloadMap is true
toggleDownloadMap = false
mapName = "canary"
mapDownloadUrl = "https://github.com/opentibiabr/canary/releases/download/v3.0.0/otservbr.otbm"
mapAuthor = "OpenTibiaBR"

-- Custom Map
-- NOTE: toggleMapCustom set to true will load all maps in custom map folder
toggleMapCustom = false

-- Connection Config
ip = "127.0.0.1"
serverName = "Canary"

-- MySQL
mysqlHost = "IPv4"
mysqlUser = "root"                      
mysqlPass = "root"                       
mysqlDatabase = "canary"        
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"

For data-otservbr-global:

-- Core settings
-- Note: If you want to use datapack folder canary (custom), put only "data-canary"
-- If you want to use the global datapack folder, put "data-otservbr-global"
-- If "useAnyDatapackFolder" is set to true then you can choose any datapack folder for your server
useAnyDatapackFolder = false
dataPackDirectory = "data-otservbr-global"
-- Don't change this unless you know what you're doing
coreDirectory = "data"

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
-- NOTE: If toggleDownloadMap if false, then the mapDownloadUrl will not be used
-- NOTE: If a map with the name already exists in the world folder, the map will not be downloaded even if the toggleDownloadMap is true
toggleDownloadMap = true
mapName = "otservbr"
mapDownloadUrl = "https://github.com/opentibiabr/canary/releases/download/v3.0.0/otservbr.otbm"
mapAuthor = "OpenTibiaBR"

-- Custom Map
-- NOTE: toggleMapCustom set to true will load all maps in custom map folder
toggleMapCustom = true

-- Connection Config
ip = "127.0.0.1"
serverName = "OTServBR-Global"

-- MySQL
mysqlHost = "IPv4"
mysqlUser = "root"                      
mysqlPass = "root"                       
mysqlDatabase = "otservbr-global"        
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"

8 - MyAAC:

8.1 - Download MyAAC:

8.2 - Installation MyAAC:

  • Open Uniform Server www folder and delete all files before saving the files and folders from MyAAC.

  • Unzip MyAAC files and folders in the Uniform Server www folder.

  • Leave all MyAAC files and folders as shown in the example below:

  • Access http://127.0.0.1 to load MyAAC.

  • Follow the installation steps to install MyAAC.

9 - Starting and Connecting to the Server:

9.1 - Starting the Server:

  • Double click canary.exe, it will start the server.

9.2 - Connecting to the Server:

  • To connect to the server according to the indicated version, you need the client below:

  • Note: to connect on localhost, use the client 127.0.0.1_client.exe or edit the client with the ip http://127.0.0.1/login.php.

• How to edit the client:

10 - Credits:

Last updated