#Linux VPS Server

377 messages · Page 1 of 1 (latest)

shrewd ibex
#

By "a screen" do you mean a GUI?

fiery void
#

Yes, a ui

shrewd ibex
#

You'll want to get a Desktop Environment

fiery void
#

Ok wait, can I start from the beginning

#

What is the difference between a cloud server and a vps?

#

This is my cloud server, that works perfectly after I ran those commands

shrewd ibex
#

So, you have some options to pick from. Here are some of the more popular ones:

  • KDE Plasma: What I use, and it allows you to customize everything, but it might be a little more resource intensive.
  • GNOME
  • XFCE: Good for light memory/resource usage.
  • LXDE: Looks pretty basic but is the best for super lowend systems.
  • Cinnamon
fiery void
#

I'm just trying to host some websites, webmail and a game server

#

Not for personal use, not for my computer

shrewd ibex
#

I'd actually recommend you don't get a Desktop Environment unless you truly want it, then, as it'll use more memory and probably more CPU

#

And a bit more storage

fiery void
#

But it's so complicated with this console

grand hamlet
#

Well

#

with a screen

shrewd ibex
#

I assume you're using SSH for the command line?

grand hamlet
#

you still run the commands in a terminal

fiery void
#

What is SSH?

grand hamlet
#

so its basically the same

fiery void
#

Yes, but I can easily move the files around and stuff

shrewd ibex
#

SSH is run on port 22, and it's what allows you to connect to your VPS or dedicated server to run commands

grand hamlet
#

you could use ftp for that

shrewd ibex
#

With encrypted traffic

#

(Port 22 can also be used for SFTP though)

#

@grand hamlet post please

fiery void
#

I don't know I bought it from ionos

shrewd ibex
#

Are you using an application like Termius or PuTTy to access your VPS?

fiery void
#

No, I am accessing it from a web page, after I clicked access remote console

grand hamlet
#

ah, kvm

shrewd ibex
#

By the way, what did you send that got deleted?

fiery void
#

Not kvm

shrewd ibex
#

Oh

fiery void
grand hamlet
#

well vnc

fiery void
#

Okay so the thing is

shrewd ibex
fiery void
#

This nice one says kvm

#

The vps says remote console

#

This is how I open the nice one, kvm console

#

This is how I open the vps,

shrewd ibex
#

So, do you ultimately want to have a DE at the expense of more CPU/RAM/storage usage?

#

If you do, that's alright

fiery void
#

Is it easy to setup a webmail, few websites and a game server without it?

shrewd ibex
#

It's not too difficult

fiery void
#

I can use an FTP like @grand hamlet said?

shrewd ibex
#

Yes, you can

fiery void
#

Okay wait, is a VPS a good selection to host what I want to?

shrewd ibex
#

I'd actually recommend SFTP since it can run on the same port (22) as SSH anyways and it's encrypted

shrewd ibex
#

For hosting webmail and a few websites and a game server, yes, a VPS is a good choice.

fiery void
#

Okay

#

Is winscp good to access it?

shrewd ibex
#

A VPS will give you more control than getting hosting plans for this kind of stuff.

grand hamlet
#

you can choose, winscp or filezilla

shrewd ibex
#

I recommend WinSCP ^

grand hamlet
#

I prefer filezilla, but thats just personal preference

fiery void
#

Okay I like winscp anyways

shrewd ibex
#

Perfect

fiery void
#

How would I delete everything I just installed

grand hamlet
#

reinstalling the OS would be the easiest

fiery void
grand hamlet
#

depends on what game you're going to run

grand hamlet
fiery void
#

It's just an io game, a basic websocket server

grand hamlet
#

(since you're not with pebble)

#

they might have some docs somewhere

fiery void
#

Pebble is so expensive for vps 😭

#

I still use their web service though :)

grand hamlet
fiery void
#

Okay, and do you have a good tutorial on how I can access it via ftp? I can google one if not

grand hamlet
#

yeah you'll need to google that aswell

fiery void
#

Okay thank you so much

#

Is it too difficult to set up what I want to?

fiery void
#

I don't remember what I did though

#

It's like a whole computer

fiery void
#

Thank you guyssssssssss arpeachcatcandy starpink
@shrewd ibex @grand hamlet

shrewd ibex
#

No problem

#

Feel free to let me know if you need anything else btw

fiery void
fiery void
#

@grand hamlet can you help me asap please 😭

#

I did pm2 logs now I can't get back to writing

#

It's stuck

#

ctrl+C :)

fiery void
rapid warren
fiery void
#

Mine is a vps, much lower but I got half of everything I need setup in 10 mins

rapid warren
fiery void
rapid warren
#

oh i see

#

if you need help @fiery void im willing to help

