Install KnowledgeBase - advocaite/TravianT4.6 GitHub Wiki

CentOS 7 (64-bit)

1. Installation Instructions

1.1 Create a New User:

Log in as root or use sudo and run: adduser travian

1.2 Set a Password for the User (Optional):

Assign a password to the new user: passwd travian

1.3 Add Sudo Permissions:

Instead of editing /etc/sudoers directly, create a new configuration file for the user. This method is safer and recommended.

Create a new file in the /etc/sudoers.d/ directory: sudo nano /etc/sudoers.d/travian

Add the following content to the file: travian ALL=(ALL) NOPASSWD:ALL

Save and exit by pressing Ctrl+X, Enter, and then Y.

1.4 Set Correct Permissions for the File:

Ensure the new file has the correct permissions: sudo chmod 440 /etc/sudoers.d/travian

1.5 Test the Configuration:

Switch to the new user: su - travian

Run a command as sudo to confirm no password is required: sudo whoami

If the configuration is correct, the output will be: root

2. Install Nginx MySQL Server (LEMP Stack)

2.1 Install Nginx:

sudo yum install -y nginx

2.2 Install MySQL 8.0 Community Repository:

sudo yum install -y https://dev.mysql.com/get/mysql84-community-release-el7-1.noarch.rpm

2.3 Download the MySQL GPG key:

sudo curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023 https://repo.mysql.com/RPM-GPG-KEY-mysql-2023

2.4 Import the MySQL GPG key:

sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023

2.4 Install MySQL Server:

sudo yum install -y mysql-community-server

2.5 Start the MySQL service

sudo systemctl start mysqld

2.6 Enable MySQL to start on boot

sudo systemctl enable mysqld

2.7 Get the temporary root password generated by MySQL during installation

sudo grep 'temporary password' /var/log/mysqld.log

2.8 Run the MySQL secure installation script

sudo mysql_secure_installation

The script will prompt for the temporary password found earlier, and guide you through securing the MySQL installation:

  • Set a new root password
  • Remove insecure default settings (e.g., test database, anonymous users, etc.)
  • Reload privilege tables

2.9 Log into MySQL as root using the new password

mysql -u root -p

2-3 Edit the MySQL Configuration File (my.cnf)

Open the my.cnf file for editing

sudo nano /etc/my.cnf

Add the following lines under [mysqld] section

[mysqld]
#Set the default authentication plugin to mysql_native_password (default)
default_authentication_plugin = mysql_native_password

#Optional: Allow access from any IP (ensure MySQL is secured appropriately)
bind-address = 0.0.0.0

### Add the following content to end of the file (replace YourRootPassword with your actual root password)
[client]
user=root
password=YourRootPassword
host=localhost

Save the file and exit (Ctrl + X, then Y to confirm)

Test passwordless login for MySQL root

mysql -u root

3. Installing php 7.3

3.1 Enable the Remi repository for PHP 7.3

sudo yum install -y yum-utils

sudo yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm

sudo yum install -y epel-release

sudo yum install -y yum-utils

3.2 Enable PHP 7.3

sudo yum-config-manager --enable remi-php73

3.3 Install PHP 7.3 and required extensions

sudo yum install -y php php-mysqli php-pdo php-pdo_mysql php-pdo_sqlite php-mysqlnd \
php-memcache php-redis php-gd php-mbstring php-xml php-json php-posix php-sysvsem \
php-sysvshm php-curl php-sockets php-ftp php-calendar php-fileinfo php-zip php-geoip

4 Update PHP Configuration

4.1 Edit the php.ini file

sudo nano /etc/php.ini

4.2 Add or modify the following lines in the php.ini file

max_execution_time = 300 # 5 minutes

max_input_time = 60 # 1 minute

memory_limit = 128M # 128MB

4.3 Restart PHP-FPM

sudo systemctl restart php-fpm


installing git and your first pull (NOT USE NOW)

git is already installed in ubuntu 22.04 this is how i did it.

sudo mkdir travian

cd travian

sudo git init .

sudo git remote add -t \* -f origin https://github.com/advocaite/TravianT4.6.git

sudo git pull origin main

cd /

chown -R travian.travian travian

We may copy or move directories later and edit files if need just be aware or how changes can affect git if you update files from main origin.

mysql setup

you will need to decide on phpmyadmin but make sure you use php7.3 or you can do it via commands

create a new user and grant them all privleges this will be main user for script you update global config with information you recive.

import main.sql into table called main this file is very important for setting up servers in db. you can do this for example:

mysql -u username -p database_name < /travian/main.sql