• 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!

SIMPLE ALL IN ONE: From nothing to a fully working dedicated server on Ubuntu

Hello there, sorry for reviving old topic but i've tried to use your script and sadly ive met a wall i cannot jump over...

Code:
TASK [Set MySQL otsmanager password (localhost)] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1698, \"Access denied for user 'root'@'localhost'\")"}

PLAY RECAP *********************************************************************
localhost                  : ok=21   changed=3    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0

Freshly installed Ubuntu 22.04.2


EDIT

Nvm, found it, just had to create ~/.my.cnf file because it couldnt log in without it.

EDIT V2

Welp, i did fix the last issue, but there is another... for some reason when i try to get to the website, which (i assume) should be running i get "The page or file you requested was not found. If this is your server, make sure you placed it under /home/otsmanager/www/public_html directory."

No matter what i change, i cannot get it to run, phpMyAdmin works just fine, but znoteAAC is just dead - tried with info.php trick but i didnt get anything else than "The page or file(...)".

Any ideas?
 
Last edited by a moderator:
Hello there, sorry for reviving old topic but i've tried to use your script and sadly ive met a wall i cannot jump over...

Code:
TASK [Set MySQL otsmanager password (localhost)] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1698, \"Access denied for user 'root'@'localhost'\")"}

PLAY RECAP *********************************************************************
localhost                  : ok=21   changed=3    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0

Freshly installed Ubuntu 22.04.2


EDIT

Nvm, found it, just had to create ~/.my.cnf file because it couldnt log in without it.

EDIT V2

Welp, i did fix the last issue, but there is another... for some reason when i try to get to the website, which (i assume) should be running i get "The page or file you requested was not found. If this is your server, make sure you placed it under /home/otsmanager/www/public_html directory."

No matter what i change, i cannot get it to run, phpMyAdmin works just fine, but znoteAAC is just dead - tried with info.php trick but i didnt get anything else than "The page or file(...)".

Any ideas?

The readme in repo says that is supports only Ubuntu 20.04, so you should use this version.

@topic @everyone
For anyone wondering how to get myaac working on this setup:

Do everything like stated in the first post, just replace the last command (ansible-pull)

with this:
Bash:
ansible-pull -i localhost, -U https://github.com/DevelopersPL/otshosting-provisioning.git -d /srv/otshosting-provisioning --purge -t systemd,general,mysql,php-fpm,nginx,pma,tfs,myaac

After this, when you visit your IP, you will see screen like this:
1689961713088.png


You will need to open file install/ip.txt and add your IP in the last line there (123.123.123.123) - replace it with what you see.
The ip.txt is located in /home/otsmanager/www/public_html/install/ip.txt

After that you will be able to follow the installation!

BTW: In step 4 - configuration, when asked for server path, enter this:

/home/otsmanager/forgottenserver

Good luck! ;)
 
Last edited:
Hey guys i have a problem. The Installation script is not working for me. I used it years ago but now it don't works. I tried it on Ubuntu 20.04 there it doesn't even start on Ubuntu 22.04 i copied you the root console:

LUA:
Starting Ansible Pull at 2023-08-03 18:09:49
/usr/bin/ansible-pull -i localhost, -U https://github.com/DevelopersPL/otshosting-provisioning.git -d /srv/otshosting-provisioning --purge -t systemd,general,mysql,php-fpm,nginx,pma,tfs,myaac
[WARNING]: Could not match supplied host pattern, ignoring: srv01
localhost | CHANGED => {
    "after": "7546f0374132ac71afcd00611315c8406b9810e9",
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "before": null,
    "changed": true
}
[WARNING]: Could not match supplied host pattern, ignoring: srv01


PLAY [all] *********************************************************************


TASK [Gathering Facts] *********************************************************
ok: [localhost]


TASK [Fail if not running on Ubuntu] *******************************************
skipping: [localhost]


TASK [Fail if Ubuntu older than 20.04] *****************************************
skipping: [localhost]


TASK [Check available PHP package name/version] ********************************
ok: [localhost]


TASK [Register available PHP package name/version] *****************************
ok: [localhost]


TASK [Create /var/log/journal] *************************************************
ok: [localhost]


TASK [Create /etc/systemd/journald.conf.d] *************************************
changed: [localhost]


TASK [Install /etc/systemd/journald.conf.d/journald.conf] **********************
changed: [localhost]


