Jump to content
×
×
  • Create New...

EN - Prepare a complete environment to create and operate a Metin2 private server


Recommended Posts

init();

#include < introduction.>

{

 

Hello and welcome to you on the one and only Master Guide ! You enjoyed  Le Guide des Modifications sur Metin2  or   Le Guide de l'Émulation Metin2  ? So you will like  Master Guide Return  in its version dedicated to the setup of the FreeBSD operating system and the preparation of its environment to use your files on a private Metin2 server. This guide HOWEVER is exclusively compatible with  M2 Project  . You don't know what is M2 Project ? Then it's high-time to learn more right here :  M2 Project  ! You can use it for other ServerFiles as long as you update SourceFiles and Metin2 libraries. If you're not using M2 Project, you can still learn a few interesting things on this guide, even more if you're a beginner!

 

goals()

{

  • Installation / Configuration / Management @ FreeBSD
  • Installation / Configuration / Management @ MySQL
  • Installation / Configuration / Management @ M2 Project
  • Installation / Configuration / UsagePuTTY
  • Installation / Configuration / Usage WinSCP
  • Installation / Configuration / Usage Navicat
  • Installation / Configuration / Exploitation @ Compilation Environment
  • Installation / Configuration / Exploitation Compilation Web
  • Save / Transfer / Migration @ M2 Project

}

headers()

{

  • #include < core.h >
  • #include < english.h >
  • #include < brain.h >
  • #include < learning.h >
  • #include < reading.h >

}

}

#include < summary.>

{

caption()

{

  • (§) Optionnal
  • (§) Obligatory
  • (§) Alternative

 

  • (§) Do not follow if you import your VirtualBox VM ( But you can still read... )
  • (§) Do not follow if you are using a dedicated server ( But you can still read... )

}

summary()

{

  • Installation Configuration / Management FreeBSD
    • 1.1 FreeBSD
      • 1.1.1 With VirtualBox
      • 1.1.2 Import a virtual machine with VM VirtualBox
        • 1.1.2.1 Format .VDI / .VHD / .VMDK
        • 1.1.2.2 Format .OVA
      • 1.1.3 Without VirtualBox
    • 1.2 Installation
      • 1.2.1 DNS
      • 1.2.2 PKG
      • 1.2.3 Nano
      • 1.2.4 WGet
      • 1.2.5 Libraries
    • 1.3 Configuration
      • 1.3.1 SSH
    • 1.4 Usage
      • 1.4.1 Nano
    • 1.5 Network/ Internet
      • 1.5.1 Static IP
      • 1.5.2 Retrieve Your IP
  • Installation Configuration / Usage PuTTY
  • Installation Configuration / Usage WinSCP
  • Installation Configuration Management MySQL
    • 4.1 Installation
    • 4.2 Configuration
      • 4.2.1 Start MySQL
      • 4.2.2 First Connection
    • 4.3 Create a Database
    • 4.4 Create a User
      • 4.4.1 Local User
      • 4.4.2 Public User
    • 4.5 Permissions / Access rights
  • Installation Configuration / Usage  Navicat
  • Installation Configuration / Management M2 Project
    • 6.1 Installation
      • 6.1.1 ServerFiles
      • 6.1.2 SourceFiles
      • 6.1.3 Database
    • 6.2 Configuration
      • 6.2.1 ServerFiles
        • 6.2.1.1 Create an account
        • 6.2.1.2 GM Authorizations
        • 6.2.1.3 General
      • 6.2.2 ClientFiles
        • 6.2.2.1 (DePack / UnPack) / RePack
          • 6.2.2.1.1 EterNexus
            • 6.2.2.1.1.1 Configuration
            • 6.2.2.1.1.2 DePack / UnPack
            • 6.2.2.1.1.3 RePack / Pack
          • 6.2.2.1.2 Method EterManager
            • 6.2.2.1.2.1 Configuration
            • 6.2.2.1.2.2 Features
            • 6.2.2.1.2.3 DePack / UnPack
            • 6.2.2.1.2.4 RePack / Pack
        • 6.2.2.2 Configure your IP
        • 6.2.2.3 General
    • 6.3 Management
      • 6.3.1 Starting
      • 6.3.2 Shutdown
      • 6.3.3 Cleaning
      • 6.3.4 Compile Quest
  • Web Environment
    • 7.1 Domain name
    • 7.2 Installation
      • 7.2.1 Apache
      • 7.2.2 PHP
      • 7.2.3 Certbot
    • 7.3 Configuration
      • 7.3.1 Apache
      • 7.3.2 PHP
      • 7.3.3 Certbot
      • 7.3.4 Virtual Hosts
    • 7.4 HTTP Versus HTTPS
  • Compilation Environment
    • 8.1 FreeBSD
      • 8.1.1 Installation
      • 8.1.2 Preparation
      • 8.1.3 Compilation
    • 8.2 Windows
      • 8.2.1 Installation
      • 8.2.2 Preparation
      • 8.2.3 Compilation
  • Save / Transfer / Migration
    • 9.1 Save
      • 9.1.1 ServerFiles
      • 9.1.2 SourceFiles
      • 9.1.3 Database
    • 9.2 Transfer
      • 9.2.1 Method SCP
        • 9.2.1.1 From the source server
        • 9.2.1.2 From the target server
      • 9.2.2 Method TAR
      • 9.2.3 Method SQL
    • 9.3 Migration

}

}

CMasterGuide::Init()

