Ansible is an open-source configuration management and software provisioning tool that can be used for controlling multiple remote hosts from the central location and this article will show you how to install Ansible on a Ubuntu 18.04 server.

Ansible can support on all major operating systems like, Linux, Unix, macOS, BSD and Windows. It is very similar to other configuration management systems like, Chef and Puppet. Ansible uses SSH to retrieve information from the remote machines and does not need any client agent on remote servers. You can also create automated tasks using Ansible playbooks to run on your servers.


Prerequisites


Setup SSH Key-based Authentication

Before starting, you will need to configure SSH key-based authentication for Ansible hosts on Ansible server. So you will not require a password to manage Ansible hosts.

To do so, log in to Ansible server and generate an ssh key pair with the following command:

ssh-keygen -t rsa


You should see an output looking like this:

 Generating public/private rsa key pair.
 Enter file in which to save the key (/root/.ssh/id_rsa):
 Enter passphrase (empty for no passphrase):
 Enter same passphrase again:
 Your identification has been saved in /root/.ssh/id_rsa.
 Your public key has been saved in /root/.ssh/id_rsa.pub.
 The key fingerprint is:
 SHA256:5JfGu2stiaee+oOud8NDAQVY0YJQ87iwKGud42rl6Oo root@ubuntu1804
 The key's randomart image is:
 +---[RSA 2048]----+
 |  .oo++=.        |
 |    o+o .        |
 |  . . .o.        |
 | . o . o.. .     |
 |o . .   S.=      |
 |.....   .o .     |
 |..++   + ..o     |
 |.o... o B.=..    |
 |*E...+o==Boo     |
 +----[SHA256]-----+


Next, copy the generated public key to your Ansible hosts with the following command:

ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.3


Once the SSH key is added to the Ansible hosts, you should see the following output:

 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
 /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
 /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
 root@192.168.0.3's password:

 Number of key(s) added: 1


Now try logging into the machine, with:

ssh root@192.168.0.3

If it worked correctly, you can now access Ansible hosts from Ansible server using SSH without a password.


Install Ansible on Ubuntu 18.04

Next, you will need to install Ansible package on the Ubuntu Ansible server. By default, the latest version of Ansible is not available in the Ubuntu 18.04 repository.

First, add the Ansible repository with the following command:

apt-add-repository ppa:ansible/ansible


Then, install Ansible by just running the following command:

apt-get install ansible -y


After installing Ansible, you can check the version of Ansible with the following command:

ansible --version


You should see the following output:

 ansible 2.8.2
 config file = /etc/ansible/ansible.cfg
 configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
 ansible python module location = /usr/lib/python2.7/dist-packages/ansible
 executable location = /usr/bin/ansible
 python version = 2.7.15+ (default, Nov 27 2018, 23:36:35) [GCC 7.3.0] 


Configure Ansible Hosts

First, you will need to define Ansible hosts in /etc/ansible/hosts to monitor all the hosts.

nano /etc/ansible/hosts


Add the following lines:

 [hosts]
 host1 ansible_host=192.168.0.3

Note: You can add the multiple hosts in the above file to monitor multiple hosts at a time.

Save and close the file.


Next, create a group named group_vars in /etc/ansible directory and create a files for each group you want to configure:

mkdir /etc/ansible/group_vars nano /etc/ansible/group_vars/hosts


Add the port and user for remote hosts:

 ansible_port: 22
 ansible_user: root

Then, save and close the file, when you are finished.


Next, check all the host’s connectivity with the following command:

ansible -m ping hosts


If everything is fine, you should see the following output:

 host1 | SUCCESS => {
     "ansible_facts": {
         "discovered_interpreter_python": "/usr/bin/python"
     },
     "changed": false,
     "ping": "pong"
 }


Working with Ansible

Now, you can easily monitor all the hosts defined in the hosts group easily.

To check the disk size of Ansible hosts, run the following command:

ansible -m shell -a 'df -h' hosts


You should see the following output:

 host1 | CHANGED | rc=0 >>
 Filesystem      Size  Used Avail Use% Mounted on
 udev            1.9G  4.0K  1.9G   1% /dev
 tmpfs           384M  1.3M  383M   1% /run
 /dev/sda1        92G  6.1G   81G   7% /
 none            4.0K     0  4.0K   0% /sys/fs/cgroup
 none            5.0M     0  5.0M   0% /run/lock
 none            1.9G   70M  1.9G   4% /run/shm
 none            100M   48K  100M   1% /run/user
 /dev/sda5       184G   67G  108G  39% /home
 /dev/sda6       179G   12G  159G   7% /Data


To check the uptime of Ansible hosts with the following command:

ansible -m shell -a 'uptime' hosts


You should see the following output:

 host1 | CHANGED | rc=0 >>
 11:14:45 up  1:18,  5 users,  load average: 0.89, 1.11, 1.45


Conclusion

Congratulations! you have successfully installed and configured Ansible server and ansible hosts on Ubuntu 18.04 server. You can also configure Ansible to manage and monitor multiple hosts easily.