TASK [Remove LXC, snapd in case it's installed (Ubuntu Cloud has it)] **********
changed: [localhost]


TASK [Upgrade whole system] ****************************************************
changed: [localhost]


TASK [Install admin essentials] ************************************************
changed: [localhost]


TASK [Create otsmanager system user] *******************************************
changed: [localhost]


TASK [Select editor for otsmanager] ********************************************
changed: [localhost]


TASK [Install .otsmanager shell configuration] *********************************
changed: [localhost]


TASK [Activate .otsmanager shell configuration file] ***************************
changed: [localhost]


TASK [Delete Ubuntu Cloud ad] **************************************************
ok: [localhost]


TASK [Install welcome message] *************************************************
changed: [localhost]


TASK [Install MySQL Server and backup packages] ********************************
changed: [localhost]


TASK [Change MySQL charset to prevent MySQL error 1709] ************************
changed: [localhost]


TASK [Start Mysql Service] *****************************************************
changed: [localhost]


TASK [Parse existing .my.cnf] **************************************************
changed: [localhost]


TASK [Generate random MySQL otsmanager password] *******************************
changed: [localhost]


TASK [set_fact] ****************************************************************
ok: [localhost]


TASK [Set MySQL otsmanager password (localhost)] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1698, \"Access denied for user 'root'@'localhost'\")"}


RUNNING HANDLER [restart systemd-journald] *************************************


RUNNING HANDLER [restart mysql] ************************************************


PLAY RECAP *********************************************************************
localhost                  : ok=21   changed=15   unreachable=0    failed=1    skipped=2    rescued=0    ignored=0


root@srv01:~#

What i can do?
 
Hey guys i have a problem. The Installation script is not working for me. I used it years ago but now it don't works. I tried it on Ubuntu 20.04 there it doesn't even start on Ubuntu 22.04 i copied you the root console:
What happens when you type mysql in the console? Does it connect?
What happened with Ubuntu 20.04? Why didn't it start?
 
Hello,
today I was trying to install OTS on fresh Ubuntu Server 20.4.6 LTS. Some time ago I was using same way to provision game server and It worked fine. However today I'm getting:

LUA:
root@tibiaots-srv2:~# ansible-pull -i localhost, -U https://github.com/DevelopersPL/otshosting-provisioning.git -d /srv/otshosting-provisioning -t default
Starting Ansible Pull at 2023-10-20 19:55:40
/usr/bin/ansible-pull -i localhost, -U https://github.com/DevelopersPL/otshosting-provisioning.git -d /srv/otshosting-provisioning -t default
[WARNING]: Could not match supplied host pattern, ignoring: tibiaots-srv2
localhost | SUCCESS => {
    "after": "24324ff2b415138e3d74ebabee54e23802c62377",
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "before": "24324ff2b415138e3d74ebabee54e23802c62377",
    "changed": false,
    "remote_url_changed": false
}
[WARNING]: Could not match supplied host pattern, ignoring: tibiaots-srv2
ERROR! couldn't resolve module/action 'community.general.composer'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/srv/otshosting-provisioning/tasks/phpmyadmin-sso.yml': line 16, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Install dependencies
  ^ here
root@tibiaots-srv2:~#
root@tibiaots-srv2:~#
root@tibiaots-srv2:~#


I was checking mentioned file and I don't see anything unusual with syntax...

Code:
---
- name: Give www-data access to MySQL
  mysql_user:
    name: www-data
    host: localhost
    priv: "*.*:ALL,GRANT"
    plugin: unix_socket
    plugin_hash_string: www-data
    check_implicit_admin: yes

- name: Download latest PMA SSO
  git:
    repo: https://gist.github.com/857dfc08aacb208bbade901ba7b9f9ba.git
    dest: /usr/local/share/pmasso

- name: Install dependencies
  community.general.composer:
    command: install
    working_dir: /usr/local/share/pmasso
  environment:
    COMPOSER_HOME: /root/.config/composer

- name: Activate PMA SSO
  file:
    src: /usr/local/share/pmasso/sso.php
    dest: /etc/phpmyadmin/conf.d/sso.php
    owner: root
    group: root
    state: link

May I ask for helping hand, please? :)
 
What happens when you type mysql in the console? Does it connect?
What happened with Ubuntu 20.04? Why didn't it start?

I have the same issue, I've got a fully fresh Ubuntu 22.04, and when following the first steps everything works perfectly but as soon as I do

