[CentOS 7 Repack] Full Cabal Server Installation + CentOS SQL (Database) [Updated]
This tutorial will show you how to have a fully working Cabal Online Private Server on CentOS 7 VPS with a Database and overall - ready to launch officially* or not.
[This tutorial is written for CentOS 7 ONLY]
*if you have a ready files though. About repack: It's at stable stage, that has been planned for quite a while and it requires a bit more manual work than the usual one, but that I explain below, so hopefully, if you follow my tutorial, you will have no issues to have a server.
- Cleaned Libraries that stopped CentOS yum update and were not used at all.
- Overall clean-up of the whole repack and scripts.
- Infinite yum update [expected] without any issues (lol).
- No more Windows R2
- No more Remote Desktops
- No more hassle - No more 30-120 Euros a month for Dedicated Servers with additional charges for Windows Environment
IMPORTANT NOTE: If you will follow my full tutorial, you will have it a fully working server within 2 hours time. Repack has been tested and already used by couple servers and my test server.
This repack might not suite everyones taste, as it has a different cabal_status and overall OS environment is slightly different from CentOS 6.
Tutorial has sections, so make sure you follow them.
So, without further ado, lets begin:
Section 1 [Minimal to Average Requirements]:
Spoiler:
Minimal Requirements of User:
1. Read in english.
2. Follow tutorial accurately.
3. NO RUSHING. Patience is a virtue.
4. Double-check every step done and verify it.
5. Assure that everything has been done correctly and as tutorial says.
FOR COMPLETE BEGINNERS:
Strongly advised to use Fallen Cabal Files and Client, as you only need to put the files' Data and Common.ini and edit language.enc accordingly. As well as server files are the most stable and one of the most clean ones. Big thanks for @DeXtR for his amazing release.
Minimal Requirements of System:
1. CentOS 7 [Not Debian, not Ubuntu, not Fedora or any of that sort]
2. 6 GB Ram [CentOS SQL requires minimum of 4 GB RAM]
3. 100 GB of space [can be either SSD or HDD]
4. 100mbps Bandwith [This is only if you won't make it public or will not go international, for public release strongly advised to have 1 GBPS]
Section 2 [System Preparation]:
Spoiler:
Assumingly you've got your CentOS 7 running, you have to do couple of things:
1. Check if you have a running Firewalld. Command to check it:
Code:
systemctl status firewalld
- If it is shown as: Active: active (running) then go to Step 2.
- If it is show as: Inactive then go to Step 1.1.
1.1. Command to restart Firewalld:
Code:
systemctl enable firewalld
1.2. Command to start Firewalld:
Code:
systemctl start firewalld
*
* Repeat Step 1 to check if it is Running now.
1.3. If you would like to restart your firewall, then use:
Code:
systemctl restart firewalld
2. Run Yum Update to update your system:
Code:
yum update
Section 3 [Ports & Firewalld]:
Spoiler:
Advice: Highly suggested to use custom ports for open ports like Chatnode, LoginSvr, WorldSvr* and AgentShop*.
Required Ports [Default ones, change accordingly to your custom ones if you decide to change]:
- 80 - HTTP
- 443 - HTTPS
- 1433 - Database
- 38101 - LoginSvr
- 38121 - Chatnode
- 38151 - AgentShop
- 38111 - 38116 - Channels*
- 38126 - War [170-190]*
You can open a full port range by typing:
* DO NOT OPEN GLOBALMGRSVR PORT.
** The ports provided are fully sufficient for full server use.
2. After you have added all of the ports, restart firewalld:
Code:
sudo firewall-cmd --reload
3. Check if you have added all of the ports you require:
Code:
firewall-cmd --list-all
4. OPTIONAL - You can also create a new zone in firewalld, if you decide not to use public zone, as well as add blocks / drop specific connections and such: Digital Ocean Tutorial
2. Run the following commands to install SQL Server:
Code:
sudo yum install -y mssql-server
3. Run mssql-conf setup and follow the prompts to set the SA password and choose express edition [Number 3] <- because it is a Free Edition of newest SQL:
Code:
sudo /opt/mssql/bin/mssql-conf setup
4. Check if SQL is running:
Code:
systemctl status mssql-server
5. Make backup directory to restore your backups from:
and click "Run". It will create all databases you will require.
2. Once databases are created, and backups are uploaded to /var/opt/mssql/backup, right-click on database and follow these steps: Step 1: "Account" database -> "Tasks" -> "Restore" -> "Database..."
Step 2: Select "Device" -> Click on 3 dots (in image marked as 2) -> Select "Add" -> Once window opens, click on "backup" and select Account.bak file -> Click "Ok"
[outcome will be like picture]
Step 3: Select "Options" (1) -> Tick "Overwrite the existing database (WITH REPLACE) (2). If you have "Take tail-log backup before restore" -> DESELECT IT. It has to be as show in the image below -> Click "Ok" and wait till database restores.
Now repeat the STEPS ABOVE for all databases until they are fully restored.
Old method for 2017 MSSQL - reported problems - NOT ADVISED TO USE IT:
Spoiler:
Once you have done all points in Database Installation part, follow these simple to restore your database using PuTTy Terminal, which is simple copy-paste + enter.
4. Using the following line in PuTTy terminal, you will create a database and restore it at the same time, without the need to login to SSMS Management and create everything there, as show in this sample:
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Account] FROM DISK = N'/var/opt/mssql/backup/Account.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Copy paste the following lines in the spoiler below to restore full database.
*Important: after each line, you will be prompted to input database password.
Spoiler:
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Account] FROM DISK = N'/var/opt/mssql/backup/Account.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Authentication] FROM DISK = N'/var/opt/mssql/backup/Authentication.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [CabalCash] FROM DISK = N'/var/opt/mssql/backup/CabalCash.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [CabalGuild] FROM DISK = N'/var/opt/mssql/backup/CabalGuild.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [EventData] FROM DISK = N'/var/opt/mssql/backup/EventData.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [NetCafeBilling] FROM DISK = N'/var/opt/mssql/backup/NetCafeBilling.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Server01] FROM DISK = N'/var/opt/mssql/backup/Server01.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Database Location and Commands:
Location: /var/opt/mssql Backups: /var/opt/mssql/backup
Command to restart database:
Code:
systemctl restart mssql-server
P.S. SQL has its own cmd, but it is not adviseable for novice user to use it, as SSMS does everything you need.
# Useful Tips #
- How to change default database username to my own?
Answer: Login to your Database -> Select "Security" (below "Databases") -> right-click user "sa" -> click "Rename" -> change it to whatever you like and hit "Enter" on your keyboard -> Done!
- How to change MSSQL default port (1433) into my custom one?
Answer:
- Firstly, add it into your firewall zone. If you will not add it before hand, you will block yourself out of the database.
- Then, run the following command in SSH terminal:
Code:
/opt/mssql/bin/mssql-conf set network.tcpport YOUR_PORT_HERE
- After that you will be prompted to restart MSSQL Server, so use the following:
VERY VERY BIG ADVISE: DO NOT paste your .ini files of any config, apart of common.ini ; just recreate it on the new ones. [Advising as some people had experienced some sort of a issues in regards to changing .ini files that were not common.ini and I had no time to look into it, but anyone with knowledge and kind enough could post anything about it and I will update this tutorial]
1. Go to WorldSvr_0X_0X and change ports accordingly, as repack will recreate all channels [WorldSvr_0X_0X on port: 38111 ; so you won't see any other channels apart of Channel 1]
For beginners:
Lets say you created 5 channels, you will see only channel 1 because all of them has port 38111 set on it, so what you need to do is this:
Go to WorldSvr_01_02 and change it's port to 38112
Go to WorldSvr_01_03 and change it's port to 38113
Go to WorldSvr_01_04 and change it's port to 38114
Go to WorldSvr_01_05 and change it's port to 38115
2. Check GlobalMgrSvr_0X.ini file to setup your channels accordingly.
3. Update LoginSvr_0X.ini and Account Database-> dbo.cabal_client_version table with your client's Magic Key and Client Version.
5. Another Advise: Replace ONLY Data folder and Common.ini [Don't forget to link each of them to your Channels if you have more than one] if you start a fresh server.
5.1. CHMOD your new Data folder and Common.ini files with right permissions, using these commands:
Code:
sudo chmod -R 777 /etc/cabal/Data
*This will set all permissions to new Data folder and it's subfolders.
Noticed some issues connecting to bega or some websites, so do the following to avoid them:
1. Assumingly you restored all database, go to:
[CODE]Account -> Tables -> dbo.cabal_auth_table -> right-click it and select "Design" -> go to password section and change it from: var(50) to var(256) -> click "Save" in the tools meniu line.
2. Go to Account -> Programabillity -> Stored Procedures -> dbo.cabal_tool_registerAccount and change all password var(XX) to var(256) -> click run and then close it.
3. Go to Account -> Programabillity -> Stored Procedures -> dbo.cabal_tool_registerAccount_web and change all password var(XX) to var(256) -> click run and then close it.
4. REMINDER: go to Account -> dbo.cabal_client_version_table and update Magic Key and Version in order to connect properly into your server.
* In "your port" part, add channel port you want to lock on your IP, which will lead for channel to be visible for everyone, but if someone else will try to click on it, it will not allow to connect. Only user/s who's IP/s are added to this rule, can connect to the channel.
You can also insert a port range, just like in Firewalld section of this tutorial.
Once you paste it, you have to reload your Firewalld:
Code:
sudo firewall-cmd --reload
To remove your "lock" and allow everyone to connect to the channel, copy-paste this, with the details changed accordingly:
Once you paste it, you have to reload your Firewalld:
Code:
sudo firewall-cmd --reload
All credits belong to people who helped and supported the project not solely by feedback, but also financially.
Most credits: penetrator9000 (wished to remain in shadows) & Yamachi References: DeXtR and Toast2250
Last edited by AzureSensei; 27-06-20 at 04:15 PM.
Reason: Added credits, fixed grammar, added references, fixed database typo
Re: [CentOS 7 Repack] Full Cabal Server Installation + CentOS SQL (Database)
Just a little note:
World_drop edits can be done without a server reboot here, just use cabal_reload (may cause a short lag-spike),
or to be channel-specific:
systemctl reload WorldSvr_XX_YY (X = Srv / Y = Channel number, depends on your settings).
Using wildcards obviously works too:
systemctl reload WorldSvr_01_*
or even
systemctl reload WorldSvr*
I guess there will be a few more servers in no time given the repack here.
Re: [CentOS 7 Repack] Full Cabal Server Installation + CentOS SQL (Database)
As long as you can setup server locally (exactly same process as toast's repack) and you've got CentOS 7 - no problems if you put it into virtual machine or into vps or anything else ;)
Re: [CentOS 7 Repack] Full Cabal Server Installation + CentOS SQL (Database)
Have this mssql error what should i do ? and cabal server runs fine and how i should edit client to join my server ? and give us example about how to use mssql this is my first time use vm and centos7 and mssql
Re: [CentOS 7 Repack] Full Cabal Server Installation + CentOS SQL (Database)
SQL Server Agent (SQLEXPRESS) cannot be started because is a feature not supported on Express Edition, I had to switch to the version Developer Edition and now everything works fine.
Re: [CentOS 7 Repack] Full Cabal Server Installation + CentOS SQL (Database)
Originally Posted by Crashed
SQL Server Agent (SQLEXPRESS) cannot be started because is a feature not supported on Express Edition, I had to switch to the version Developer Edition and now everything works fine.
This issue has nothing really to do with the release and shouldn't be mandatory, else - you'll just have to do what the error states:
Get a different version & stop using express.
You only need SQL Agent for cron jobs anyway, which you can set up using a variety of different options/alternatives.
Just google a little regarding it if you would like to keep things the way they are.
Re: [CentOS 7 Repack] Full Cabal Server Installation + CentOS SQL (Database)
Well detailed and very informative and very timely for me! Cheers for the update @AzureSensei!
So i use my Windows Azure Centos 7.4 which is i hope good for this tuts release.
CentOS : https://imgur.com/18Y9Irq
Still i got some road blocks and confusion in some parts of the tuts and apologies for that since im a complete beginner. So here's the pending questions for me to ask to finish the work.
Section 1 of the tuts. First of many :)
FOR COMPLETE BEGINNERS:Strongly advised to use Fallen Cabal Files and Client, as you only need to put the files' Data and Common.ini and edit language.enc accordingly. As well as server files are the most stable and one of the most clean ones. Big thanks for @DeXtR for his amazing release.
For this one im confused on where should i put the downloaded files, i got the emerald client which is for the client to run the game and as far as i remember there should be some files that i should update with the client but i don't know which is that, and the Fallen Server files i mean where should I put them and do i need to update something? Apologies in advance.
Section 2 of the tuts. No issues were encountered except for the non existing command in my CentOS.
Advisable: Get newest SSMS for yourself, in order to connect to your new database: DownloadFULL SETUP: Official Microsoft Link
The Official Microsoft Link is a dead link.
What is the purpose of the "Microsoft SQL Server Management Studio 17" is it to restore the dbase? also what are the credentials i should use.
SQL Server: https://imgur.com/4Um23ga
Also after copying the .bak files in /var/opt/mssql/backup, shouldn't i restore the the .bak files?
Section 4 of the tuts. I'm Okay no issues :) but...
should i also open those endpoints in the Microsoft Azure settings?
Section 5 of the tuts. Here is one of my biggest confusion, what values should i put in the following parameters of the cabal_config.
Enter MSSQL server IP: <<current centos server ip>>
Enter MSSQL server Port(default 1433):1433
Enter MSSQL server User: sa
Enter MSSQL server Password: <<secret password>>
Enter IP for players to connect:<<current centos server ip>>
Is the information i supplied are correct ?
Section 6 of the tuts. (*** SERVER SIDE ***) I haven't done anything from this part, 1st i cant find where is my own .ini. I find this section somewhat unclear or unspecific (my own opinion don't flame me ) .
I think this i related to "Fallen" file downloaded from the Section 1 of the tuts, so should i just copy and paste or upload the "Data" and "Common" in Fallen files from my local to this location in the CentOS "/etc/cabal". I hope this section will be broaden if possible.
(
*** DATABASE SIDE ***
)Likewise from the server side i haven't done anything from here...
Im not familiar on how i can check if my all dbase were restored which is similar to my question in the section 3.
I hope this section will be broaden if possible also.
Section 7 of the tuts. (which is maybe for the client side)
After setting up the server and database side, shouldn't there be also a section for client, just a suggestion. Downloading the Emerald client will not be enough i think.
All in all thank you so much for this updated Cabal Setup tuts. Very highly appreciated. Looking forward for the answers :)
everything i said above were out of curiosity. thanks.