For more information, refer the Ansible official doc at https://docs.ansible.com/ansible/latest/index.html

Here is how to install LiteSpeed on CentOS 7 with cPanel. LiteSpeed is a proprietary web server software developed by LiteSpeed Technologies. It is a high-performance web server very similar to Apache and fully compatible with existing Apache configuration files. LiteSpeed is compatible with mod_rewrite, .htaccess, mod_security and most used control panel like cPanel, DirectAdmin, etc. It is specially designed high traffic websites.


Features


In this tutorial, we will explain how to install LiteSpeed web server on a cPanel server.


Requirements


Install LiteSpeed Plug-in for cPanel

To install LiteSpeed on CentOS 7 with cPanel, first log in to your server via SSH with root privileges and download the LiteSpeed plug-in installation script for cPanel with the following command:

cd /usr/src wget http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh


Next, run the script with the following command:

sh lsws_whm_plugin_install.sh


Once the installation has been completed, you should see the following output:

Install LiteSpeed Web Server Plugin for WHM
==============================================


mkdir: created directory ‘/usr/local/cpanel/whostmgr/docroot/cgi/lsws’
mkdir: created directory ‘/usr/local/cpanel/whostmgr/docroot/templates/lsws’


... creating directories ...
mkdir: created directory ‘/usr/src/lsws_whm’
  Temp directory created
... downloading latest version of the plugin ...
--2019-07-13 03:52:29--  http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin.tar.gz
Resolving www.litespeedtech.com (www.litespeedtech.com)... 52.55.120.73
Connecting to www.litespeedtech.com (www.litespeedtech.com)|52.55.120.73|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 665512 (650K) [application/gzip]
Saving to: ‘/usr/src/lsws_whm/lsws_whm_plugin.tar.gz’


100%[=====================================================================================================>] 6,65,512     460KB/s   in 1.4s  


2019-07-13 03:52:31 (460 KB/s) - ‘/usr/src/lsws_whm/lsws_whm_plugin.tar.gz’ saved [665512/665512]

Done downloading.

... extracting ...

... moving files ...
... setting permission to files ...
   LiteSpeed is not installed, skip hook operation
Register LSWS Plugin ...
mkdir: created directory ‘/var/cpanel/apps’
  apps registration directory created
lsws registered
updated EA3 to EA4 migration scripts under /var/cpanel/ea4_migration_hooks

LiteSpeed WHM Plugin Installed Successfully.
==============================================


Next, remove the installation script with the following command:

rm -f lsws_whm_plugin_install.sh


Install LiteSpeed Web Server from WHM/cPanel

LiteSpeed plug-in for cPanel is now installed. Next, Log in to WHM Control Panel and navigate to Plugins. You should see the following page:


Next, click on the LiteSpeedWebServer, you should see the following page:


Next, click on “Install LiteSpeed Web Server“. You should see the following page:


Next, accept the Licence Agreement, Select “Request a trial license”, Provide port offset (Set 0 to replace Apache, set 2000 to set LiteSpeed on port 2080), Provide user name and password for WebAdmin console. Then, click on the Install button. Once the installation has been completed, you should see the following page:


Next, click on the OK button. You should see the following page:


In the above page, you should see some warning. To remove them, first uninstall ruid2 module with the following command on your terminal:

yum remove ea-apache24-mod_ruid2


Next, from the WHM / cPanel dashboard, click on the “Manage Cache Installations” to generate cache management data. You should see the following page:


Next, click on the “Switch to LiteSpeed” button to replace Apache with LiteSpeed Web Server. You should see the following page:


Now, click on the “Switch to LiteSpeed” to restart LiteSpeed as a main web server. You should see the following page:


Now, click on the OK button to finish the installation.

Open your terminal and check the status of LiteSpeed service with the following command:

systemctl status lshttpd


If everything is fine, you should see the following output:

 lshttpd.service - LiteSpeed HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/lshttpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-07-13 03:10:00 EDT; 52min ago
 Main PID: 5293 (httpd)
   CGroup: /system.slice/httpd.service
           ├─5293 /usr/sbin/httpd -k start
           ├─5295 /usr/local/cpanel/bin/splitlogs --dir=/etc/apache2/logs/domlogs --main=cpanel.example.com --suffix=-bytes_log
           ├─5296 /usr/local/cpanel/bin/splitlogs --dir=/etc/apache2/logs/domlogs --main=cpanel.example.com --mainout=/etc/apache2/logs/acce...
           ├─5298 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/bin/leechprotect
           ├─5300 /usr/sbin/httpd -k start
           ├─5301 /usr/sbin/httpd -k start
           ├─5302 /usr/sbin/httpd -k start
           ├─5303 /usr/sbin/httpd -k start
           ├─5304 /usr/sbin/httpd -k start
           └─5449 /usr/sbin/httpd -k start