LUA:
ansible-pull -i localhost, -U https://github.com/DevelopersPL/otshosting-provisioning.git -d /srv/otshosting-provisioning -t default


I get this:

Code:
TASK [Set MySQL otsmanager password (localhost)] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1698, \"Access denied for user 'root'@'localhost'\")"}

PLAY RECAP *********************************************************************
localhost                  : ok=21   changed=4    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0

When writing mysql on the console, this is what I get:


Code:
ubuntu@vps-ad999dd7:~$ mysql
ERROR 1698 (28000): Access denied for user 'ubuntu'@'localhost'

But works if I do sudo mysql
 
The entire ansible-pull command must be run as root, it makes sense you wouldn't be able to just use mysql as a non-root user.
 
The entire ansible-pull command must be run as root, it makes sense you wouldn't be able to just use mysql as a non-root user.

I did use it as root, yet I get the same issue. I tried once again to make sure I used root, here is the result


LUA:
ubuntu@vps-ad999dd7:~$ sudo ansible-pull -i localhost, -U https://github.com/Dev                                                                                                                                                             elopersPL/otshosting-provisioning.git -d /srv/otshosting-provisioning -t default
Starting Ansible Pull at 2024-01-20 12:41:05
/usr/bin/ansible-pull -i localhost, -U https://github.com/DevelopersPL/otshostin                                                                                                                                                             g-provisioning.git -d /srv/otshosting-provisioning -t default
[WARNING]: Could not match supplied host pattern, ignoring: vps-
ad999dd7.vps.ovh.net
[WARNING]: Could not match supplied host pattern, ignoring: vps-ad999dd7
localhost | CHANGED => {
    "after": "24324ff2b415138e3d74ebabee54e23802c62377",
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "before": null,
    "changed": true
}
[WARNING]: Could not match supplied host pattern, ignoring: vps-
ad999dd7.vps.ovh.net
[WARNING]: Could not match supplied host pattern, ignoring: vps-ad999dd7

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [Fail if not running on Ubuntu] *******************************************
skipping: [localhost]

TASK [Fail if Ubuntu older than 20.04] *****************************************
skipping: [localhost]

TASK [Check available PHP package name/version] ********************************
ok: [localhost]

TASK [Register available PHP package name/version] *****************************
ok: [localhost]

TASK [Create /var/log/journal] *************************************************
ok: [localhost]

TASK [Create /etc/systemd/journald.conf.d] *************************************
changed: [localhost]

TASK [Install /etc/systemd/journald.conf.d/journald.conf] **********************
changed: [localhost]

TASK [Remove LXC, snapd in case it's installed (Ubuntu Cloud has it)] **********
changed: [localhost]

TASK [Upgrade whole system] ****************************************************
ok: [localhost]

TASK [Install admin essentials] ************************************************
changed: [localhost]

TASK [Create otsmanager system user] *******************************************
changed: [localhost]

TASK [Select editor for otsmanager] ********************************************
changed: [localhost]

TASK [Install .otsmanager shell configuration] *********************************
changed: [localhost]

TASK [Activate .otsmanager shell configuration file] ***************************
changed: [localhost]

TASK [Delete Ubuntu Cloud ad] **************************************************
ok: [localhost]

TASK [Install welcome message] *************************************************
changed: [localhost]

TASK [Install MySQL Server and backup packages] ********************************
changed: [localhost]

TASK [Change MySQL charset to prevent MySQL error 1709] ************************
changed: [localhost]

TASK [Start Mysql Service] *****************************************************
changed: [localhost]

TASK [Parse existing .my.cnf] **************************************************
changed: [localhost]

TASK [Generate random MySQL otsmanager password] *******************************
changed: [localhost]

TASK [set_fact] ****************************************************************
ok: [localhost]

TASK [Set MySQL otsmanager password (localhost)] *******************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1698, \"Access denied for user 'root'@'localhost'\")"}

RUNNING HANDLER [restart systemd-journald] *************************************

RUNNING HANDLER [restart mysql] ************************************************

PLAY RECAP *********************************************************************
localhost                  : ok=21   changed=14   unreachable=0    failed=1    skipped=2    rescued=0    ignored=0

ubuntu@vps-ad999dd7:~$
 
