• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

LINUX VPS SETUP SCRIPT

Sun

Knowledge is power - France is bacon
Joined
Jan 26, 2015
Messages
333
Solutions
22
Reaction score
243
To many it can be intimidating, frustrating & well... a pain in the ass to setup a linux VPS
I personally don't like doing it (probably because I do it way too often).

Anyways since I've found myself setting up Debian & Ubuntu VPSs over & over again, I figured it would be way more handy to just write a shell script once instead of continuing this endless cycle.

This will install & setup the following for you, all you have to do is edit the config at the top of the .sh file to fit your needs.
  • Creates a sudo user with desired username & pass
  • Nginx - your www root will be set to /home/username/www
  • PHP 7.0 - additionally configures nginx to work with fpm & reads php files.
  • MySQL or MariaDB (MariaDB is a fork of mysql, from a users perspective there's barely any difference)
  • phpMyAdmin - additionally configures nginx & creates a symbolic link to set your desired link to access pMA
  • c++ tools & libraries required for compiling your engine

So far I've only tested it on Ubuntu 16.04, should however work with Debian 9+ & Ubuntu 16+ distributions

Idk how the script will perform if you've already installed a bunch of stuff on your vps, maybe it will work, maybe it won't. Still, I'd recommend doing it on a fresh installation.

Enjoy!
 

Attachments

Last edited by a moderator:
Yo!
To many it can be intimidating, frustrating & well... a pain in the ass to setup a linux VPS
I personally don't like doing it (probably because I do it way too often).

Anyways because I've found myself setting up Debian & Ubuntu VPSs I figured it would be way more handy to just make a shell script once, compared to repeating the same process a million times more.

So far I've only tested it on Ubuntu 16.04 but
It should work with Debian 9+ & Ubuntu 16+

Instructions
  1. When you receive your newly installed VPS transfer the shell script to your vps.
  2. Edit the config to fit your needs
Idk how the script will work if you've already installed a bunch of stuff on your vps, maybe it will work, maybe it won't. Still I'd recommend doing it on a fresh installation.

Enjoy!

You can also use ansible :)
 
You can also use ansible :)
What benefits would there be to gain from switching to ansible when this shell script already installs & sets up everything required for ot hosting?
They only seem to offer a free trial, how long does that trial last?
And more importantly does it come ready out of the box to setup a vps for ot hosting or does it require configuring?
 
I think setup a linux vps is so fuxking easy i just saved the nesesary lines into a txt and then copy paste ty anyway good release for beginners
 
What benefits would there be to gain from switching to ansible when this shell script already installs & sets up everything required for ot hosting?
[...]
And more importantly does it come ready out of the box to setup a vps for ot hosting or does it require configuring?

In my opinion ansible playbook with roles is cleaner and separate config file and file with every installation step on each oter.
Whats more it in most cases yaml is self explaining.

Code:
### SOME EXAMPLES
- name: Update package list
  apt:
    update_cache: yes

# here I do:
# apt-get -y dist-upgrade
- name: Upgrade packages
  apt:
    upgrade: dist

# some packages for Debian (ansible first auto detect system)
- name: Install default packages
  apt: name={{item}} state=installed
  with_items:
    - sudo
    - vim
    - git
    - curl
    - wget
  when: ansible_distribution == "Debian"

- name: Create group
  group:
    name: tfs
    state: present

- name: Create user
  user:
    name: tfs
    shell: /bin/bash
    group: tfs

- name: Set home directory permission
  file:
    path: /home/tfs
    mode: 0750

- name: PHP cgi info fix
  lineinfile:
    dest: /etc/php/7.0/fpm/php.ini
    regexp: '^;cgi.fix_pathinfo=.* '
    line: 'cgi.fix_pathinfo=0'
  register: php_cgi_fix

- name: Reload php
  service:
    name: php7.0-fpm
    state: reloaded
  when: php_cgi_fix.changed

BTW I found one small typo in script :)
Now it is:
Code:
apt-get -y upgrade
apt-get -y update

Should be:
Code:
apt-get -y update
apt-get -y upgrade

PS: I posted not tested example, so there can be some typos or so :)
 
This is exact reason why people should start using docker/docker-compose.
 
you have these 2 in the wrong order:

Code:
apt-get -y upgrade
apt-get -y update

- that said, i think it doesn't make a difference as of debian 10 (not yet released) / ubuntu 18.04, because newer apt automatically runs update before upgrade (while older apt's, like the one in debian 9/ubuntu 16.04, does not)
 
Is it possible to replace mysql with MariaDB?
sure,
Code:
wget 'https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb'
sudo apt install ./mysql-apt-config_0.8.13-1_all.deb
sudo apt update
sudo apt install mysql-server

- or read MySQL :: A Quick Guide to Using the MySQL APT Repository (https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/)


note that if you do this, you will no longer be covered by the Debian Security Team (for debian) or Ubuntu Security Team (for ubuntu), you'll be using an upstream version of MySQL maintained by the MySQL upstream developers instead.
 
Back
Top