Jul 13 04:01:07 cpanel.example.com systemd[1]: Starting LiteSpeed HTTP Server...
Jul 13 04:01:08 cpanel.example.com lswsctrl[27749]: 2019-07-13 04:01:08.410168 [NOTICE] Memory size is: 1014968KB.
Jul 13 04:01:09 cpanel.example.com lswsctrl[27749]: 2019-07-13 04:01:09.460561 [NOTICE] [OK] Updated license key has been created at ...al.key.
Jul 13 04:01:09 cpanel.example.com lswsctrl[27749]: [OK] litespeed: pid=27765.
Jul 13 04:01:11 cpanel.example.com systemd[1]: Started LiteSpeed HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.


Access LiteSpeed WebAdmin Console

Now, open your web browser and type the URL https://your-server-ip:7080. You will be redirected to the LiteSpeed WebAdmin log in page:


Provide your WebAdmin username and password, then click on the Login button. You should see the following page:


Conclusion

Congratulations! you have successfully installed and configured LiteSpeed on cPanel server. You can now easily create and manage websites from WebAdmin web interface. For more information, you can visit the LiteSpeed official doc at https://www.litespeedtech.com/docs.

How to Upgrade Jessie to Stretch

Debian is an operating system similar to Unix-based systems, which is open source and maintained by multiple active users. However, when major changes are made to the source code and a new, stable release comes out, it’s provided a codename. The previous stable release, Debian 8, was named Jessie, while the newest stable release of Debian 9 is named Stretch. Each major update typically provides new package availability, changes to software, and other necessary updates. Additionally, Debian receives stable updates every two years, and each stable release typically receives support for three years.

Debian 9 Stretch

Getting Started

Before we can proceed with upgrading to Debian 9, Stretch, the current stable release, you will need a node hosting a Linux Debian 8, Jessie, instance. The node you choose should be hosted on a cloud server or dedicated server, whichever you prefer.

Before proceeding with the installation, there’s one major change from Debian 8 to Debian 9. In Debian 9, MariaDB is replacing MySQL, which was the default. With this new release, MariaDB is now the default SQL-based system, and previously existing instances of MySQL will be replaced by the equivalent MariaDB instance.

Additionally, when the upgrade is complete, you will need to confirm the functionality of any third party applications. Changes to a release can render some services non-functional due to compatibility issues.

Upgrade Jessie to Stretch

The first step in this update is to make sure your system is making sure your current node is completely upgraded, any relevant and necessary updates installed, and then freshly rebooted:
apt-get update
apt-get upgrade
apt-get dist-upgrade

Before continuing, it’s vital that an update of your Debian 8 machine or virtual machine is created. Once the upgrade has completed, it will not be possible to revert from Debian 9 to Debian 8.

After creating your backup, check the database for consistency, making sure there is no hold on the system package. A packaged hold cannot be upgraded, which will lead to system instability or a failure to boot:
dpkg -C
apt-mark showhold

Once confirming the system package is available, the package repository should be backed up and then updated:
cp /etc/apt/sources.list /etc/apt/sources.list_backup

Now let’s update your package repository from the previous stable release to the newest stable release:
sed -i 's/jessie/stretch/g' /etc/apt/sources.list

After pulling the newest stable release repository, it’s time to update your existing package with the new release repository:
apt-get update

It’s time to run your upgrade. When you run this upgrade, the system will prompt you, asking if you would like to restart the service automatically:
apt-get upgrade
apt-get dist-upgrade

Once complete, it’s time to reboot your system:
reboot