#

i know a lot of tips and tricks that will make your life better

fiery void
#

@rapid warren Are you good with npm and node in linux servers?

stone raftBOT
#

@fiery void, you just advanced to level 14 !

rapid warren
#

what specifically are you talking about

fiery void
#

Look

#

Server.js

const express = require("express");
const app = express();

app.get("/servers/server1", (req, res) => {
  res.json({ message: "Hello from server1" });
});

app.listen(3000, () => {
  console.log("API server is running on port 3000");
});

and files

fiery void
rapid warren
#

It's complaining about a module not being found

#

you might be missing a dependency

fiery void
#

Yup, which is probably express since it's the only thing

rapid warren
#

try that

fiery void
#

Did, 4 times

rapid warren
#

nothing?

fiery void
#

No

#

Same error

#

Express is also in node_modules, and package.json

rapid warren
#

npm list -g

fiery void
#

Don't think it's global package

#

I get the same error with my bots too

#

Could I have setup node/npm wrong on ubuntu?

#

@shrewd ibex You know anything about it?

shrewd ibex
#

a little busy rn and doing other things so my answers might not be the best, but try running npm with no arguments and seeing what happens

#

and then try running node with no arguments

rapid warren
#

so its not installed

#

npm install -g express --save

fiery void
fiery void
shrewd ibex
shrewd ibex
fiery void
rapid warren
fiery void
#

npm i express

#

4 times

shrewd ibex
#

i think you'd remove the express as well

rapid warren
#

you can delete it

#

but see if it works

fiery void
#

Okay

shrewd ibex
#

and frank has a good point

#

you can just remove the package anyways

fiery void
#

Okay I will try it

shrewd ibex
#

unless it's malware but that's a whole different concern anyways

#

and 99% chance it isn't and you'd probably know

fiery void
#

:)

#

This site can't be reached @rapid warren

rapid warren
#

firewall

fiery void
#

Sure?

rapid warren
#

can also attempt using curl -I 127.0.0.1:3000

fiery void
#

is that i or l

#

Thank you @shrewd ibex

shrewd ibex
#

is it running

fiery void
#

No

#

Failed to connect

#

Oh wait

shrewd ibex
#

aren't you using pm2 or smth

fiery void
#

Also one more thing

shrewd ibex
#

if you're using pm2 type pm2 list

fiery void
#

Why is the id still increasing when I deleted the other one?

shrewd ibex
#

because that's how it works until you reboot afaik

#

Okay

#

So it's a firewall issue

#

Are you using a reverse proxy to put it on port 80/443

#

(e.g. nginx)

fiery void
#

This is all I have

shrewd ibex
#

Ok but

fiery void
#

Unless the server does by default, no

#

This is what it says in the panel

shrewd ibex
#

Okay, so you are putting :3000 after the IP/domain in your browser, right?

fiery void
#

This is what I did

shrewd ibex
#

Are you using firewalld (firewall-cmd), ufw (ufw), or something else?

fiery void
#

Not that I run

shrewd ibex
#

You don't use either?

fiery void
#

No

#

Oh, maybe ufw cause I set up ftp

shrewd ibex
#

Run firewall-cmd and see if it's a command

fiery void
#

Not command

shrewd ibex
#

sudo apt install firewalld

#

Wait not yet

fiery void
#

ufw is command

shrewd ibex
#

Don't run that

#

If you set up ufw

#

Because you don't want both

#

Ok so

#

You'll want to use ufw

fiery void
#

okay

shrewd ibex
#

Unfortunately I'm a lot more familiar with firewall-cmd than ufw, but I'll try my best to help you out

#

Run sudo ufw allow 3000, followed by sudo ufw allow 3000/tcp and screenshot the output

fiery void
#

Rules updated

#

Rules updated (v6)

shrewd ibex
#

Good

#

Run sudo ufw status verbose

#

Hopefully it'll return a list of numbers (ports)

fiery void
#

Inactive

#

Status: inactive

shrewd ibex
#

sudo ufw enable

#

Then run sudo ufw status verbose again

#

While you're at it, do you want to use this for webhosting?

fiery void
#

Ye, to host like 6 websites

shrewd ibex
#

Run these commands then:
sudo ufw allow 80
sudo ufw allow 80/tcp
sudo ufw allow 443
sudo ufw allow 443/tcp

#

This will allow ports 80 (http) and 443 (https)

#

On TCP

fiery void
#

Okay did that :)

shrewd ibex
#

Also, are you familiar with setting up nginx?

fiery void
#

Kind of

rapid warren
#

i would not suggest doing it that way

shrewd ibex
#

Do you have an idea as to how to set it up?

shrewd ibex
rapid warren
#