{

 

Révélation

spacer.png

 

If you read this message, it is because you are looking for a way to setup a server of our favorite MMORPG: Metin2. First of all, know that with this guide in hand, you will know at the end of it how to create, manage and modify your Metin2 Server as much as you want!

 

First of all: some basic computer skills are recommended. Metin2 uses several programming languages to work, such as LUA, Python, C, C ++ and SQL... However, with this guide and with the extensive documentation on the subject, anyone who wants to get involved in this will most likely set-up his own server.

 

We are lucky to have the Sources of Metin2, that is to say that with the sources and some programming knowledge, you will be able to design your own systems, add character classes, add realms and a bunch of other things ! Either way, thanks to the sources, you will have complete control over the game! This part is reserved for people with knowledge of programming. Programming requires analysis and understanding of errors and the information that is transmitted by the compiler regardless of the tutorials and shares offered...

 

I want to reassure you on one point, to start, it is not necessary to work on the Sources of Metin2, the sources must be used only if you want to stand out and it mainly depends on the type of game that you want to offer to your players or simply if you want to fix bugs that require changes in the sources.

 

Creating a Metin2 Server begins with emulating an operating system in addition to yours: FreeBSD. FreeBSD is a UNIX-like operating system, on which the Metin2 Server Files mainly run. It is the emulation of a second operating system which consumes processor, RAM and storage resources on the host system, that is to say, your computer.

 

If you use a dedicated server, a VPS or some side computer that you don't use anymore, you will install FreeBSD directly as the main operating system without going through Windows!

 

You have the option of self-hosting and installing it on your computer if the latter is sufficiently efficient. Local use for testing will be recommended, then the acquisition of a dedicated server from a host such as OVH, SoYouStart or Kimsufi for public use with players, for a few euros per month is the way to go.

 

Install / Configure / ManagementFreeBSD (§) (§) (§)

{

 

Révélation

 

  Don't follow if you are using a dedicated server  

  Don't follow if you import your VirtualBox VM  

 

ServerFiles can run on both Windows and FreeBSD, which are both operating systems. FreeBSD is a free system, like Debian Fedora or Ubuntu, which are mainly used to design Web servers or Mail servers because they do not have a graphical interface and they are less energy-consuming. They are mainly used on the command line along with PuTTY! As the version running under FreeBSD is the most widespread, this is where we are going to start to create our Metin2 server!

 

Which one to choose? With or without VirtualBox? But first of all... VirtualBox... what's that? 

Oracle VM VirtualBox is an open source sofware released by Oracle. It allows you to create virtual computers on which you can install the operating system of your choice. The VM has no contact with the host system, which is your computer. The use of VirtualBox requires that your computer is efficient because it will consume resources, CPU, RAM and storage.

 

Quick tip for you based on your situation:

  • If you don't have a server with a host (Dedicated / VPS), choose with VirtualBox...
  • If you have a server or you go from a VirtualBox server to a public server (Dedicated / VPS), choose without VirtualBox...
  • If you are a beginner and you want to learn: choose with VirtualBox...
  • If you already have a VirtualBox VM : choose to import a VirtualBox VM...

 

1.1 FreeBSD (§)

{

1.1.1 With VirtualBox (§) (§) (§) (§)

{

Révélation

 

  Don't follow if you are using a dedicated server  

  Don't follow if you import your VirtualBox VM  

  Download FreeBSD 12.0 ISO    Download VirtualBox    Website FreeBSD  

 

To start, you click on: New ...

 

1710530000.png

 

1710530001.png

 

For a smoother experience it is recommended to allocate at least 2Gb of RAM to your VirtualBox VM. If you can allocate more, go for 4096Mb.

 

1710530002.png

 

1710530003.png

 

1710530004.png

 

1710530005.png

 

The size you specify is the maximum size of the virtual hard drive, which is called a VDI. I want to reassure you, the size will be dynamically allocated and the size of the .VDI file will be adjusted according to the data that you transfer to your VM VirtualBox.

 

1710530006.png

 

1716170007.png

 

Click on the name of you VirtualBox VM and then click on configure. This part is very important, this is where you give your VirtualBox VM permission to connect to internet. You must choose "Bridged Adapter" acces and then select the main network card that your computer uses, wether you use WiFi or Ethernet.

 

1721440008.png

 

Here you must specify the .ISO disk image of our FreeBSD installation. The one you downloaded a few minutes before.

 

1721440009.png

 

spacer.png

 

spacer.png

 

spacer.png

 

0.png


1.png

 

Select the language of your keyboard inputs, we will select a french keyboard but simply select the pattern of your physical keyboard for more convenience. We will select French settings all along the installation, simply adapt with yours.


2.png

 

man forums GIF

 

MiaW Corporation


3.png


4.png


5.png


6.png


7.png


8.png


9.png


10.png

 

When you enter the password for the root user, it will not appear on your screen, this is normal, don't panic... For real, don't panic


11.png


12.png


13.png


14.png


15.png


16.png

 

These are the DNS settings

 

  • 1.1.1.1 corresponds to CloudFlare DNS
  • 8.8.8.8 corresponds to Google DNS
  • 8.8.4.4 corresponds to Google DNS


17.png


18.png


19.png


20.png


21.png


22.png


23.png


24.png


25.png


26.png


27.png


28.png

 

Don't forget to eject the virtual optical disk right now, otherwise VirtualBox will restart the FreeBSD installation process. When restarting the VirtualBox VM, on the upper corner, click on Devices > Optical Drive > Remove Disk from Virtual drive.

 

If you haven't been fast enough, don't panic. Eject the disc from the virtual drive, then click on tab Machine> Reset and confirm.

 

spacer.png

}

1.1.2 Import a VirtualBox VM (§) (§) (§)

{

 

Révélation

 

 Don't follow if you are using a dedicated server

  Download VirtualBox  

 

There are several ways to provide a VirtualBox VM, none are bad, only the way to add it to your list differs. There are currently two ways to my knowledge, depending on the file format you have, choose the method that works best.

 

  • Provide the raw virtual hard disk in .VDI, .VHD or .VDMK format
  • Export the VirtualBox VM in .OVA format

 

1.1.2.1 Format .VDI / .VHD / .VMDK (§) (§) (§)

{

Révélation

 

 Don't follow if you are using a dedicated server  

  Download VirtualBox  

 

If you have a VirtualBox VM with a .VDI, .VHD file or .VDMK, you therefore have on hand the virtual hard disk of your VirtualBox VM. Let's take care of importing it :

 

1710530000.png

 

1752310001.png

 

1710530002.png

 

For a smoother experience it is recommended to allocate at least 2Gb of RAM to your VirtualBox VM. If you can allocate more, go for 4096Mb.

 

1703460013.png

 

1703460014.png

 

1703460015.png

 

1703460016.png

 

1703460017.png

 

Click on the name of you VirtualBox VM and click on Configure. This part is very important, this is where you allow your VirtualBox VM permission to connect. You must choose "Bridged Adapter" then select the main network card that your computer uses, wether you use WiFi or Ethernet.

 

1721440008.png

 

Validate, then Start after selecting your VirtualBox VM. This one ... will start! You will find the login credentials on the subject from which you took your VirtualBox VM.

 

spacer.png

}

1.1.2.2 Format .OVA (§) (§) (§)

{

Révélation

 

  Don't follow if you are using a dedicated server  

  Download VirtualBox  

 

If you have a VirtualBox VM with an .OVA file, this is a much faster solution than a conventional import. Indeed, VirtualBox takes care of everything. To do this, you just have to double click on the .OVA file, VirtualBox will open this file and offer to import it:

 

1714550018.png

 

Click on Import

 

1714550019.png

 

Well done...

 

1716170007.png

 

Click on the name of you VirtualBox VM and click on Configure. This part is very important, this is where you allow your VirtualBox VM permission to connect. You must choose "Bridged Adapter" then select the main network card that your computer uses, wether you use WiFi or Ethernet.

 

1721440008.png

 

Confirm, and click Start after selecting your VirtualBox VM. This one... Will start! You will find the login credentials on the subject from which you took your VirtualBox VM.

 

spacer.png

}

}

1.1.3 Without VirtualBox (§) (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Without Virtualbox? But how are you going to do? The installation of FreeBSD is different between the hosts, in general the default configuration is enough. I recommend that you use the installation of FreeBSD 12.0 at best, this version is currently used in this guide. Your host must provide you with several pieces of information in order to be able to connect to your server via PuTTY. Your host, during installation, may also ask you to create another user other than the main account which is root.

 

  • IPv4 Adress...
  • SSH port if it has not been changed : 22...
  • The root user password...

Usually, it will be pretty straight-forward and quick.

}

}

1.2 Install (§) (§)

{

1.2.1 DNS (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

  Il est possible que cette modification soit déjà effective sur un serveur dédié  

 

DNS? What is that?! It is the configuration file of the resolver library used to determine, among other things, which DNS servers the server will use. You can replace the configuration by this one:


ee /etc/resolv.conf

And replace it with this :


nameserver 127.0.0.1
nameserver 1.1.1.1
nameserver 8.8.4.4
nnameserver 8.8.8.8

options edns0

Those are quick DNS servers (Google & Cloudflare), the fastest to resolve all around the globe pretty much. But you can use some others if you know them and if they are reliable and fast enough.

 

Save it using: CTRL + C

Leave the editor by selecting: exit

 

Well done...

}

1.2.2 PKG (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

  Il est possible que cette modification soit déjà effective sur un serveur dédié  

 

PKG ? What is that ? PKG is a package manager. Thanks to it, you can install packages, that is, programs that you can use under FreeBSD. PKG itself is a program. However, during a recent installation of FreeBSD, the package manager may not be activated or installed by default. An advantage of PKG is the fact that it automatically installs the dependencies of the programs we want to install! On your VirtualBox VM, write this :


pkg -y

If you see :


Ignore the mismatch and continue ? [ Y / n ] :

Write this :


y

The package manager is now installed and activated. We will update it, for that, write this :


pkg update

If you see :


Ignore the mismatch and continue ? [ Y / n ] :

Write this :


y

PKG is now installed, activated and updated.

}

1.2.3 Nano (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Nano ? What's that... ? Nano is a text editor in FreeBSD ! We will use it to configure our installation and as the name suggests, it is ... light! On your VirtualBox VM, execute this command:


pkg install -y nano

Nano is now installed and activated ... We will use it soon to edit configuration files

}

 

1.2.4 WGet (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

WGet ? WebGet ! WGet is like fetch, they do exactly the same ! His utility ? It allows FreeBSD to download content from the internet, handy for downloading an archive directly to your server! On your VirtualBox VM, execute this command :


pkg install -y wget

WGet is now installed and activated ... We will use it soon ...

}

1.2.5 Librairies (§)

{

Révélation

 

  Only you have a dysfunction related to libraries  

  Manually download libraries  

 

A library or software library is a set of utility functions, grouped together and made available so that they can be used without having to rewrite them. Libraries are handled by the linker and the operating system. The operations are different depending on whether the library is static or shared. Library locations and names vary by operating system.

 

We will install the libraries, those of FreeBSD 12.0:


wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/12.0-RELEASE/lib32.txz

Wait a moment and write :


tar Jxpvf lib32.txz -C /

 Finally, there is no need to clutter up with the file that your server has downloaded, to delete it:


rm lib32.txz

If you still have this malfunction on a library that your server does not find you also have the option of installing it manually if you have the library in a personal archive or download from the Internet. You must then transfer the libraries which are requested to you:

 

  • FreeBSD 64 Bit Répertoire /usr/lib
  • FreeBSD 32 Bit : Répertoire /usr/lib32

 

We just have to restart your server.

 

  NEVER   REPLACE   AN   EXISTING   LIBRAIRY 

 

}

}

1.3 Configure (§) (§)

{

1.3.1 SSH (§) (§)

{

Révélation

 

  If you are on a dedicated server, the modification may already be effective  

  Don't follow if you import your VirtualBox VM  

 

SSH ? What's that ? Secure Shell is both a computer program and a secure communication protocol. We use SSH to connect to the server with PuTTY in command line or even via WinSCP in SFTP for file transfers for example ... We will modify the configuration of SSH in order to allow the root user to connect to it .

 

On your VM Virtual Box, write this :


nano /etc/ssh/sshd_config

 To move around the file using Nano, use the arrow keys on your keyboard. Search :


#PermitRootLogin no

Modified by, don't forget to remove the #


PermitRootLogin yes

Save the configuration. The configuration of SSH finished, we will start the service so that it can apply the modifications, for that, write this:


service sshd restart

If you see :


Starting sshd...

All is good, you are now able to connect to the server in SSH with our main user : root.

}

}

1.4 Use (§)

{

1.4.1 Nano (§)

{

Révélation

 

  Required : 1.2.2 Nano  

 

 Nano, this small command line text editor is simple to use, to edit a configuration file, we will always use this pattern:


nano /directory/file.extension

To move within in a text file with Nano, we must use the arrow keys, when it will be necessary to save the file, it will be necessary to make the combination on your keyboard:


CTRL + X

You will be offered several choices:


Save modified buffer ?
Y Yes
N No
C Cancel

You will have to write the corresponding letter of your choice:

 

  • Y for confirm and save
  • N for cancel and leave Nano
  • C to cancel and continue editing

 

 When you accept and save, Nano will ask you to confirm that the file you want to replace:


File Name to Write : /directory/file.extension

 You must confirm with this key on your keyboard:


ENTER

Congrats, now you know Nano ! 

}

}

1.5 Network / Internet (§) (§)

{

1.5.1 Static IP (§) (§)

{

Révélation

 

  Don't follow if you are using a dedicated server  

 

Your router's DHCP keeps changing the IP of your VirtualBox VM ? I have the solution ! But first, what is DHCP ? The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol networks whereby a DHCP server dynamically assigns an IP address and other network configuration parameters to each device on a network so they can communicate with other IP networks. Let's turn off DHCP, Fantastic isn't it?

 

On your VirtualBox VM, write this :


bsdconfig

 

0000001.png


0000002.png


0000003.png


0000004.png

 

You have to deactivate the DHCP option and you simply have to register. Your VirtualBox VM will remain configured on the IP address currently present in the field: ipaddr.


0000005.png


0000006.png

 

spacer.png

 

You must enter the default gateway of your router. For this, on your computer, you must do the following keyboard combination:  : WINDOWS + R and you write CMD. A window should open ! Write this :


ipconfig

You must retrieve the field: Default gateway which is linked to your connection, for that, are you using WiFi or Ethernet? To help you, in general the default gateways are as follows: 192.168.0.1 or 192.168.0.254 or 192.168.1.1 or even 192.168.1.254 ... Check the one your router has!

 

spacer.png


0000007.png


0000008.png

 

Your VirtualBox VM now has an IP address which will be fixed and will not change anymore ...

}

1.5.2 Retrieve your IP (§) (§)

{

Révélation

 

  Don't follow if you are using a dedicated server  

 

Get your ip ? You lost it ? We need to know the IP address of the VirtualBox VM in order to be able to connect to it, whether for PuTTY, WinSCP, Navicat or simply via the Metin2 ClientFiles. Nothing simpler, for that, execute this command:


ifconfig

You must have a line that starts with: em0 or something similar, depending on the hardware configuration. You must retrieve the IP which is located just after the INET. This is the IP address of your VM ...

}

}

}

Install / Configure / Use PuTTY (§)

{

Révélation

 

  Download PuTTY  

 

PuTTY is an SSH and telnet client, it will allow you to connect to your server in SSH. This avoids having the VirtualBox interface, PuTTY is much more ergonomic if you want to copy / paste commands ... Convinced ? So let's do it :

 

spacer.png

 

  1. Enter the IP address in the field Host Name
  2. Enter the SSH port in the field Port ( Défaut : 22 )
  3. Enter any name you want in the field : Saved Sessions
  4. Click on Save et it's done...

 

All you have to do is double click on the registered server of your choice. PuTTY will ask for your FreeBSD user name and password. It can also ask you to confirm the connection to the SSH server and announce a security problem, don't panic, click Yes.

 

spacer.png

}

Install / Configure / Use WinSCP (§)

{

Révélation

 

  Download WinSCP  

 

WinSCP ? What's that ?! WinSCP is a graphical SFTP client for Windows. It uses SSH and is open source. The SCP protocol is also supported. The purpose of this program is to allow secure copying of files between a local computer and a remote computer. We will use it to transfer files to it for example. The configuration, identical to that of PuTTY is simple:

 

1728240010.png

 

  1. Enter your IP address in the field: Host name
  2. Enter the SSH port in the port: Port number ( Default : 22 )
  3. Enter the username: root: in the field: User name
  4. Enter the password of: root: in the field: Password
  5. Click on the button : Save...

 

1723240011.png

 

  1. Enter the name you want in the field: Save the session as
  2. Check the box: Save password (not recommended)
  3. Click on the button: OK

 

All you have to do is double click on the registered server of your choice. WinSCP will connect automatically using the username and password that have been saved. It can also ask you to confirm the connection to the SFTP server and announce a security problem, don't panic, click Yes.

 

1744570012.png

}

Install / Configure / Management MySQL (§) (§)

{

4.1 Install (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

MyWhat ? MySQL, it is a database manager, it records all the information relating to your accounts, your characters, inventories ... It uses what is called SQL language. Without him we would be nothing! Thanks WHO ? Thank you MySQL! There are other SQL servers such as PostgreSQL, Oracle, SQLite, MariaDB ... Well, now let's install MySQL 8.0 ... For this, on PuTTY, execute this command:


pkg install -y mysql80-server mysql80-client

 

It's done !

}

4.2 Configure (§) (§)

{

4.2.1 Start MySQL (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Now that it's installed, it might be time to start it, right? What the hell are you waiting for? By default, MySQL does not start when the system starts. For this we will ask FreeBSD to start it each time it is started, on PuTTY:


sysrc mysql_enable="YES"

We have one last modification to do in order to be able to use MySQL ...


nano /usr/local/etc/mysql/my.cnf

Search :


bind-address = 127.0.0.1

 Modify by, you must add # at the beginning of the line:


#bind-address = 127.0.0.1

 Save and we just have to launch our MySQL server so that the modification is taken !


service mysql-server start

If you got this message :


Starting mysql...

MySQL is started.

}

4.2.2 First Connection (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

MySQL is started, we will change the password of the local MySQL user: root.


mysql_secure_installation

If you see :


VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin ?
Press y | Y for Yes, any other key for No :

You write :


n

  If you see :


Using existing password for root...
Change the password for root ? ((Press y | Y for Yes, any other key for No) :

You write :


y

At this stage, it should ask you for a new password which you should confirm twice: Just like installing FreeBSD, you will not see the password displayed, this is normal.


New password : 

If you see :


Remove anonymous users ? (Press y | Y for Yes, any other key for No) :

You write :


y

If you see :


Disallow root login remotely ? (Press y | Y for Yes, any other key for No) :

You write :


n

If you see :


Remove test database and access to it ? (Press y | Y for Yes, any other key for No) :

You write :


y

If you see :


Reload privilege tables now ? (Press y | Y for Yes, any other key for No) :

You write :


y

MySQL is set up and the password for the local root user has been changed!

}

}

4.3 Create a Database (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

We need to create the databases so that our Metin2 server can store the information it needs there ... Let's get started! We will first connect to MySQL from the command line:


mysql -u root -p

If you see :


Enter password :

Enter the password you chose earlier. Metin2 uses multiple databases, now runs each line individually on PuTTY:

 

M2P


CREATE DATABASE metin2;

 

M2P 2014


CREATE DATABASE account;
CREATE DATABASE common;
CREATE DATABASE player;
CREATE DATABASE hotbackup;
CREATE DATABASE log;

For each line, you should have:


Query OK, 1 row effected (0.00 sec)

If so, you've created the databases that Metin2 to run! Finally :


exit;

You just left MySQL.

}

4.4 Create User (§) (§)

{

 

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

MySQL has 2 types of users :

 

  • Local ( Localhost )
    • A local user can connect to the MySQL server exclusively locally and will not be allowed to connect from the outside. A local user who tries to connect from the outside will have an error telling him that his accesses are not authorized.

 

  • Publique ( % / IP )
    • A public user can connect to the MySQL server both locally and externally. The use of the user type depends on the level of security you wish to set up. You can also define an IP from which the account is authorized to connect, watch out for dynamic IPs. "%" will accept all IPs.

 

4.4.1 Local User (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

We installed MySQL, configured and created the databases, what do we do now? Patience. We will now create MySQL users to run our Metin2 ServerFiles. To do this, let's connect to MySQL:


mysql -u root -p

If you see :


Enter password :

We will create our first local user. The user to be used by Metin2 ServerFiles.

 

M2P


CREATE USER 'metin2'@'localhost' IDENTIFIED BY '@METIN2!';

 

M2P 2014


CREATE USER 'metin2_2014'@'localhost' IDENTIFIED BY '@METIN2!';

If you see :


Query OK, 0 rows affected (0.00 sec)

You write :


exit;

You have just quit MySQL.

}

4.4.2 Public User (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

We are going to create our second public user that we will use to connect from for example: Navicat, a database manager software on Windows, it is recommended not to use the same username and password that an existing local user:


mysql -u root -p

If you see :


Enter password :

 

You write your password and this :

 

M2P


CREATE USER 'metin2'@'%' IDENTIFIED BY '@METIN2!';

 

M2P 2014


CREATE USER 'metin2_2014'@'%' IDENTIFIED BY '@METIN2!';

If you see :


Query OK, 0 rows affected (0.00 sec)

For leave, you can write :


exit;

You have just quit MySQL.

}

}

4.5 Permissions / Access rights (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Having a database is good ... Having a MySQL User is good, too ... But having the right to modify a database is better. We will fix that right now!


mysql -u root -p

If you see :


Enter password :

We are going to pass to the attribution of rights and permissions on our databases on the user(s) of our choice ... Execute these lines individually :

 

M2P


GRANT ALL PRIVILEGES ON metin2.* TO 'metin2'@'localhost';

GRANT ALL PRIVILEGES ON metin2.* TO 'metin2'@'%';

 

M2P 2014


GRANT ALL PRIVILEGES ON account.* TO 'metin2_2014'@'localhost';
GRANT ALL PRIVILEGES ON common.* TO 'metin2_2014'@'localhost';
GRANT ALL PRIVILEGES ON player.* TO 'metin2_2014'@'localhost';
GRANT ALL PRIVILEGES ON hotbackup.* TO 'metin2_2014'@'localhost';
GRANT ALL PRIVILEGES ON log.* TO 'metin2_2014'@'localhost';

GRANT ALL PRIVILEGES ON account.* TO 'metin2_2014'@'%';
GRANT ALL PRIVILEGES ON common.* TO 'metin2_2014'@'%';
GRANT ALL PRIVILEGES ON player.* TO 'metin2_2014'@'%';
GRANT ALL PRIVILEGES ON hotbackup.* TO 'metin2_2014'@'%';
GRANT ALL PRIVILEGES ON log.* TO 'metin2_2014'@'%';

You should get this message for each line:


Query OK, 0 rows affected (0.00 sec)

You will now validate our permissions with:


FLUSH PRIVILEGES;

Tu dois a nouveau obtenir ceci :


Query OK, 0 rows affected (0.00 sec)

To log out of MySQL:


exit;

You have just quit MySQL.

}

}

Install / Configure / Use Navicat (§)

{

Révélation

 

  Download Navicat  

 

Navicat ? Navicat is a series of graphical database management and development software produced by PremiumSoft CyberTech Ltd. for MySQLMariaDBMongoDBOracleSQLitePostgreSQL and Microsoft SQL Server. It has an Explorer-like graphical user interface and supports multiple database connections for local and remote databases.

 

spacer.png

 

 

  • Enter the name you want in the field : Connection Name
  • Enter the IP address in the field: Host
  • Enter the MySQL port in the field : Port ( Défaut : 3306 )
  • Enter the username of a public account in the field : User Name
  • Enter the password associated with your user in the field : Password
  • Check the box : Save password

 

spacer.png

 

To make sure that the connection is established, you can click on the button: Test Connection, if you have this message below, everything is good! It only remains to confirm by double clicking on the buttons: OK.

 

spacer.png

 

To connect to a MySQL server, you just have to double click on it, in the left part of the program.

}

Install / Configure / Management M2 Project (§) (§)

{

6.1 Install (§) (§)

{

6.1.1 ServerFiles (§) (§)

{

Révélation

Install ServerFiles, well it's simple! You simply have to copy the archive of your ServerFiles in .TAR.GZ or .TGZ format and send them to the usr folderof your FreeBSD server, then we will extract the archive with this command:


cd /usr

And for extract :


tar xzvf m2sf.tgz

Done.

}

6.1.2 SourceFiles (§) (§)

{

Révélation

Install SourceFiles, well it's simple! You simply have to copy the archive of your SourceFiles in .TAR.GZ or .TGZ format and send them to the src folder located in usr of your FreeBSD server, then we will extract the archive with this command:


cd /usr/src

And for extract :


tar xzvf m2srcs.tgz

Done.

}

6.1.3 Database (§) (§)

{

Révélation

Installing the databases is relatively simple, you must connect to your MySQL server using Navicat, then open each of your databases, then:

 

spacer.png

 

Select the .SQL file associated with the name of your database:

 

spacer.png

 

spacer.png

 

spacer.png

 

You must do this for each of your databases, account, common, player, hotbackup, log or even metin2.

}

}

6.2 Configure (§)

{

6.2.1 ServerFiles (§)

{

6.2.1.1 Create an account (§)

{

Révélation

 

  Crypter le mot de passe  

 

Creating an account manually is simple, for this we will use Navicat to connect to the MySQL server. We are going to edit the account table, it is located:

 

  • M2P : metin2
  • M2P 2014 : account

 

spacer.png

 

To open an SQL data table, just double click on it. To manually add an account from Navicat, you must click on the + at the bottom left and fill in the boxes like this, these fields are the most important, the rest are optional and will be filled in automatically by the default settings:

 

  • ID : Do not fill in, it is filled automatically after validation
  • LOGIN : Account identifier, the one we will use to connect to the Client
  • PASSWORD : This is the account password, which you must encrypt
  • SOCIAL_ID : C'est le code de suppression d'un personnage
  • EMAIL : Account email address
  • CREATE_TIME : Account creation date
  • STATUS : Account status, OK or BLOCK if it should be banned
  • SECURITYCODE : ?
  • AVAILDT : ?
  • MILEAGE : DC
  • CASH : MD
  • GOLD_EXPIRE Double Chance of Drop
  • SILVER_EXPIRE 50% more experience
  • SAFEBOX_EXPIRE More space in the Warehouse
  • AUTOLOOT_EXPIRE A hand that automatically picks up the Yangs
  • FISH_MIND_EXPIRE Chance of catching fish increases
  • MARRIAGE_FAST_EXPIRE Love points increase faster
  • MONEY_DROP_RATE_EXPIRE Double Chance to Drop Yangs
  • LAST_PLAY : Date of last connection

 

To encrypt the password, you will find the tool above. In the URL, you have : password.php=password=XXX, Just replace XXX with the password you want and copy the content that will be generated. This allows your passwords not to be unencrypted in the server database, for security reasons. Finally, press the ENTER key on your keyboard to confirm:

 

spacer.png

 

When it's done, you can directly use the new create.

}

6.2.1.2 Permissions GM (§)

{

Révélation

Adding permissions, for this we will use Navicat to connect to the MySQL server. We are going to edit the gmlist table, it is located:

 

  • M2P : metin2
  • M2P 2014 : common

 

spacer.png

 

To open an SQL data table, just double click on it. To manually add an account from Navicat, you must click on the + at the bottom left and fill in the boxes like this :

 

  • MID : Do not fill in, it is filled automatically after validation
  • MACCOUNT : The account identifier, the one to use to connect to the Client
  • MNAME : It is the name of the character, it must be strictly identical, if it does not already exist, it does not matter, the important thing here is to choose a name which will be that of your character
  • MCONTACTIP  : The box is empty by default, however some explanations: this allows you to assign the rights to an account according to the connection IP address, this simply prevents someone from connecting to your account to take advantage of your access, to avoid if the player has a dynamic IP address
  • MSERVERIP : The box is on ALL by default, however some explanations: this is in the case where you have several Metin2 servers running on the same FreeBSD server, this allows you to assign access to a particular server, this requires adding the server IP in the gmhost table
  • MAUTHORITY : This is the level of access rights in play, you can check the access level of a command from the SourceFiles of Metin2
    • GOD : Limited access 
    • HIGH_WIZARD : Limited access
    • WIZARD : Limited access
    • LOW_BIZARD : Limited access
    • IMPLEMENTOR : Full access

 

Finally, press the ENTER to confirm :

 

spacer.png

 

Now that you have defined the accesses, we have to reload the access rights, you have two solutions:

 

  • If an account with a GM character already exists, simply write this command in game and disconnect / reconnect the concerned account: /reload a
  • If you don't have any GM characters, you just have to restart the Metin2 server

 

Enjoy !

}

6.2.1.3 General (§)

{

}

}

6.2.2 ClientFiles (§)

{

6.2.2.1 DePack / UnPack / RePack (§)

{

6.2.2.1.1 Method EterNexus (§)

{

6.2.2.1.1.1 Configure (§)

{

Révélation

 

  The default configuration is sufficient  

 

To configure EterNexus :

 

spacer.png

 

spacer.png

 

spacer.png

 

spacer.png

}

6.2.2.1.1.2 DePack / UnPack (§)

{

Révélation

spacer.png

}

6.2.2.1.1.3 RePack / Pack (§)

{

Révélation

spacer.png

}

}

6.2.2.1.2 Method EterManager (§)

{

6.2.2.1.2.1 Configure (§)

{

Révélation

During the first start-up you must configure EterManager for your Metin2 Client. Nothing could be simpler, click on Manage at the top left of EterManager then on Profiles.

142225em2.png

 

The advantage of EterManager is its profile system, in fact you can manage several profiles. You can change your profile at any time according to the profiles available at the bottom left of EterManager.

 

Right click in the Profiles available area allows you to obtain a contextual menu which allows you to:

 

  1. Use selected profile
  2. Add user
  3. Remove selected user...

 

Le paramétrage d'un profil ce fait comme ci :

 

  1. Name : The name you want to indicate to your profile ...
  2. Working Directory : You must enter the full path to the pack folder of your Metin2 Client ...
  3. Unpack Directory : You must enter a full path to the folder of your choice, it can be identical to Working Directory...
  4. Index Key* : B9-9E-B0-02-6F-69-81-05-63-98-9B-28-79-18-1A-00
  5. Pack Key* : 22-B8-B4-04-64-B2-6E-1F-AE-EA-18-00-A6-F6-FB-1C
  6. Index Extension* : .eix
  7. Pack Extension* : .epk
  8. Is default : Check the box if you want this to be the default profile ...
  9. Don't forget to save !

 

* : Steps 4 & 5, these are default keys that can be used for the majority of shared clients. If you have personalized your keys in the sources then you must enter your own keys.

 

* : Steps 6 and 7 these are the default extensions of the Metin2 Client, if you have modified the default extensions in the sources then you must enter your own extensions.

}

6.2.2.1.2.2 Features (§)

{

Révélation

Virtual Tree View allows you to view the tree structure as seen by the Metin2 Client thanks to a live reading of the packs of your Metin2 Client. To access this tool: you must click on Tools  then on Virtual Tree View ...

 

142225em5.png

 

EterManager allows you to view the contents of the index of one of your packages, which allows you, for example, to check if your file has been correctly archived by the software. It is accessible from the following icon, available if only an archive exists : 142225em9.png...

 

142225em4.png

 

EterManager offers you other parameters in the use of this software. You can right click in the main EterManager area (where packs are located) to obtain the following context menu:

 

191818em10.png

 

This context menu allows you to :

 

  1. Define the compression method for the selected pack ...
  2. Decompress the selected pack ...
  3. Compress the selected pack ...
  4. Removes the selected package from EterManager view ...
  5. This option allows you to define the number of simultaneous tasks ...
  6. Select or Deselect packs ...

 

Well done...

}

6.2.2.1.2.3 DePack / UnPack (§)

{

Révélation

To decompress, depack a pack of your Metin2 Client you must simply click on the button which allows you to extract the pack you wish : 142225em7.png...The advantage with EterManager, you can extract several packs at the same time without waiting for the extraction of the first to be completed! You can find the decompressed pack in the folder that you have configured yourself in the name of the extracted pack.

 

142225em3.png

 

Well done...

}

6.2.2.1.2.4 RePack / Pack (§)

{

Révélation

To compress, repack a pack of your Metin2 Client you must simply click on the button which allows you to archive the pack you wish : 142225em8.png... The advantage with EterManager, you can archive several packs at the same time without waiting for the archiving of the first one to be finished! Your archive will be automatically created in the pack directory of your Metin2 Client.

 

You can also modify the compression type of your archive using the Pack filter column, the Raw format is a raw format in which there is a total absence of compression. You also have the Lzo format which allows you to further compress your archive and reduce its final size.

 

142225em6.png

 

142225em3.png

 

Well done...

}

}

}

6.2.2.1 Configure your IP (§)

{

}

6.2.2.1 General (§)

{

}

}

}

6.3 Management (§)

{

6.3.1 Start (§)

{

}

6.3.2 Shutdown(§)

{

}

6.3.3 Clean (§)

{

}

6.3.4 Quest (§)

{

}

}

}

Web Environment (§) (§)

{

7.1 Domain name (§)

{

Révélation

 

  To be followed imperatively for users wishing to have a web server  

 

 

In order to customize your server and follow the guide on creating a web environment, you must obtain a domain name from the host / registrar of your choice, there are plenty, OVHCloud, CloudFlare, NameCheap ...

 

If you have your domain name in hand, it is essential to make a type A registration to the IP address of your FreeBSD server. For example :

 

  • You have a domain : domain.com, you must add a type A entry to your server's IP to domain.com.
  • If you have a subdomain : subdomain.domain.com, you must add a type A entry to your server's IP to subdomain.domain.com.

 

If you don't do this, you can't follow this part. The addition of an entry / registration depends on the host / registrar but remains relatively simple to set up ...

}

7.2 Install (§) (§)

{

7.2.1 Apache (§) (§)

{

Révélation

 

    Don't follow if you import your VirtualBox VM    

 

Apache HTTP Server free software is an HTTP server, Apache is an open-source and cross-platform web server. To install it on PuTTY :


pkg install -y apache24

Apache is now installed.

}

7.2.2 PHP (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

PHP Hypertext Preprocessor, better known by its acronym PHP, is a free programming language, mainly used to design dynamic Web pages via an HTTP server, but which can also function like any language interpreted locally. PHP is an imperative object oriented language. It can be easily integrated into HTML. We are going to PHP with its multiple functions in order to be quiet when designing your sites:


pkg install -y php74 mod_php74 php74-bcmath php74-bz2 php74-curl php74-dba php74-dom php74-enchant php74-exif php74-extensions php74-fileinfo php74-filter php74-ftp php74-gd php74-gettext php74-gmp php74-imap php74-json php74-ldap php74-lz4 php74-mbstring php74-mysqli php74-odbc php74-opcache php74-openssl php74-pdo php74-pdo_mysql php74-pdo_odbc php74-pdo_pgsql php74-pdo_sqlite php74-pgsql php74-pspell php74-readline php74-session php74-simplexml php74-snmp php74-soap php74-sockets php74-sqlite3 php74-tidy php74-xml php74-xmlreader php74-xmlrpc php74-xmlwriter php74-xsl php74-zip php74-zlib php74-zstd

PHP is now installed, we will go to its configuration in a few moments ...

}

7.2.3 Certbot (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Let's Encrypt is a certification authority. This authority provides free certificates for the TLS cryptographic protocol by means of an automated process via Certbot, thanks to these SSL certificates you can obtain HTTPS on your website:


pkg install -y py37-certbot py37-certbot-apache

Certbot is now installed, we will go to its configuration in a few moments ...

}

}

7.3 Configure (§) (§)

{

7.3.1 Apache (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

By default, Apache does not start when the system starts. For this we will ask FreeBSD to start it each time it is started, on PuTTY:


sysrc apache24_enable="YES"

We will configure Apache on its modules, we activate the URL rewriting module as well as the module for the creation of Virtual Hosts in order to obtain several sites on the same server:


nano /usr/local/etc/apache24/httpd.conf

Module vHosts

 

Search :


#Include etc/apache24/extra/httpd-vhosts.conf

Replaced by :


Include etc/apache24/extra/httpd-vhosts.conf

 

Module Rewrite

 

Search :


#LoadModule rewrite_module libexec/apache24/mod_rewrite.so

Replaced by :


LoadModule rewrite_module libexec/apache24/mod_rewrite.so

 

Module SSL

 

Search :


#LoadModule ssl_module libexec/apache24/mod_ssl.so

Replaced by :


LoadModule ssl_module libexec/apache24/mod_ssl.so

 

ServerName

 

Search :


#ServerName www.example.com:80

Replaced by :


ServerName 127.0.0.1:80

You can save... Well done...

}

7.3.2 PHP (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

We will copy the PHP configuration file:


cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

We teach Apache the PHP language, for that:


nano /usr/local/etc/apache24/modules.d/001_mod-php.conf

Add this, it's a blank file, it's normal to be empty:


<IfModule dir_module>
	DirectoryIndex index.php index.html
    <FilesMatch "\.php$">
    	SetHandler application/x-httpd-php
	</FilesMatch>
    <FilesMatch "\.phps$">
    	SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>

You can save... Well done...

}

7.3.3 Certbot (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

We will also activate Certbot for the certification of SSL certificates for HTTPS:


sysrc weekly_certbot_enable="YES"

Let's also add a routine to FreeBSD so that it performs automatic renewal of SSL certificates:


echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q" | tee -a /etc/crontab > /dev/null

Well done...

}

7.3.4 Virtual Hosts (§)

{

Révélation

 

  To be followed imperatively for users wishing to have a web server  

 

A step is important in configuring your Web server under FreeBSD, the creation of virtual hosts. Thanks to these it will be possible to manage many sites on the same server, for example you would like to have your main domain for the site and a sub domain for your forum? Ah well, it's possible! It is essential to have set up your domain name in order to assign a type A record to the IP address of your FreeBSD server!

 

Let's start, delete the entire contents of this file, this is an example of configuration which we do not need:


nano /usr/local/etc/apache24/extra/httpd-vhosts.conf

Let's create our first virtual host, for that: add this:


<VirtualHost *:80>
    ServerAdmin example@domain.com
    DocumentRoot "/usr/local/www/apache24/data/domain.com"
    ServerName domain.com
    ServerAlias www.domain.com
    ErrorLog "/var/log/httpd-domain-com-error-log"
    CustomLog "/var/log/httpd-domain-com-access-log" common
</VirtualHost>

In our configuration we have:

 

  • ServerAdmin : It corresponds to your email address, it can be displayed if an error occurs on your site
  • DocumentRoot : It corresponds to the root of the site you create, modify domain.com with your domain name!
  • ServerName : It corresponds to the domain of the site you configured, modify domain.com with your domain name!
  • ServerAlias : It corresponds to the alternative domain of the main domain, mainly used to define the subdomain www
  • ErrorLog / CustomLog : These are the error logs and access to your web server from a browser, everything is recorded

 

If for example you want a subdomain, add this after the first block:


<VirtualHost *:80>
    ServerAdmin example@domain.com
    DocumentRoot "/usr/local/www/apache24/data/subdomain.domain.com"
    ServerName subdomain.domain.com
    ErrorLog "/var/log/httpd-subdomain-domain-com-error-log"
    CustomLog "/var/log/httpd-subdomain-domain-com-access-log" common
</VirtualHost>

In our configuration, what changes?

 

  • DocumentRoot : It corresponds to the root of the site you create, modify subdomain.domain.com with your domain name!
  • ServerName : It corresponds to the domain of the site you configured, modify subdomain.domain.com with your domain name!

 

You can save the file. We will create the directories of our sites according to the domain name : understand that the directories below are the roots of your sites, this is where you will need to install your future website!


mkdir /usr/local/www/apache24/data/domain.com

or :


mkdir /usr/local/www/apache24/data/subdomain.domain.com

We are going to assign the user www to the directory


chown -R www:www /usr/local/www/apache24/data

We start / restart Apache with:


service apache24 restart

If you receive a message similar to:


Performing sanity check on apache24 configuration :
Syntax OK
Starting apache24...

Well done... You just have to install your site, forum or your scripts! You just have to place them in the directories you defined above!

}

}

7.4 HTTP Versus HTTPS (§)

{

Révélation

 

  To be followed imperatively for users wishing to have a web server  

 

HTTPS was invented in order to satisfy the needs of integrity and confidentiality of the exchanged data and especially the authentication of the server. HTTPS is then useful to prevent the theft of information on the site by malicious third parties.

 

When a user visits an unsecured site with their browser, they will see the unsecured mention in red in the address bar. This warning could make him fear the site and leave it to visit another ... It is important to provide your domain name with a security certificate.

 

We will be using Certbot by Let's Encrypt. Let's Encrypt is a certification authority launched on December 3, 2015. This authority provides free X.509 certificates for the TLS cryptographic protocol through an automated process.

 

Let's start the certification process for our domain names !


certbot --apache

If this is the first you have used Certbot, you should get this message :


Enter email address ( used for urgent renewal and security notices ) ( Enter 'c' to
cancel ) :

You must enter a valid email address, indeed Let's Encrypt warns you if a malfunction occurs on your certificate or its validity.

If you see :


Please read the Terms of Service at [...] order to register with the ACME server [...]
( A ) gree / ( C ) ancel :

Write :


a

If you see : :


Would you be willing to share your email address [...] and ways to support digital freedom.
( Y ) es / (N ) o :

Write :


n

If that tells you :


Which names would you like to activate HTTPS for ?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 : domain.com
2 : subdomain.domain.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and / or spaces, or leave input
blank to select all options shown  (Enter 'c' to cancel ) :

You must write the number corresponding to the area you wish to certify:


1

Or for example :


2

If that asks you :


Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 : No redirect - Make no further changes to the webserver configuration.
2 : Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [ 1 - 2 ] then [ enter ] ( press 'c' to cancel ) :

You write :


2

Indeed, automatic redirection from HTTP to HTTPS is recommended! Repeat this action for each of the domain names that you want to secure for your site(s) ! You should get a message similar to:


Obtaining a new certificate
Performing the following challenges:
http-01 challenge for domain.com
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /usr/local/etc/letsencrypt/live/domain.com/fullchain.pem
   Your key file has been saved at:
   /usr/local/etc/letsencrypt/live/domain.com/privkey.pem
   Your cert will expire on 2099-12-31. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /usr/local/etc/letsencrypt. You should
   make a secure backup of this folder now. This configuration
   directory will also contain certificates and private keys obtained
   by Certbot so making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

It's done ! You have your certificate !

}

}

Compilation Environment (§) (§)

{

 

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Completely optional step but necessary if you want to improve your Metin2 server by adding systems and other modifications directly affecting the SourceFiles of the game ... Compiling still requires some knowledge in the programming field, mainly in understanding the errors and alerts that are issued by the compiler.

 

Compilation, in computer science is a work carried out by a compiler which consists in transforming a source code readable by a human into a binary file executable by a machine.

 

The SourceFiles of Metin2, are made up of several files whose extensions are respectively .cpp, .h, .hpp, .c etc ..., these files form what is called: the source code. Compiling these files allows you to obtain programs: qc, db and the game in a UNIX environment with FreeBSD, metin2client.exe, config.exe, worldeditor.exe, dump_proto.exe in a WIN32 environment with Windows ...

 

Source code? The source code allows us to write instructions understandable by Humans and usable by computers through programming languages. The computer can only read one thing, binary! A series of 0 and 1 which are incomprehensible to us, the mortals ... Here is the translation of Funky-Emu in binary:


011011010110010101110100011010010110111000110010011001000110010101110110

A programming language is a way of writing instructions in human language which will be translated into binary language by the compiler. Here are some very simple examples, each of these scripts provide the same result :

 

C


#include <stdio.h>

main()
{
    printf("Hello, world !\n");
}

Python


print "Hello, world !"

Java


public class HelloWorld{
    public static void main(String[] args){
        System.out.println("Hello, world !"); 
    }
}

There are several programming languages, Metin2 uses C, C ++, Python as well as LUA. C and C ++ are used by SourceFiles, Python, and LUA for scripts and quests. What is compilation? Compiling is translating human language into binary with what is called the compiler.

 

040455compilation.png

 

Can we use a program compiled under FreeBSD in Windows, would you say? And well ... no. The compiler you use defines how the program will be interpreted, and therefore defines the operating system that can run it.

 

8.1 FreeBSD (§) (§)

{

1.6.1 Install (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Let's start on PuTTY :


pkg install -y gmake makedepend devil gdb llvm-devel

It was fast?

}

1.6.2 Prepare (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

Compile, well almost, you weren't expecting that right? Well it's simple, you just have to make orders! To do this, we must first compile all the external libraries used by Metin2 SourceFiles.

 

  • CryptoPP
  • LibLUA
  • LibTheCore
  • LibGame
  • LibPoly
  • LibSQL

 

If this is not done: you will get a similar message when compiling qc, db or game projects such as: undefined reference to xxx error [...] exit status...

 

For example for M2 Project, you will find the libraries in these directories:

 

  • M2P /usr/src/m2_project/X.X/srv/
  • M2P /usr/src/m2_project/X.X/data/
  • M2P 2014 /usr/src/m2_project/2014/srv/
  • M2P 2014 /usr/src/m2_project/2014/data/

 

M2SH, M2 Project manager allows you to compile without writing the commands below:

 

M2P

 


cd /usr/src/m2_project/X.X/srv/libsql/ && gmake
cd /usr/src/m2_project/X.X/srv/libpoly/ && gmake
cd /usr/src/m2_project/X.X/srv/liblua/ && gmake
cd /usr/src/m2_project/X.X/srv/libgame/src/ && gmake
cd /usr/src/m2_project/X.X/srv/libthecore/src/ && gmake
cd /usr/src/m2_project/X.X/data/cryptopp_8_2_0/cryptopp/ && gmake

M2P 2014


cd /usr/src/m2_project/2014/srv/libsql/ && gmake
cd /usr/src/m2_project/2014/srv/libpoly/ && gmake
cd /usr/src/m2_project/2014/srv/liblua/ && gmake
cd /usr/src/m2_project/2014/srv/libgame/src/ && gmake
cd /usr/src/m2_project/2014/srv/libthecore/src/ && gmake
cd /usr/src/m2_project/2014/data/cryptopp_8_2_0/cryptopp/ && gmake

You just have to wait, to see the result of the compilation! You can find the compiler files for M2 Project in:

 

M2P


/usr/src/m2_project/X.X/output

M2P 2014


/usr/src/m2_project/2014/output

Well done...

}

1.6.3 Compile (§) (§)

{

Révélation

 

  Don't follow if you import your VirtualBox VM  

 

When the libraries are operational and compiled, we can compile our three main projects: qc, db and the game ... They are located in these directories:

 

  • M2P : /usr/src/m2_project/X.X/srv/
  • M2P 2014 /usr/src/m2_project/2014/srv/

 

M2SH, M2 Project manager allows you to compile without writing the commands below :

 

M2P


cd /usr/src/m2_project/X.X/srv/db/src/ && gmake
cd /usr/src/m2_project/X.X/srv/game/src/ && gmake
cd /usr/src/m2_project/X.X/srv/qc/ && gmake

M2P 2014


cd /usr/src/m2_project/2014/srv/db/src/ && gmake
cd /usr/src/m2_project/2014/srv/game/src/ && gmake
cd /usr/src/m2_project/2014/srv/qc/ && gmake

You just have to wait, to see the result of the compilation! You can find the compiler files for M2 Project in:

 

M2P


/usr/src/m2_project/X.X/output

M2P 2014


/usr/src/m2_project/2014/output

Well done...

}

}

8.2 Windows (§)

{

8.2.1 Install (§)

{

}

8.2.2 Prepare (§)

{

}

8.2.3 Compile (§)

{

}

}

}

Save / Transfer / Migration (§)

{

9.1 Save (§)

{

Révélation

Save? What is it for, my server is secure! No computer data is immune to this risk. To be able to prevent it, you must know the reasons as well as the consequences of the data loss. Hardware or software cause, there are several factors that lead to a probable data loss ...

 

You may also need to back up your server in order to transfer it to another, you are tired of using a VirtualBox VM and you have just received your dedicated server, it will then be useful to extract it in order to keep the progress of your players, your modifications etc ...

 

the lord of the rings ring GIF

9.1.1 SourceFiles (§)

{

Révélation

To save your SourceFiles to keep a copy or to migrate from one server to another, on PuTTY:


cd /usr/src

Then you will do this:


tar czvf m2srcs.tgz m2_project/

Or this :


tar czvf m2srcs.tgz m2_project_2014/

Once the command is executed, you will get an archive which will be called m2srcs.tgz. It's up to you to store this archive in a safe place! Do not forget to clean up the sources to make the archive lighter. M2SH also allows you to save without making these commands!

}

9.1.2 ServerFiles (§)

{

Révélation

 To save your ServerFiles to keep a copy or to migrate from one server to another, on PuTTY:


cd /usr

Then you will do this:


tar czvf m2sf.tgz m2_project/

Once the command is executed, you will get an archive which will be called m2sf.tgz. It's up to you to store this archive in a safe place! Do not forget to clean the histories of your ServerFiles to lighten the archive. M2SH also allows you to save without making these commands!

}

9.1.3 Database (§)

{

Révélation

To back up your databases, nothing could be simpler! Just start using Navicat and connect to your server:

 

  1. Double click on the database account, common, player, hotbackup, log ou metin2...
  2. Right click on the database : account, common, player, hotbackup, log ou metin2...
  3. You should have the following choice : Dump SQL File ou Exporter...
  4. You should have the following choice : Structure and Data ou Structure et Données...
  5. Save the .SQL file in the location of your choice ...
  6. Repeat this action for all databases account, common, player, hotbackup, log ou metin2...

 

spacer.png

 

The .SQL file contains all the information, the tables and the data. Once is not custom, M2SH also allows you to back up your databases!

 

  For install you can follow : 6.1.3 Base de Données  

 

}

}

9.2 Transfer (§)

{

 

Révélation

 

  Requires to have followed beforehand : 9.1.1 SourceFiles  

  Requires to have followed beforehand : 9.1.2 ServerFiles  

 

The main purpose of this topic is to transfer the server to another server. You have different methods for transferring your SQL data, SourceFiles or ServerFiles between your servers. Choose the method you are most comfortable with.

 

9.2.1 Method SCP (§) (§)

{

 

Révélation

 

  Requires to have followed beforehand : 9.1.1 SourceFiles  

  Requires to have followed beforehand : 9.1.2 ServerFiles  

 

SCP? Secure copy means a secure file transfer between two computers or servers using the SSH communication protocol. The term SCP refers to both the SCP program and the SCP protocol. We will learn how to transfer a file, an archive from a FreeBSD server to another FreeBSD server. This saves you from downloading the archive to your computer to upload again to the target server ...

 

The SCP command works in both directions, that is to say from the source server to the target server and vice versa, among the two methods, choose one, the result is strictly identical.

 

9.2.1.1 From your source server (§) (§)

{

Révélation

 

  Requires to have followed beforehand : 9.1.1 SourceFiles  

  Requires to have followed beforehand : 9.1.2 ServerFiles  

 

Execute this command on PuTTY from the source server, you must change the IP address to that of the target server:

 

For ServerFiles :


scp -r -p /usr/m2sf.tgz root@0.0.0.0:/usr/

For SourceFiles :


scp -r -p /usr/src/m2srcs.tgz root@0.0.0.0:/usr/src/

If you see :


Are you sure you want to continue connecting ( yes / no ) ?

You write :


yes

If you see :


Password for root @ :

Tu dois écrire le mot de passe du serveur cible puis tu trouveras les archives dans les répertoires suivants :

 

  • /usr/
  • /usr/src/

 

  For install you can follow : 6.1.1 ServerFiles  

  For install you can follow : 6.1.2 SourceFiles  

 

}

9.2.1.2 From the target server (§) (§)

{

Révélation

 

  Requires to have followed : 9.1.1 SourceFiles  

  Requires to have followed : 9.1.2 ServerFiles  

 

Execute this command on PuTTY from the target server, you must change the IP address to that of the source server:

 

For ServerFiles :


scp -r -p root@0.0.0.0:/usr/m2sf.tgz /usr/

For SourceFiles :


scp -r -p root@0.0.0.0:/usr/src/m2srcs.tgz /usr/src/

If you see :


Are you sure you want to continue connecting ( yes / no ) ?

You write :


yes

If you see :


Password for root @ :

You have to write the password of the source server then you will find the archives in the following directories:

 

  • /usr/
  • /usr/src/

 

 

  For install you can follow : 6.1.1 ServerFiles  

  For install you can follow  : 6.1.2 SourceFiles  

 

}

}

9.2.2 Method TAR (§) (§)

{

Révélation

 

  Requires to have followed beforehand : 9.1.1 SourceFiles  

  Requires to have followed beforehand : 9.1.2 ServerFiles  

 

You just need to download the archives you created on your computer to upload them to the target server with WinSCP ...

 

  • /usr/
  • /usr/src/

 

  For install you can follow : 6.1.1 ServerFiles  

  For install you can follow : 6.1.2 SourceFiles  

 

}

9.2.3 Method SQL (§) (§)

{

Révélation

 

  Requires to have followed beforehand : 4 Install / Configure / Management @ MySQL  

 

It is a method similar to the SCP command, SQL version. Indeed, it is possible to copy MySQL tables from Navicat from a MySQL server to another MySQL server. For that, you must have already carried out the installation, the configuration of MySQL, its databases, its users and finally permissions to access the databases. Make sure you can connect to both MySQL servers from Navicat.

 

spacer.png

 

spacer.png

 

spacer.png

 

spacer.png

 

Done, you must execute this action as many times as necessary according to your databases!

}

}

9.3 Migration (§)

{

Révélation

Not satisfied with your ServerFiles / SourceFiles? Unfortunately, here we do not do the: Satisfied or Refunded! You wasted your time, it's a shame! A migration from ServerFiles / SourceFiles is a relatively simple part since you have an entire database ready to use.

 

The only difficulties that you are likely to meet is at the level of SourceFiles, it is programming and it takes a minimum of knowledge to be autonomous in the event of failure of compilation but also at the level of libraries, it is possible that your ServerFiles ask for them when starting ...

 

  1. Delete ServerFiles from the directory /usr/...
  2. Delete SourceFiles from the directory : /usr/src/...
  3. Delete SQL tables from databases : account, common, player, hotbackup, log ou metin2...

 

At this stage, everything is uninstalled you can resume the installation of your Server Files / Source Files with those of your choice ... And above, never come back to me again!

 

  RIP M2 Project  

 

}

}

}

🔗

En cours de rédaction...

Kijaru ❤️ 

 

#include < footer.>

{

 

Thanks to metin2dev, the members who constitute this forum, the shares and the tutorials which feed it, you are now able to design your Metin2 Server. Do not hesitate to share your findings and your ideas allowing to evolve the emulation of this game. Have you opened your Metin2 Server? Present it to us in the section  Your Server  ! Show us what you can do! Good luck to you ! If you need help, we will be there to help you in Questions and Answers .

 

 

}

#include < src.>

{

 

clang: error: no such file or directory: src.h

clang: error: no input files

segmentation fault ( core dumped )

 

}

abort();

Link to post
Share on other sites
Guest
This topic is now closed to further replies.