Onto your last step! Access your system information and confirm that the most recent, stable release is installed:
cat /etc/*release

Conclusion

Congratulations! You’ve successfully updated your cloud server or dedicated server node to the recent, stable Debian release, Debian 9. During this process, you’ve updated packages, made a backup just in case, and replaced your previous stable release, Jessie, with Stretch. If you found this guide helpful, please share it with other users working through the same process.

How to Install Exim Mail Server on Ubuntu 17.04

Exim Mail ServerExim is a popular mail transfer agent (MTA) originally designed for use at the University of Cambridge to replace the existing mail systems in place. Although based on an older MTA design, Exim has since grown and splintered off into a unique concept; Exim aims at being flexible and working with a variety of Unix-like systems.

Exim has become exceptionally popular due to the straightforward setup configuration as well as its’ ability to manage multiple tasks simultaneously. Exim releases occur frequently and are listed on the Exim homepage, which encourages users to update to the newest version when possible.

Getting Started

Before you can get started installing your new Exim mail server on Ubuntu 17.04, you will need to confirm you have one node available, a Cloud Server or Dedicated Server; this server should have Ubuntu 17.04 installed.

You will also need to have Secure Shell (SSH) root access for your server after it’s running Ubuntu 17.04. If you are not familiar, SSH is a type of network protocol used when services are performed over an unsecured network. Using SSH, you can engage in these activities knowing they are being performed securely even over an unsecured connection.

Tutorial

Installing the Mail Server

Now that you’ve acquired your cloud server or dedicated server node, installed Ubuntu 17.04, and confirmed SSH root access to your node, we can begin setting up your Exim mail server.

Our first step is to confirm that your server is running the most recent software version and any repositories are up to date:
apt-get update && apt-get upgrade -y

After confirming your server is running current software, we can proceed with installing the mail server from Exim:

apt-get install exim4 -y

Once the installation has completed, it’s time to start configuring the Exim server using the following commands:
dpkg-reconfigure exim4-config

During the configuration process, the following answers should be used when you are prompted:
1- General type of mail configuration: Internet site; mail is sent and received directly using SMTP
2- System mail name: (please enter your server DNS hostname name)
3- IP-addresses to lsiten on for incoming SMTP connections: 127.0.0.1 ; ::1 (validate with ENTER)
4- Other destinations for which mail is accepted: [EMPTY]
5- Domains to relay mail for: [EMPTY]
6- Machines to relay mail for: [EMPTY]
7- Keep number of DNS-queries minimal (Dial-on-Demand)?:
8- Delivery method for local mail: mbox format in /var/mail/
9- Split configuration into small files?:

When the configuration process completes, it’s time to check that Exim is running correctly and the installation was successful:
systemctl status exim4

After confirming that Exim was installed successfully, make sure to force the startup of the Exim service whenever your system boots:
systemctl enable exim4

Congratulations! You’ve installed your Exim mail server on Ubuntu 17.04, enjoy!

Conclusion

You’ve successfully gone through the process of installing your own Exim server on a dedicated node running Ubuntu 17.04. You can now move your Exim server into production and begin using your new mail server. If you were able to follow this guide and found it useful, please share it with other users that may be searching for a simple guide on setting up an Exim server.

How to Install Exim Mail Server on Ubuntu 14

Exim Mail ServerExim was designed as a mail transfer agent (MTA) that was going to replace the preexisting system from the University of Cambridge. While Exim was based on the older MTA system, it has since grown into a unique, functional system; Exim has become popular due to the flexibility and compatibility with Unix-like operating systems.

The straightforward setup that comes with Exim allows users to complete setup easily, even without an in-depth knowledge of MTA systems. Additionally, Exim can handle a lot of tasks concurrently, and it is frequently updated with bug fixes and system updates.

Getting Started

Before we start installing your Exim mail server, we need to confirm you have a node available. This node can be on Cloud Server or a Dedicated Server, and it needs to have Ubuntu 14.04 LTS installed.

You also need to confirm you’ve set up Secure Shell (SSH) root access for your server, which you’ll complete after setting it up to run Ubuntu 14.04 LTS. If you’re not familiar, SSH is a network protocol that’s used when you need to execute secure services over an unsecured connection. By using SSH root access, you can engage in activities even if your connection is not secure.

Tutorial

Installing the Mail Server

Now that you have confirmed your node is available, Ubuntu 14.04 LTS is installed, and you have SSH root access on your node, it’s time to install Exim.

The first thing to do during this installation is to confirm your server is running the most recent, updated software version and that any repositories that need to be brought up to date are updated:
apt-get update && apt-get upgrade -y

After you’ve verified that your server is up to date, you can proceed with the installation of the Exim mail server :

apt-get install exim4 -y

The server will reach a point where it prompts you that the installation is complete, which means you can begin configuring your new Exim mail server. Follow the command below to start configuration:
dpkg-reconfigure exim4-config

During the configuration process, you will be asked a series of questions to guide you through the process. The answers listed below should be used to complete your configuration:
1- General type of mail configuration: Internet site; mail is sent and received directly using SMTP
2- System mail name: (please enter your server DNS hostname name)
3- IP-addresses to lsiten on for incoming SMTP connections: 127.0.0.1 ; ::1 (validate with ENTER)
4- Other destinations for which mail is accepted: [EMPTY]
5- Domains to relay mail for: [EMPTY]
6- Machines to relay mail for: [EMPTY]
7- Keep number of DNS-queries minimal (Dial-on-Demand)?:
8- Delivery method for local mail: mbox format in /var/mail/
9- Split configuration into small files?:
10- Root and postmaster mail recipient: [EMPTY]

Now that you’ve completed the configuration of your server, we can check that your new Exim mail server is running correctly:
systemctl exim4 status

Congratulations! You’ve completed all the steps necessary to install an Exim mail server on your dedicated node running Ubuntu 14.04 LTS!

Conclusion

You’ve completed the steps necessary to install Exim on your server running Ubuntu 14.04 LTS. Now that you’re completed the process, your Exim mail server is ready to move into production. If you found this guide useful and it helped you complete the setup of your new mail server, please share it with others that are searching for guidance on setting up an Exim server.

How to Install MySQL on Ubuntu 17

MySQL is a database management system that runs on multiple platforms, including Windows, Unix-based, and Linux platforms. MySQL is often used for web-based applications, online publishing, and some web development platforms.

Ubuntu is an open source operating system based on Linux and is a popular operating system choice for personal computers and mobile devices. Ubuntu is also a popular choice for running physical or virtual servers and is currently one of the most popular choices for running cloud hosting environments.

MySQL Logo

Getting Started

In order to follow this guide you will need to have the following in place:
• One node (Cloud Server or Dedicated Server) that has Ubuntu 14.04 LTS installed.
• SSH Root Access to your server
Before you can begin installing MySQL on Ubuntu 17.04, you need to have one node, a cloud server or a dedicated server, with Ubuntu 17.04 currently installed.

Additionally, Secure Shell (SSH) root access to your server running Ubuntu 17.04 is recommended. SSH, if you’re unaware, is a network protocol used when network services are being executed over an unsecured network; SSH allows for secure execution.

Tutorial

Installing MySQL

Now that your node is established, Ubuntu is installed, and you have SSH root access to your server, you want to verify that your server is up to date and current repositories are installed:
apt-get update && apt-get upgrade -y

Once you have confirmed the server is currently running the most recent version, you can begin the process to install MySQL. While the primary installation package is necessary, other packages may be optional and should be installed if necessary:

apt-get install mysql-server mysql-client -y

While you are installing MySQL packages, you will be prompted to select a new root password. That password will then be used to sign in to your MySQL as a super user. It’s recommended that you select a strong password, write it down if necessary, and keep it secured.

After the installation of MySQL is complete, you may need to secure your new MySQL. There is a script you may utilize from your command line to secure MySQL:
mysql_secure_installation

During this process, the script will prompt you for answers to several questions. You will not need to change your root password, but you may want to remove anonymous users and disable remote login, depending on your needs. You may follow the answers indicated below for an easy setup:
Enter password for user root: ENTER ROOT PASSWORD
Press y|Y for Yes, any other key for No: n
Change the password for root ? n
Remove anonymous users? y
Disallow root login remotely? y
Remove test database and access to it? y
Reload privilege tables now? y

Finally, you’ve completed the setup of your MySQL on Ubuntu 17.04. You are now able to log in using the root account and the password you setup earlier, entering them into the command line. Use the following command to log in:
mysql -u root -p

After entering the root username and password you created, you will be signed into the MySQL command line client.

Congratulations! Enjoy your new MySQL setup on your server running Ubuntu 17.04.

Conclusion

You’ve successfully completed the steps necessary to install MySQL on either a cloud or dedicated server that’s running Ubuntu 17.04. Your MySQL is ready to be placed into production. If you found this setup guide helpful, please share it with others that are looking to setup their own MySQL.

Minecraft

How to Setup a Minecraft Server on Ubuntu 14

Minecraft servers are designed for cooperative play with other players online or through a local area network (LAN) connection. These servers can run on your hosted server, local dedicated hardware server, local gaming computer, or virtual private server hosted on a personal machine.

Each Minecraft server requires default software provided by Mojang, which functions on Windows, Mac OS X, or Unix-based systems. Additionally, Mojang offers different server options, including LAN servers, external server clients, a rented server, and different realms that may vary.

Getting Started

In order to follow this guide you will need to have the following in place:
• One node (Cloud Server or Dedicated Server) that has Ubuntu 14.04 LTS installed.
• SSH Root Access to your server

Tutorial

Server Configuration

To begin, you need to verify that your server is currently up to date:
apt-get update && apt-get upgrade -y
After confirming that your server is current, checking that the most recent version of Java has been installed is next:
java -version

If it’s confirmed that the latest version of Java is not installed, you may receive a warning stating “The program ‘Java’ can be found in the following packages.” If this is the case, you will need to install Java through the following command (confirming with the Enter/Return key when prompted):
add-apt-repository ppa:openjdk-r/ppa
apt-get update
apt-get install openjdk-8-jdk -y

During setup, you will also need to install a screen package that will allow your server to continue operating, regardless of your ssh connection status:
apt-get install screen -y

Installing Minecraft

To begin, you will establish a folder in your /home path:
mkdir /home/minecraft ; cd /home/minecraft

Following that, you will download the current version of the server software from Mojang:
wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.12.1/minecraft_server.1.12.1.jar

Once the download has finished, you can start the server running as a daemon:
screen -S "Minecraft"

At this point, you have almost completed setting up your server for Minecraft, but you will need to accept and verify that the End User License Agreement (EULA) has been accepted as true. We encourage you to read through the EULA entirely before accepting it.

After you’ve read through the EULA, you will want to create a text file, called eula.txt, to set it as true:
touch eula.txt
echo "eula=TRUE" > eula.txt

Now that you have finished reading the EULA and accepted it, you can start your new server:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

As your server starts, you will observe the following in your console window:
root@globotech-minecraftserver-ubuntu14:/home/minecraft# java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
[15:12:05] [Server thread/INFO]: Starting minecraft server version 1.12.1
[15:12:05] [Server thread/INFO]: Loading properties
[15:12:05] [Server thread/WARN]: server.properties does not exist
[15:12:05] [Server thread/INFO]: Generating new properties file
[15:12:05] [Server thread/INFO]: Default game type: SURVIVAL
[15:12:05] [Server thread/INFO]: Generating keypair
[15:12:06] [Server thread/INFO]: Starting Minecraft server on *:25565
[15:12:06] [Server thread/INFO]: Using epoll channel type
[15:12:06] [Server thread/INFO]: Preparing level "world"
[15:12:06] [Server thread/INFO]: Loaded 488 advancements
[15:12:07] [Server thread/INFO]: Preparing start region for level 0
[15:12:08] [Server thread/INFO]: Preparing spawn area: 7%
[15:12:09] [Server thread/INFO]: Preparing spawn area: 14%
[15:12:10] [Server thread/INFO]: Preparing spawn area: 23%
[15:12:11] [Server thread/INFO]: Preparing spawn area: 31%
[15:12:12] [Server thread/INFO]: Preparing spawn area: 37%
[15:12:13] [Server thread/INFO]: Preparing spawn area: 46%
[15:12:14] [Server thread/INFO]: Preparing spawn area: 54%
[15:12:15] [Server thread/INFO]: Preparing spawn area: 63%
[15:12:16] [Server thread/INFO]: Preparing spawn area: 73%
[15:12:17] [Server thread/INFO]: Preparing spawn area: 84%
[15:12:18] [Server thread/INFO]: Preparing spawn area: 94%
[15:12:19] [Server thread/INFO]: Done (12.866s)! For help, type "help" or "?"

Congratulations! You’ve finished setting up your new Minecraft gaming server on Ubuntu 14.04, and you can exit the screen by hitting CTRL + a + d. If you choose to reattach the screen, you can do so in the following manner:
screen -R

If necessary, you can edit your server’s configuration through the following path:
nano /home/minecraft/server.properties

Conclusion

Your Minecraft server setup is complete, and you’re ready to begin utilizing the server for LAN or online gameplay in cooperative mode. If you found this setup guide useful, please share it with others looking to setup their game server.

Ark: Survival Of The Fittest

How to install ARK: Survival of the Fittest server on CentOS 7

Ark: Survival of the Fittest is a popular action game that features survival-themed crafting, combat, and most notably, the ability to tame and ride dinosaurs. Ark: Survival of the Fittest is a special game mode with fast-paced rounds in which the last player standing wins.

Ark: Survival of the Fittest must be played using specific servers. This guide will walk you through the steps of setting up this server on CentOS 7.

Getting started

Here’s what you’ll need in order to install the Ark: Survival of the Fittest server:
• 1 server (Cloud Server or Dedicated Server) running a fresh installation of CentOS 7.
• Root access to the server
• For basic support of up to 10 players, 2 vCores and 6GB of RAM or the equivalent will be needed.

Tutorial

The very first step is to update your system. This is also the time to install the basic dependencies.

yum update -y
yum install nano wget tar glibc.i686 libgcc.i686 libstdc++.i686 -y

Create an user specifically to access the Steam related content you’ll need for installation. It’s unsafe to use the root user for this purpose.

adduser -s /usr/sbin/nologin steam

Let’s make some quick preparations to your system before installation. First, for the purposes of the server, you’ll need to increase the amount of simultaneous system files that can be opened by altering sysctl.conf.

echo "fs.file-max=100000" >> /etc/sysctl.conf
sysctl -p

Then, alter the system limits configuration file with the following:

echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf

Finally, enable the PAM limits module on the system to prepare it for use as a multiuser server.

echo "session required pam_limits.so" >> /etc/pam.d/system-auth

Now you can proceed with the installation of the Ark: Survival Evolved server.

cd /home/steam
/home/steam# su -s /bin/bash steam
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -zxvf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz
./steamcmd.sh

After entering the Steam command line interface, type this command to install the game server.

login anonymous
force_install_dir ./arkserver
app_update 445400 validate

You will have to wait while the server software downloads. This can take a variable amount of time depending on your connection, but you are done once you see the following.

Update state (0x61) downloading, progress: 99.95 (3222988684 / 3224465090)
Success! App '445400' fully installed.

Now that the server is installed, exit the command line interface with quit.

Switch over to the root user so you can set up the server configuration.

In order for the Ark server to automatically start on boot, you can create an init script. This is what you will name it:

nano /etc/systemd/system/arkserver.service

And now, simply add the following content to the file: (Make sure that the ExecStart line corresponds to what you had in the previous file)

[Unit]
Description=ARK Survival Server
[Service]
Type=simple
User=steam
Group=steam
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
ExecStart=/home/steam/arkserver/ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?SessionName=?ServerPassword=?ServerAdminPassword= -server -log
ExecStop=killall -TERM srcds_linux
[Install]
WantedBy=multi-user.target

Now start the Ark server, and enable it to start on boot.

systemctl --system daemon-reload
systemctl start arkserver.service
systemctl enable arkserver.service

Use systemctl to verify that the server is actually running. Here’s the command you should use, and an example of expected output:

service arkserver status

? arkserver.service - ARK Survival Server
Loaded: loaded (/etc/systemd/system/arkserver.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2016-08-12 23:57:27 UTC; 3s ago
Main PID: 27027 (ShooterGameServ)
CGroup: /system.slice/arkserver.service
??27027 /home/steam/arkserver/ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?SessionName..

Adjust the firewall rules from the default settings. (If you have already altered the firewall in some way, you may need to make further adjustments.) You’ll have to open up these ports to allow traffic to flow to and from the Ark server:

firewall-cmd --add-port=27015/udp
firewall-cmd --add-port=7777/udp
firewall-cmd --add-port=32330/tcp

This is what each port is for:
• UDP 27015: Query port for Steam’s server browser
• UDP 7777: Game client port
• TCP 32330: RCON for remote console server access (optional)

Here’s an equivalent command you can use with iptables, if you prefer:

iptables -A INPUT -p udp -m udp --sport 27015 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p udp -m udp --sport 7777 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 32330 --dport 1025:65355 -j ACCEPT

Conclusion

Installation is now complete. If you’ve set it up properly, you should now be able to host games of Ark: Survival of the Fittest for up to 10 players. Add more vCores and RAM to enable even more players to join your server.

install Ark: Survival Of The Fittest

How to install ARK: Survival of the Fittest server on Ubuntu 16

Ark: Survival Evolved is a popular action game that features survival-themed crafting, combat, and most notably, the ability to tame and ride dinosaurs. Ark: Survival of the Fittest is a special game mode with fast-paced rounds in which the last player standing wins.

Ark: Survival of the Fittest must be played using specific servers. This guide will walk you through the steps of setting up this server on Ubuntu 16.04 LTS.

Getting started

In order to follow this guide, you must have these requirements prepared beforehand:
• 1 server (Cloud Server or Dedicated Server) running a fresh installation of Ubuntu 16.
• This server must also have at least 2 vCores and 6GB of ram, which will be suitable for under 10 players. As more players will join your server you are to consider adding more RAM to your server.
• All commands will be run as root unless otherwise specified explicitly. A user will be created later for the Steam components.

Tutorial

Before beginning the installation process, wake sure your system is up to date. This is also a good time to install the basic dependencies.

apt-get update && apt-get upgrade -y
apt-get install nano wget tar lib32gcc1 -y

The first step is to create an user for Steam related content. For security reasons, you won’t want to use root for this.

adduser --disabled-login --disabled-password steam

Now it’s time to prepare your system with specific parameters to allow the game server to run. First, increase the amount of simultaneous system files that can be opened. You can do this by editing your sysctl.conf.

echo "fs.file-max=100000" >> /etc/sysctl.conf
sysctl -p

Append the following changes to your system limits configuration file.

echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf

Finally, enable the PAM limits module. Now your server is prepared to install Ark: Survival of the Fittest.

echo "session required pam_limits.so" >> /etc/pam.d/common-session

Now to proceed to the installation of the Ark server software.

cd /home/steam
/home/steam# su - steam
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -zxvf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz
./steamcmd.sh

This will be done through the Steam command line interface. To install your game server, you must execute the following commands:

login anonymous
force_install_dir ./arkserver
app_update 445400 validate

Wait for the software to be downloaded. Once you see the following, the installation is complete.

Update state (0x61) downloading, progress: 99.95 (3222988684 / 3224465090)
Success! App '445400' fully installed.

Now that the server is installed, simply type quit to get out of the steam command line interface.

The next step is to configure your newly-installed Ark server. You will need to use the root user for these next commands.

Let’s create an init script so that your Ark server will start automatically if the Ubuntu server were to reboot. Create the following file:

nano /lib/systemd/system/arkserver.service

Add the following contents into the file, making sure that the ExecStart line corresponds to what you had in the previous file.

[Unit]
Description=ARK Survival Server
[Service]
Type=simple
User=steam
Group=steam
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
ExecStart=/home/steam/arkserver/ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?SessionName=?ServerPassword=?ServerAdminPassword= -server -log
ExecStop=killall -TERM srcds_linux
[Install]
WantedBy=multi-user.target

Start and enable the Ark Survival Server on system boot.

systemctl --system daemon-reload
systemctl start arkserver.service
systemctl enable arkserver.service

You can check your server is actually running with systemctl. Below you’ll find the exact command and the expected output which confirms that the daemon is operational.

systemctl status arkserver.service
arkserver.service - ARK Survival Server
Loaded: loaded (/lib/systemd/system/arkserver.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2016-08-12 20:47:46 UTC; 4min 13s ago
Main PID: 24825 (ShooterGameServ)
CGroup: /system.slice/arkserver.service
??24825 /home/steam/arkserver/ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?SessionName=MyARKServer?ServerPassword=friendspassword?ServerAdminPassword=superadminpassword -server -log

Since this is a fresh Ubuntu server, its firewall service should be already enabled. The default settings are suitable but we will be adding a few rules for Ark server traffic. We’ll open up these ports.

ufw allow 27015/udp
ufw allow 7777/udp
ufw allow 32330/tcp

For your reference, here is the traffic that will be flowing through these ports:
• UDP 27015: Query port for Steam’s server browser
• UDP 7777: Game client port
• TCP 32330: RCON for remote console server access (optional)

Of course, you can also use the classical iptables method via these commands:

iptables -A INPUT -p udp -m udp --sport 27015 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p udp -m udp --sport 7777 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 32330 --dport 1025:65355 -j ACCEPT

Conclusion

With that, you should now have a properly installed ARK Survival Server ready to welcome players. Be sure to upgrade your server if you find yourself regularly approaching or exceeding 10 players a game. If you liked this article, please share it with your friends.

Ark: Survival Of The Fittest

How to install ARK: Survival of the Fittest Server on Ubuntu 14

Ark: Survival of the Fittest is a game mode for the popular action adventure game Ark: Survival Evolved. It was released in 2016 as a free standalone game, but was later merged back into the main game. For those lucky enough to begin playing while it was free, you can continue to do so, and even install servers for multiplayer play with your friends.

Getting started

In order to install the Ark: Survival of the Fittest server software, you will need the following:
• 1 server (Cloud Server or Dedicated Server) running a fresh installation of Ubuntu 14.
• All commands must be entered as root with the exception of some performed by a user that we will create specifically for running Steam.
• 2 vCores and 6GB RAM. These are the minimum requirements for an Ark server that can handle up to 10 users.

Tutorial

The very first task is to make sure that your system is fully up to date, and also that you have the basic dependencies:
apt-get update && apt-get upgrade -y
apt-get install nano wget tar lib32gcc1 -y

For Steam-specific tasks, we will need to create an user, as it’s unsafe to use Steam with the root user.
adduser --disabled-login --disabled-password steam

The next task is to prepare your system with certain parameters to allow the game server to run correctly. We’ll need to increase the amount of simultaneous system files that can be opened, which can be effected through a quick edit of sysctl.conf..
echo "fs.file-max=100000" >> /etc/sysctl.conf
sysctl -p

Append some changes to the system limits configuration file.
echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf

And then lastly, enable the PAM limits module on the system.
echo "session required pam_limits.so" >> /etc/pam.d/common-session

Now that the system has been prepared, you can proceed with installing the server software.
cd /home/steam
su - steam
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -zxvf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz
./steamcmd.sh

Once you’ve entered the Steam command line interface, you can install your game server by executing the following commands.
login anonymous
force_install_dir ./arkserver
app_update 445400 validate

You will have to wait for the contents to download onto your system. A successful installation will be rewarded with this message:
Update state (0x61) downloading, progress: 99.95 (3222988684 / 3224465090)
Success! App '445400' fully installed.

Now that you’re done, it’s a simple matter to type quit to get out of the steam command line interface.

Next are some commands that you will have to perform as the root user on your machine. We’ll be tackling the server configuration and the startup script.

You will need to make an init script so that the ark server will be sure to start up on boot, after a server reboot occurs. This is the name of the init script you will create:
nano /etc/init.d/arkserver

Now place this into the file, while making sure that the DAEMON_ARGS variable contains your server’s configuration.
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
# Author: Foo Bar
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.
# Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/home/steam/arkserver/ShooterGame/Binaries/Linux:/sbin:/usr/sbin:/bin:/usr/bin
DESC="ARK Dedicated Server"
NAME=ShooterGameServer
DAEMON=/home/steam/arkserver/ShooterGame/Binaries/Linux/$NAME
DAEMON_ARGS="TheIsland?listen?SessionName=MyARKServer?ServerPassword=friendspassword?ServerAdminPassword=superadminpassword -server -log"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/arkserver
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --chuid 1000:1000 --exec $DAEMON --test > /dev/null 2>&1 \
|| return 1
start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --chuid 1000:1000 --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
#return 0
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/INT/15/KILL/5 --pidfile $PIDFILE --chuid 1000:1000 --exec $DAEMON
RETVAL="$?"
kill -9 `cat $PIDFILE`
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
##start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
##[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME &
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac

Naturally, you will need to change the permissions of your init script so that it is executable.
chmod +x /etc/init.d/arkserver

Start the Ark server, and enable it on system boot.
update-rc.d arkserver defaults
service arkserver start

The below command will allow you to check that the Ark server is running. This is the expected output that will confirm that the daemon is running and in working order:
service arkserver status
* ShooterGameServer is running

The final step is to adjust your firewall rules to let Ark and user traffic through. If you are using a fresh Ubuntu installation as specified in the prerequirements, then you will need to make no further changes than what’s listed below. If you’ve already changed your firewall rules in the past, then you may need to make further adjustments.

Here’s how to open the necessary ports.
ufw allow 27015/udp
ufw allow 7777/udp
ufw allow 32330/tcp

Here’s a definition of the purpose of each port:

UDP 27015: Query port for Steam’s server browser
UDP 7777: Game client port
TCP 32330: RCON for remote console server access (optional)

Here’s a way to open the ports if you’re using the classic iptables interface:
iptables -A INPUT -p udp -m udp --sport 27015 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p udp -m udp --sport 7777 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 32330 --dport 1025:65355 -j ACCEPT

Conclusion

You should now have a properly installed ARK: Survival of the Fittest server suitable for up to 10 players. Invite your friends and test it out!