Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running your first OT on Ubuntu Linux #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Running your first OT on Ubuntu Linux #2

wants to merge 7 commits into from

Conversation

Ralumbi
Copy link
Contributor

@Ralumbi Ralumbi commented Apr 22, 2020

Created a book for setting up a complete webserver on linux

@Ralumbi
Copy link
Contributor Author

Ralumbi commented Apr 26, 2020

@DSpeichert I've changed the points you've pointed out, thanks for letting me know. Happy to learn things the more professional way. Also added the final part which I totally forgot to setup TFS.

@Ralumbi Ralumbi requested a review from DSpeichert May 3, 2020 17:44
Copy link
Member

@DSpeichert DSpeichert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this called Linux-Webserver? This seems to be very broad tutorial about every aspect of running a server. Maybe it would be better to split it up? game server separately, website separately?

# Getting started
Rent a Ubuntu Server 18.04 or higher from a trusted hosting company such or install for the sake of learning experience Ubuntu Server 18.04 or higher in VirtualBox.

Once you're set we will start by accessing our server. If you're on windows you should get putty(https://www.putty.org/), if you're on macOS or Linux you can use the terminal which is standard available. With putty just follow the screen ( insert your domain/ip-address and click ok ) for macOS and linux users type:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be safer to recommend using Windows Subsystem for Linux as a native SSH client or simply installing SSH client via Windows features.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you have a point indeed! WSL is safer, but putty would be easier for new people. It would be your call what you would like to be better in there.

```bash
sudo apt install nginx php-fpm mariadb-server -y
```
The installation process is now triggered.When this is finished we will install phpmyadmin to handle our database server (which is mariadb)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space, capitalization (MariaDB)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the part as its not necessary to be there.

```
The output will be looking something similar as this (I am using ubuntu 19.10 here which uses php version 7.3 as default. If you're running on a server you most likely run on 18.04 lts or with the newest version 20.04 lts):

![alt text](https://worldofcoding.net/github-img/otland-gitbook/phpversion.png "phpversion")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this website? It should ideally be just text, let's avoid images of text.


![alt text](https://worldofcoding.net/github-img/otland-gitbook/phpversion.png "phpversion")

Second we want to do is enabling php in our nginx server and setting the configuration just as we want. So we will be going to edit our nginx config. Now we need to install a command line text editor called "vim". After that we installed it we will directly open the configuration file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nano is easier than vim but it's just a matter of preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I struggle with nano 🔢

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you know your audience already knows vi, nano is the safe bet. The audience that already knows vi probably wouldn't need this portion of the guide in the first place.

Though, if you are aiming for the neophytes and you know they are using modern systems, such as Ubuntu 20.04LTS, micro should take precedence over nano.

sudo apt install vim -y && sudo vim /etc/nginx/sites-available/default
```

Now sit straight up and read carefully on what we're going to do. I am going to give you a few options in the configuration. Underneath here you will find the default configuration file of nginx. ( I only took the part of the config file we are in need to use and left out all the comments which we do use in this tutorial )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now sit straight up and read carefully on what we're going to do.
While funny, this is meta-text and doesn't actually contribute anything. Let's avoid unnecessary prose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it.

```bash
sudo mariadb
```
![alt text](https://worldofcoding.net/github-img/otland-gitbook/phpversion.png "phpversion")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it.

`sudo vim /etc/nginx/sites-available/phpmyadmin`
```bash
server {
listen 2344;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this port?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just took a random port, can be changed to what you desire.


Git will be used to download the source code, and CMake will be used to generate the build files.
```bash
sudo apt-get install git cmake build-essential liblua5.2-dev libgmp3-dev libmysqlclient-dev libboost-system-dev libboost-iostreams-dev libboost-filesystem-dev libpugixml-dev libcrypto++-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

mkdir build && cd build
cmake ..
```
## Build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to leave one empty line above every header.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@@ -0,0 +1,201 @@
# Getting started
Rent a Ubuntu Server 18.04 or higher from a trusted hosting company such or install for the sake of learning experience Ubuntu Server 18.04 or higher in VirtualBox.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, WSL could be used on Windows as well instead of VirtualBox.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using WSL as server would cause many people with a lot of issues. I been through issues with it as well. Giving more options would give people a better feeling for themselves to pick the way they find to use the best. VirtualBox is given as example since its great for new people. When you've made a mistake you delete the VM and create a new one and start over. We are making guides for people which has no knowledge.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VirtualBox also empowers them with advanced solutions, such as using USB passthrough to a separate Wifi dongle. This ensures Windows is not interfering, in any manner whatsoever, with the TFS servers internet connectivity. An important elimination of complexity in the typical diagnosing self-hosted login issues thread in the support forum. Though admittedly outside the scope of this particular guide.

Still, if both options are presented, VirtualBox should be preferred, because it presents the full native Linux environment. And if there is an advanced guide on the matter they follow later, it would definitely introduce them to VBox's seamless mode, which is a game changer for really experiencing the power of a Linux desktop environment without leaving their comfortable safety of Windows. Call it optimism for the best result.

@Ralumbi Ralumbi requested a review from DSpeichert May 3, 2020 19:48
@Ralumbi Ralumbi changed the title Linux-Webserver setup Running your first OT on Ubuntu Linux May 3, 2020
Copy link
Member

@DSpeichert DSpeichert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing technical documentation isn't easy, here's another portion of suggestions to keep it correct, concise and professional.

# Getting started
Rent a Ubuntu Server 18.04 or higher from a trusted hosting company or install for the sake of learning experience Ubuntu Server 18.04 or higher in VirtualBox.

Once you're set we will start by accessing our server. If you're on windows you should get putty(https://www.putty.org/), if you're on macOS or Linux you can use the terminal which is standard available. With putty just follow the screen ( insert your domain/ip-address and click ok ) for macOS and linux users type:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lot's of typos:

  • PuTTY not putty
  • No spaces inside ( and )
  • IP address not ip-address
  • click "OK" not click ok
  • Linux not linux

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use a link to PuTTy instead

`username example => root
domain/ipaddress example => yourdomain.com or 127.0.0.1`

Now you will be prompted for your password (if in putty you will be prompted for the password as soon you click on Open) Insert your password and presh enter (you will not see what you type, so make sure you type your password in the right order). Now we are in our server :)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PuTTY misspelled
Missing full stop at the end of sentence.
presh -> press

Now you will be prompted for your password (if in putty you will be prompted for the password as soon you click on Open) Insert your password and presh enter (you will not see what you type, so make sure you type your password in the right order). Now we are in our server :)

## Update and Upgrade the system
The first thing we will do is updating our Ubuntu Server with the following command
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

command: (colon missing)


Now you will be prompted for your password (if in putty you will be prompted for the password as soon you click on Open) Insert your password and presh enter (you will not see what you type, so make sure you type your password in the right order). Now we are in our server :)

## Update and Upgrade the system
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline after header

```bash
sudo apt update && sudo apt upgrade -y
```
We are using 'sudo' since I do not know if you're running as root user or as regular user. When you're logged in as regular user. No problem! Just enter your password when the terminal asks for your password. With the command above you will update the connected repository's the server is connected to and when the server is done updating the repository's it will directly upgrade all the packages which were updated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something here doesn't flow/make sense.
The guide should specify whether to work as root or regular user.


Second we want to do is enabling php in our nginx server and setting the configuration just as we want. So we will be going to edit our nginx config. Now we need to install a command line text editor called "vim". After that we installed it we will directly open the configuration file.
```bash
sudo apt install vim -y && sudo vim /etc/nginx/sites-available/default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to chain commands, just put them in two separate lines.
Explaining what && does is unnecessary here, so let's just not use it.

sudo apt install vim -y && sudo vim /etc/nginx/sites-available/default
```

I am going to give you a few options in the configuration. Underneath here you will find the default configuration file of nginx. ( I only took the part of the config file we are in need to use and left out all the comments which we do use in this tutorial )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
I am going to give you a few options in the configuration. Underneath here you will find the default configuration file of nginx. ( I only took the part of the config file we are in need to use and left out all the comments which we do use in this tutorial )
Below you will find the default configuration file of nginx (only relevant parts are shown, comments ommitted).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid first-person narrative ("I did"), author is not important here.


## Changing the web-root

We can change the 'root' directory of the website folder, if you're only using your server as root leave it in '/var/www/html'. When using it as for example 'john' you can change the directory to your default directory when you come when you login which is: '/home/john' in the default directory of john you can do 'mkdir www' to create a directory for the website and set: '/home/john/www' on line '5' instead of '/var/www/html'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Linux, the term in use is directory, not folder. Since this is technical documentation, you have to try to use proper terms.


I am going to give you a few options in the configuration. Underneath here you will find the default configuration file of nginx. ( I only took the part of the config file we are in need to use and left out all the comments which we do use in this tutorial )

## Changing the web-root
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this section is not "necessary" as most people and guides do indeed keep the web root in /var/www/ / /var/www/html/ and rarely ever people need to put more than one "website" on a VPS for OTS.


Directly copy'd from the TFS github wiki(https://github.com/otland/forgottenserver/wiki/Compiling-on-Ubuntu):

## Install the required software
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content from this line is duplicated - it's already documented in the TFS wiki, which we might move over to the OTS Guide.

It's not wrong but it will quickly get outdated. It's best to link to the wiki which is kept up to date.
In fact, the package list is already outdated below and the instructions wouldn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants