Vagrant has been widely used for running the Linux distribution environments on top of Windows platform for the sake of consistency on development setup among developers since they can share the exact Linux distro setting within their team. Vagrant helps the developer to automate the process of setup the particular environment such as LAMP and it can be deployed into production server later which reduce the time of manually setup instead of focusing on developing the system. Vagrant also helps reduces "meddling" the host system files since vagrant contained the intended setup inside guest system. So every time the developer format his/her computer or buying new PC/Workstation/Laptop, he/she can quickly restore his/her development environment inside the new computer.
Some of you might want to use gcc/g++ compiler instead of Microsoft Visual Studio or Cygwin or you might want to practice setting up the server locally before deploying it into VPS/Dedicated server etc. So this guide suits your needs. In this guide, I will show you how to use Laravel Homestead box for compiling rAthena.
**NOTES** You can use any vagrant boxes as well although in this case, I am using Homestead because it came together with LAMP preconfigured and I am still developing custom vagrantfile and in the future, I might release rAthena boxes for speeding up the process. For the time being just bear with this one.
Installing Virtual Box, Vagrant, MySQL Workbench and those editor should be self-explanatory. Just keep clicking "Yes" and "Finish". However, for cmder, you can extract it into any place you want as shown below:
C:\cmder
Create the shortcut of Cmder.exe from inside cmder folder and paste it into your desktop for the sake of easy access.
Configure Vagrant
1. Run your Cmder.exe shortcut and install Vagrant plugins for VirtualBox Guest Additions using below command.
vagrant plugin install vagrant-vbguest
2. Generate ssh key using below command.
ssh-keygen -t rsa
3. It will show these lines, just press enter to accept the path to store your ssh key.
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/YOUR_USERNAME/.ssh/id_rsa):
4. Enter your any passphrase key and insert the same key for the second one.
Created directory '/c/Users/YOUR_USERNAME/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Configure Laravel Homestead
1. Download the Laravel Homestead box using below command and choose virtualbox as provider. Wait until it finish downloading. Its gonna take a while depending on your internet connection speed.
vagrant box add laravel/homestead
2. It is preferably to change into another disk for your homestead folder. Example as show below.
C:\Users\Zarey
λ cd ..
C:\Users
λ cd ..
C:\
λ D:
D:\
λ mkdir homesteads
D:\
λ cd homesteads
3. Clone the homestead repository into your preferable folder like shown previously.
4. Enter rAthenaHomesteads folder and run following command.
D:\homesteads
λ cd rAthenaHomesteads
D:\homesteads\rAthenaHomesteads (master)
λ bash init.sh
5. Open the generated Homestead.yaml inside rAthenaHomesteads folder using your favorite editor. Use below setting as your guidance. As you can see, I create SourceCodes folder inside my drive E which is the place I keep rAthena server. Customize it according to your needs. Don't forget to save your changes. You can also refer this official documentations for Laravel Homestead.
6. It is time to run your homestead box. Inside your rAthenaHomestead folder, run the below command to start the homestead box. Its gonna take a while and you can ignore the warning about insecure key.
vagrant up
7. Now you can enter the homestead box via ssh using below command.
vagrant ssh
Compile rAthena server
1. At this point, you can refer rAthena wiki for the compiling process. However, I am gonna show the step that I used for this guide. Since you already inside the homestead box for the first time, it is recommended to update and upgrade your homestead box. Choose the option "keep the installed ..." every time it popup when upgrading the homestead box. So that the preconfigured settings inside homestead box are keep intact unless you know what you are doing. Use below commands to update and upgrade your homestead box.
sudo apt update
sudo apt upgrade
2. Exit from your homestead and restart your homestead box before you enter again using below commands. Its gonna take a while.
exit
vagrant halt
vagrant up
vagrant ssh
3. Install the following packages using below command. Although some packages might already installed, it is no harm to use below command just to avoid the missing packages.
sudo apt install git make gcc g++ libmysqlclient-dev zlib1g-dev libpcre3-dev
4. Go to Codes folder and clone the rAthena repository. **NOTES** You might wondering why I didn't clone the repo first before enter the homestead box? It is because I want to avoid using dos2unix whenever some bad interpreter occurred.
vagrant@homestead:~$ cd Codes
vagrant@homestead:~/Codes$ git clone https://github.com/rathena/rathena.git
5. Go to rathena folder and compile it accordingly.
vagrant@homestead:~/Codes$ cd rathena
vagrant@homestead:~/Codes/rathena$ ./configure && make clean && make server
Setup rAthena configuration
1. Configure the rAthena networking & anything you need inside conf folder. Please note the IP address for your rAthena is based on what you set inside Homestead.yaml, in this case it would be 196.168.10.10. Below are my examples.
*** NOTES *** It is not recommended to use root account to access the database, please create the specific account for your server if possible. Above is just for the example.
Setup rAthena database via MySQL Workbench
Although you may use the command line method provided by rAthena wiki, if you like to use GUI method via MySQL Workbench, here are the steps you may follow.
*** NOTES *** Below examples are using root account for database. Please create new account accordingly. You can find the option to create new account on Server > Users and Privileges menu which you can only access via root account.
1. Open the MySQL Workbench from Start > All Programs > MySQL > MySQL Workbench 6.3 CE
2. Click the "+" sign on the right of "MySQL Connections" and fill the form as shown below.
3. Click "Test Connection" button, and enter the "secret" for password. If there is "Can't connect error appear" try click "Ok" and the popup asking password should be appeared.
4. Click the "Vagrant" to access the database connection
5. Right click and select "Create Schema
6. Type "rathena" for the name or any name for your database and click "Apply"
7. Click "Apply" and "Finish" after that.
8. Double click the rathena on schemas to select it.
9. Use "Ctrl+Shift+O" to select the sql files from your rAthena server folder.
10. Use "Ctrl+Shift+Enter" to execute the sql files that you just opened. Repeat all 9-10 steps for all sql files.
11. Right click on schemas and select "Refresh All" to see all loaded tables inside your database.
12. Right click on login table to edit the appropriate details. Based on previous steps, I change the s1 & p1 into serv1 & perv1. You can insert new row for your new account as well. Don't forget to click "Apply" button to save the changes you just made inside the table. Then click "Apply" & "Finish" whenever the pop windows appeared.
At this point, you may follow other people guides for setting up the client side. Use below command to run the rAthena server.
./athena-start start
Good luck!
*** NOTES ***
Homestead SSH access username is "vagrant@IP_Address" (my example would be "[email protected]" and password is "vagrant"
Homestead database username is "vagrant" and password is "secret"
Question
aszrool
Introduction
Vagrant has been widely used for running the Linux distribution environments on top of Windows platform for the sake of consistency on development setup among developers since they can share the exact Linux distro setting within their team. Vagrant helps the developer to automate the process of setup the particular environment such as LAMP and it can be deployed into production server later which reduce the time of manually setup instead of focusing on developing the system. Vagrant also helps reduces "meddling" the host system files since vagrant contained the intended setup inside guest system. So every time the developer format his/her computer or buying new PC/Workstation/Laptop, he/she can quickly restore his/her development environment inside the new computer.

Some of you might want to use gcc/g++ compiler instead of Microsoft Visual Studio or Cygwin or you might want to practice setting up the server locally before deploying it into VPS/Dedicated server etc. So this guide suits your needs. In this guide, I will show you how to use Laravel Homestead box for compiling rAthena.
**NOTES** You can use any vagrant boxes as well although in this case, I am using Homestead because it came together with LAMP preconfigured and I am still developing custom vagrantfile and in the future, I might release rAthena boxes for speeding up the process. For the time being just bear with this one.
Preliminary
Download these files first
Installing Virtual Box, Vagrant, MySQL Workbench and those editor should be self-explanatory. Just keep clicking "Yes" and "Finish". However, for cmder, you can extract it into any place you want as shown below:
Create the shortcut of Cmder.exe from inside cmder folder and paste it into your desktop for the sake of easy access.
Configure Vagrant
1. Run your Cmder.exe shortcut and install Vagrant plugins for VirtualBox Guest Additions using below command.
2. Generate ssh key using below command.
3. It will show these lines, just press enter to accept the path to store your ssh key.
4. Enter your any passphrase key and insert the same key for the second one.
Configure Laravel Homestead
1. Download the Laravel Homestead box using below command and choose virtualbox as provider. Wait until it finish downloading. Its gonna take a while depending on your internet connection speed.
2. It is preferably to change into another disk for your homestead folder. Example as show below.
3. Clone the homestead repository into your preferable folder like shown previously.
4. Enter rAthenaHomesteads folder and run following command.
5. Open the generated Homestead.yaml inside rAthenaHomesteads folder using your favorite editor. Use below setting as your guidance. As you can see, I create SourceCodes folder inside my drive E which is the place I keep rAthena server. Customize it according to your needs. Don't forget to save your changes. You can also refer this official documentations for Laravel Homestead.
6. It is time to run your homestead box. Inside your rAthenaHomestead folder, run the below command to start the homestead box. Its gonna take a while and you can ignore the warning about insecure key.
7. Now you can enter the homestead box via ssh using below command.
Compile rAthena server
1. At this point, you can refer rAthena wiki for the compiling process. However, I am gonna show the step that I used for this guide. Since you already inside the homestead box for the first time, it is recommended to update and upgrade your homestead box. Choose the option "keep the installed ..." every time it popup when upgrading the homestead box. So that the preconfigured settings inside homestead box are keep intact unless you know what you are doing. Use below commands to update and upgrade your homestead box.
2. Exit from your homestead and restart your homestead box before you enter again using below commands. Its gonna take a while.
3. Install the following packages using below command. Although some packages might already installed, it is no harm to use below command just to avoid the missing packages.
4. Go to Codes folder and clone the rAthena repository. **NOTES** You might wondering why I didn't clone the repo first before enter the homestead box? It is because I want to avoid using dos2unix whenever some bad interpreter occurred.
5. Go to rathena folder and compile it accordingly.
Setup rAthena configuration
1. Configure the rAthena networking & anything you need inside conf folder. Please note the IP address for your rAthena is based on what you set inside Homestead.yaml, in this case it would be 196.168.10.10. Below are my examples.
- conf/import/char_conf.txt
- conf/import/inter_conf.txt
- conf/import/map_conf.txt
*** NOTES *** It is not recommended to use root account to access the database, please create the specific account for your server if possible. Above is just for the example.
Setup rAthena database via MySQL Workbench
Although you may use the command line method provided by rAthena wiki, if you like to use GUI method via MySQL Workbench, here are the steps you may follow.
*** NOTES *** Below examples are using root account for database. Please create new account accordingly. You can find the option to create new account on Server > Users and Privileges menu which you can only access via root account.
1. Open the MySQL Workbench from Start > All Programs > MySQL > MySQL Workbench 6.3 CE
2. Click the "+" sign on the right of "MySQL Connections" and fill the form as shown below.
3. Click "Test Connection" button, and enter the "secret" for password. If there is "Can't connect error appear" try click "Ok" and the popup asking password should be appeared.
4. Click the "Vagrant" to access the database connection
5. Right click and select "Create Schema
6. Type "rathena" for the name or any name for your database and click "Apply"
7. Click "Apply" and "Finish" after that.
8. Double click the rathena on schemas to select it.
9. Use "Ctrl+Shift+O" to select the sql files from your rAthena server folder.
10. Use "Ctrl+Shift+Enter" to execute the sql files that you just opened. Repeat all 9-10 steps for all sql files.
11. Right click on schemas and select "Refresh All" to see all loaded tables inside your database.
12. Right click on login table to edit the appropriate details. Based on previous steps, I change the s1 & p1 into serv1 & perv1. You can insert new row for your new account as well. Don't forget to click "Apply" button to save the changes you just made inside the table. Then click "Apply" & "Finish" whenever the pop windows appeared.
At this point, you may follow other people guides for setting up the client side. Use below command to run the rAthena server.
Good luck!
*** NOTES ***
Homestead SSH access username is "vagrant@IP_Address" (my example would be "[email protected]" and password is "vagrant"
Homestead database username is "vagrant" and password is "secret"
Credits, Resources & References
rAthena Github & Wikis: https://github.com/rathena/rathena & https://github.com/rathena/rathena/wiki
Laravel Homestead Official Docs: https://laravel.com/docs/5.4/homestead
Tutorial to connect vagrant database with MySQL Workbench via ssh: https://ttmm.io/tech/vagrant-windows/
Another Laravel Homestead on Windows 10 tutorial: https://medium.com/@eaimanshoshi/i-am-going-to-write-down-step-by-step-procedure-to-setup-homestead-for-laravel-5-2-17491a423aa
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.