LUA:
"Access denied for user 'root'@'localhost'\")"}
Ubuntu 22.04
Access is a permission, for user, is all about permission.
Goto putty, log in, write "sudo su" you will be in root account.
Write "mysql" mariaDB will show up.
Write GRANT ALL PRIVILEGES ON . TO 'root'@'localhost';
FLUSH PRIVILEGES;
exit
Rerun command: apt update
apt install -y -q python3-simplejson python3-pymysql git ansible aptitude
ansible-pull -i localhost, -U GitHub - DevelopersPL/otshosting-provisioning: Ansible playbook to provision OTS Hosting on Ubuntu 20.04 (https://github.com/DevelopersPL/otshosting-provisioning.git) -d /srv/otshosting-provisioning -t default


If still there will be the same error.
From root account, write command " visudo /etc/sudoers "
And check if there is "otsmanager ALL=(ALL:ALL) ALL" if not add this below root user.
"root ALL=(ALL:ALL) ALL" should be there, but if not add this.
Exit through Ctrl+x buttons, save yes.

visudo etc sudoers.webp
 
Last edited:
Hi i tried this script today and it fails on
LUA:
TASK [Start php8.1-fpm Service] ************************************************
ok: [localhost]

TASK [Install nginx] ***********************************************************
ok: [localhost]

TASK [Create /etc/nginx/default.d] *********************************************
ok: [localhost]

TASK [Copy nginx configuration for default vhost] ******************************
ok: [localhost]

TASK [Start nginx Service] *****************************************************
ok: [localhost]

TASK [Install debconf to set preseed info] *************************************
ok: [localhost]

TASK [Set preseed info phpmyadmin/dbconfig-install] ****************************
[WARNING]:ok: [local The valuehost]
 "True" (type bool) was converted to "'True'" (type
string). If this does not look like what you expect, quote the entire value to
ensure it does not change.

TASK [Set preseed info phpmyadmin/app-password-confirm] ************************
changed: [localhost]

TASK [Set preseed info phpmyadmin/mysql/admin-pass] ****************************
changed: [localhost]

TASK [Set preseed info phpmyadmin/mysql/app-pass] ******************************
changed: [localhost]

TASK [Set preseed info phpmyadmin/reconfigure-webserver] ***********************
ok: [localhost]

TASK [Install phpmyadmin] ******************************************************
ok: [localhost]

TASK [Install packages needed to compile TFS] **********************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "No package matching 'libboost-json-dev' is available"}

PLAY RECAP *********************************************************************
localhost                  : ok=48   changed=6    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0

root@tfstest:~#
anyone knows what to do ?
 
Updated July 2023: Current latest supported (tested) version of Ubuntu is 22.04.
GitHub code was updated to Support Ubuntu 24.04 (#30) 2 months ago:
anyone knows what to do ?
It looks like first post was not updated, but this tutorial probably requires Ubuntu 24.04.
Package libboost-json-dev is only available in Ubuntu 24.04.

TASK [Start php8.1-fpm Service]
Your Ubuntu version is probably 22.04 as it has installed PHP 8.1 (Ubuntu 20.04 -> 7.4, 22.04 -> 8.1, 24.04 -> 8.3)
 
GitHub code was updated to Support Ubuntu 24.04 (#30) 2 months ago:

It looks like first post was not updated, but this tutorial probably requires Ubuntu 24.04.
Package libboost-json-dev is only available in Ubuntu 24.04.


Your Ubuntu version is probably 22.04 as it has installed PHP 8.1 (Ubuntu 20.04 -> 7.4, 22.04 -> 8.1, 24.04 -> 8.3)
so i must upgrade ubuntu version and do the same commands ?
 
so i must upgrade ubuntu version and do the same commands ?
Probably. Easiest way is to request reinstall of OS (operating system), if it's on Cloud/VPS/dedic.
Ubuntu OS upgrade (22 -> 24) should work, but it may fail.. it's Linux. It will also take much more time than OS reinstall by datacenter (15-30 seconds on Cloud [order new machine], 5-20 minutes on VPS/dedic).
 
Hello!

I'm trying to use this, but it doesn't seem to work. It doesn't create the otsmanager system user, install MySQL, Nginx, or anything. :/

Im using ubuntu 24.04.1


123.webp
 
Hello!

I'm trying to use this, but it doesn't seem to work. It doesn't create the otsmanager system user, install MySQL, Nginx, or anything. :/

Im using ubuntu 24.04.1
For now "Supported OS: Ubuntu 20.04 & 22.04". I haven't updated it for 24.04 yet.
 
Back
Top