that exposes it to the entire internet and therefore vulnerabilities either in your code or the modules used ,etc

fiery void
#

Installing it?

rapid warren
#

i always block off HTTPS traffic to cloudflare's subnets only

shrewd ibex
#

Yeah but I don't think it's that big of a concern

#

It's ports 80 and 443

rapid warren
#

thats even worse

#

always force traffic through cloudflare if you can

fiery void
#

I was goign to use cpanel or something similar

rapid warren
#

all im saying is only permit cloudflare to communicate on HTTP/S protocols

shrewd ibex
#

You were going to set up cPanel yourself?

rapid warren
#

firewall-cmd --add-rich-rule='rule family="ipv4" source address="103.21.244.0/22" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="103.21.244.0/22" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="103.22.200.0/22" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="103.22.200.0/22" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="103.31.4.0/22" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="103.31.4.0/22" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="104.16.0.0/12" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="104.16.0.0/12" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="108.162.192.0/18" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="108.162.192.0/18" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="131.0.72.0/22" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="131.0.72.0/22" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="141.101.64.0/18" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="141.101.64.0/18" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="162.158.0.0/15" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="162.158.0.0/15" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="172.64.0.0/13" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="172.64.0.0/13" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="173.245.48.0/20" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="173.245.48.0/20" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="188.114.96.0/20" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="188.114.96.0/20" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="190.93.240.0/20" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="190.93.240.0/20" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="197.234.240.0/22" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="197.234.240.0/22" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="198.41.128.0/17" port port="8080" protocol="tcp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="198.41.128.0/17" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="2.56.8.123/32" port port="8080" protocol="udp" accept'
firewall-cmd --add-rich-rule='rule family="ipv4" source address="2.56.8.123/32" port port="8080" protocol="tcp" accept'

#

thats not for ubuntu its for centos/rhel

#

for ufw i think its

fiery void
#

Ok I can't copy into the console btw

rapid warren
#

ufw allow port 8080 from 103.21.244.0/22

#

etc

shrewd ibex
#

It's just that firewalld is primarily used by centos/rhel

rapid warren
#

windows terminal works

shrewd ibex
#

You can technically use firewalld on Ubuntu though because at the end of the day it modifies iptables, it's just a bad idea to use it in combination with ufw

fiery void
#

That's another struggle 🙄

fiery void
shrewd ibex
#

It makes things easier

fiery void
#

I was just copying commands my brother sent me :)

#

Is cpanel that hard to setup?

shrewd ibex
#

So, you can choose to make it so only Cloudflare can use ports 80 and 443, but you realistically don't have to

fiery void
#

I'd prefer it since it's much safer

shrewd ibex
#

Because at the end of the day, nothing bad will be likely to happen to you

#

Alright

#

You can do that then

fiery void
#

But I have around 300 daily players

shrewd ibex
#

Ah

rapid warren
shrewd ibex
#

I thought you had a much smaller userbase

fiery void
#

I'm pretty sure they will find any way to breach

rapid warren
#

and you shouldn't do it - its a bad practice and will get you in trouble later

shrewd ibex
fiery void
shrewd ibex
#

150k players?

fiery void
shrewd ibex
#

Damn

shrewd ibex
#

So I assume you can just allow 80 and 443 on only the IPs he gave, as long as you can verify those are Cloudflare's IP addresses

fiery void
#

There is a package called cloudflare-ufw lol

shrewd ibex
#

Never heard of it

#

It's available through apt?

fiery void
#

Yes it's on github lol

shrewd ibex
#

¯_(ツ)_/¯

fiery void
#

It's fine anyways, that's not that long

shrewd ibex
#

If you think it's a good idea to install it, then go for it, but make sure it's safe first

fiery void
#

Is this what every web developer does??

shrewd ibex
#

If you know how to read the code it's written in, do that

shrewd ibex
#

Knocking on wood before I jinx that

fiery void
#

:))

#

This isn't a minecraft thing by the way

shrewd ibex
#

And it's stable

fiery void
#

Align those to the left

#

Will improve the look by a lot

shrewd ibex
#

Thanks for the feedback, I might do that

#

I'm a web developer, but I am by no means a web designer

#

I am god awful at design

fiery void
#

Noticed :))))

#

I could help in return

#

Great designer here

shrewd ibex
#

Feel free to talk about this with me in #off-topic

fiery void
#

Sure

#

So now, how would I get :3000/servers/server1 to work

fiery void
#

@shrewd ibex I don't understand why I still cannot access it from google

#

3000 is set to allow from anywhere

#

Still says this site can't be reached

rapid warren
#

then you must be behind a WAF

#

i.e using oracle cloud

#

or linode

#

or digital ocean

#

if not then you aren't doing something correctly. it migth be that the application isn't even binding to the public ip and only localhost

fiery void
#

or ionos

rapid warren
#

i dont know if ionos has a waf

fiery void
#

How can I see what it is binding to?

rapid warren
#

netstat -tulnp | grep 3000

fiery void
#

It was working perfectly on my cloud server :/

rapid warren
#

because it probably had the dependencies and everything worked out and didn't have a waf

#

i dont know. there's a few reasons why you might still not be able to access it

#

alright so that doesn't really tell me much, can i ask

#

why are you using this instead of ssh?

fiery void
#

What is ssh?

rapid warren
#

oh boy

fiery void
#

:)

rapid warren
#

i dont know if youre being serious or not

#

thats the problem

fiery void
#

I mean I heard of it, I'm not sure what exactly it is

rapid warren
#

ok so you haven't really touched linux before that much and are strictly just a developer

fiery void
#

100%

#

First time ever using it

rapid warren
#

ok so what you are doing now is more operations side and not really developer side, its helpful to know as a developer but generally speaking its not really a requirement

#

it worked on the cloud server probably because it was already presetup and ready to go

fiery void
#

What do you mean?

rapid warren
#

i work almost completely on the operations side but i'll be honest with you, i'd rather just have you send me the login details and i can get it working for you

fiery void
#

Yes but I am doing this to learn not to get it working haha

rapid warren
# fiery void What do you mean?

it was already a dev environment, you didnt need to hunt down dependencies because that was already done for you, same with the network just working

fiery void
#

I could just ask my brother for a server any size and he would make anything needed

fiery void
rapid warren
#

so right now you need external access to this right

fiery void
#

But ye localhost just worked instantly

rapid warren
#

if you want to learn i can tell you every option you have and what those mean and the ramifications of each

fiery void
#

Well I'm gonna try hosting websites on it so I guess so

#

Okay

rapid warren
#

ok. so if thats your intention, then its probably best to just get you going with the public ip address - generally speaking you should see :::<port> AND 0.0.0.0:<port> (its both ipv6 and ipv4) - the netstat command tells you which port is being used and how (if it was just localhost like it is now or if it was something else)

#

so what i'd recommend at this point given you've tried everything else reasonably possible, you need to code it to specifically bind to 0.0.0.0

fiery void
#

To 0.0.0.0 or to the servers ip?

rapid warren
#

0.0.0.0 for now

fiery void
#

Okay

rapid warren
#

in terms of linux and what this means for utilization - 0.0.0.0 is the wildcard, it will bind to all available ip addresses on any interface

#

generally this is a bad idea but in the context of debugging it would make sense to determine if its a network issue or firewall issue and if so where exactly

fiery void
#

Okay

#

So how should I point it to 0.0.0.0

#

Could you possibly send me a tutorial I could follow @rapid warren ?

rapid warren
#

thats up to the language

#

i dont really know - i would google it though

#

google is your friend

fiery void
#

So is chat gpt 4 :)

shrewd ibex
#

Idk about that one ¯_(ツ)_/¯

fiery void
#

Just had to restart it @rapid warren -_-

rapid warren
#

i dont like rebooting though, you dont learn anything

#

you lost a major opportunity to learn a lot

fiery void
#

ufw restart

#

not the whole vps

#

u need to restart ufw to apply changes

rapid warren
#

thats dumb

#

firewalld you can just do firewall-cmd --runtime-to-permanent

fiery void
#

but my email services wont work

#

i looked online on a port checker

rapid warren
fiery void
#

it says that my email ports are closed

rapid warren
#

or "just restart the service"

#

thats generally for me the last option

fiery void
#

yet on ufw its allowed

#

allowed in and out

rapid warren
#

ufw shouldn't have required a reboot

#

you could've checked iptables directly

fiery void
#

it said only

#

if u add new rules

#

u need to restart it

#

it only takes like 2 seconds to restart

rapid warren
#

dumb. big reason i dont use ufw

#

¯_(ツ)_/¯

fiery void
#

do u hae any idea

#

why my emails wont work?

rapid warren
#

sometimes the provider will block email ports to avoid abuse

#

if you've opened the port and you verified that its opened and you know that it's opened then you need to raise a incident with whoever your provider is

rapid warren
#

that is most commonly the port blocked

fiery void
#

ye it says i need to contact them if i want to open it

rapid warren
#

imagine that

grand hamlet
# fiery void ufw restart

never seen that before, they always apply directly for me iirc, but havent used ufw in quite a time

tidal cargo
#

Just doing ufw allow port opens the port on all protocols immediately

fiery void
tidal cargo
fiery void
#

D:

tidal cargo
#

unless u have extra stuff

fiery void
#

unless i do ufw restart

#

idk man first ever vps