Recent

Author Topic: Quick questions  (Read 1023 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1489
Quick questions
« on: September 19, 2024, 12:10:27 pm »
I'm first to Linux. I hosted Linux server which runs as virtual machine (AFAIK) at $30 for one month.  But I have never used Linux before. Attached image is what I have done with Linux for 5 minutes after connecting via PuTTY.

I have found some web pages that explain Linux commands, and I'll have some time to read them. But before that, I'd like to get some quick questions so that not to waste time on searching for not possible solutions.

- Can I run a GUI interface on the server side? If not, how can I use Internet, e.g. for download Lazarus?
- Are there any remote connection tool to use from Windows client (GUI would be better) other than PuTTY?

I know these are not proper questions to ask here. I only need a quick grasp on what I have to do to run a small webserver on Linux. It will take too long to read books and manuals on Linux first.

My target is to run nginx, FastCGI webserver program written in Lazarus, plus Firebird database.

Thanks in advance.

egsuh

  • Hero Member
  • *****
  • Posts: 1489
Re: Quick questions
« Reply #1 on: September 19, 2024, 12:14:37 pm »
Server is Rocky 9.

Zvoni

  • Hero Member
  • *****
  • Posts: 2738
Re: Quick questions
« Reply #2 on: September 19, 2024, 12:29:15 pm »
Maybe a stupid question: Why are you on an external (Linux)-Server?
Install VirtualBox on your (Windows?)-Dev-Machine, install a Linux-Server as a guest in VirtualBox, and presto : You have a setup at home.

As to your Questions: No, you can't run a GUI on your external (Linux)-Server (at least from what i can see in your screenshot). What would be the purpose of it?
Why would you download Lazarus on your external Server?!?!?!

Alternative to PuTTY: https://remmina.org/remmina-on-windows/
If you don't want to deal with WSL, setup a Linux-Guest in VirtualBox, and use Remmina there natively

btw: On this (or any, in fact) Linux-Server: "tmux" is a must-have
https://en.wikipedia.org/wiki/Tmux
« Last Edit: September 19, 2024, 12:36:05 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

egsuh

  • Hero Member
  • *****
  • Posts: 1489
Re: Quick questions
« Reply #3 on: September 19, 2024, 12:44:51 pm »
Quote
Why are you on an external (Linux)-Server?

I'm assessing the possibility of using it as a web-server. Maybe I would be able to copy compiled binary file to the server, and via some setups, I might be able to use it as a web-server.
I'm checking the feasibility of compiling web-server program on the server itself. In order to do that, I need to install Lazarus (or FPC?) on the server.

Currently I'm hosting a Windows server (Server 2019), which costs about $130 per month. Linux server is less than $30 (Of course, access rights would be different. Windows server is a stand-alone server. I can connect to it via Remote Desktop and do anything. They say Linux server is a cloud-based service.)  If I'm confident with Linux server, I can host  a stand-along Linux server (it costs about $30 less than Windows server for hosting).

So, I'm looking for quick answers first --- this is possible, and that is not, etc. as I do not know anything for now.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8013
Re: Quick questions
« Reply #4 on: September 19, 2024, 12:54:14 pm »
Focussing on the three questions asked, since I assume that you have an adequate "why".

- Can I run a GUI interface on the server side?

Broadly speaking that will depend on what's been provided to you by the owner of the machine on which you're running. I'll come back to that.

Quote
If not, how can I use Internet, e.g. for download Lazarus?

wget, curl and so on. Possibly git once you've got the relevant development tools in place.

Quote
- Are there any remote connection tool to use from Windows client (GUI would be better) other than PuTTY?

If the system provides SSH then PuTTY is probably the most-mature option. Teraterm is an alternative, but it might by now be mature to the point of senility.

Now going back to the start: what sort of service has been sold to you? Do you /only/ have SSH (or /gasp/ Telnet) or does it also have all the X11 stuff installed? In the latter case I'd expect that the system owner had it set up in a way that allowed you do get access via a Display Manager (note: term-of-art) to a Display Manager (note: term-of-art) hence some form of desktop. If the various X11 support libraries are installed but you do not have access to a desktop I'd expect that you could tunnel access to a GUI-oriented program such as Lazarus via SSH or in-extremis VNC etc.: there's 30 years' worth of documentation for this sort of thing floating around elsewhere (i.e. it's not /our/ problem) but the bottom line is that you ought to be asking the system owner.

You'd make life /far/ easier for yourself if you cut your teeth on a local system...

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Zvoni

  • Hero Member
  • *****
  • Posts: 2738
Re: Quick questions
« Reply #5 on: September 19, 2024, 12:56:34 pm »
I'm assessing the possibility of using it as a web-server. Maybe I would be able to copy compiled binary file to the server, and via some setups, I might be able to use it as a web-server.
tentative YES to "copy binary to server": Depends if you use any "external" libraries from within your fpc-code


Quote
I'm checking the feasibility of compiling web-server program on the server itself. In order to do that, I need to install Lazarus (or FPC?) on the server.

No, you don't. i've described above the "usual" way (Virtual machine) you would do something like that.
1) You develop your FastCGI on your Windows-Machine and crosscompile, and copy/paste the binary to the server
2) You develop your FastCGI on your "virtual" Linux-Machine, and copy/paste the binary to the server

and for first testing, you setup a Linux-Server in a separate instance of your VM

e.g. I had to develop a Windows-client which accessed a MySQL-Database.
Since i didn't want to spoil my Windows-machine with any MySQL-stuff except the client-libs, i just installed a FreeBSD-Guest in my VirtualBox (could have also used Linux), installed THERE the MySQL-Server, setup any necessary Network-Stuff in Virtual-Box, and then it was just "full steam ahead"


Quote
Currently I'm hosting a Windows server (Server 2019), which costs about $130 per month. Linux server is less than $30 (Of course, access rights would be different. Windows server is a stand-alone server. I can connect to it via Remote Desktop and do anything. They say Linux server is a cloud-based service.)  If I'm confident with Linux server, I can host  a stand-along Linux server (it costs about $30 less than Windows server for hosting).

So, I'm looking for quick answers first --- this is possible, and that is not, etc. as I do not know anything for now.
Bottom line: Webservers based on any *nix (Linux, Unix) are 99.9999% without "GUI"/Desktop, but 99.9999% commandline via SSH
and don't forget "tmux"..... Saved my behind a few times after losing network-connection during an active SSH-Session

You'd make life /far/ easier for yourself if you cut your teeth on a local system...

MarkMLl
Food for thought, since Mark and I basically tell the same
« Last Edit: September 19, 2024, 01:01:53 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Quick questions
« Reply #6 on: September 19, 2024, 01:05:54 pm »
I'm first to Linux. I hosted Linux server which runs as virtual machine (AFAIK) at $30 for one month.
What, just to get used to Linux ?? As Zvoni said, please look at Virtual Box, any linux you want, a GUI and would cost you nothing.


 
- Can I run a GUI interface on the server side? If not, how can I use Internet, e.g. for download Lazarus?
Possibly, but probably not very well.  From memory (a long time ago) the same place you got putty from also has an xserver ?  Don't be fooled by the term xserver, its something you run on your desktop that connects to the remote server. The remote server does something called X11 forwarding and the X gui display appears on your desktop's window. Does require a very fast connection to be usable. Its most likely the remote server will not allow you to do so for security/bandwidth reasons.

There are other tools as well but they are not built in and, again, unlikely to be available.
 
- Are there any remote connection tool to use from Windows client (GUI would be better) other than PuTTY?

Probably not.  Honestly, if you wish to become a power Linux user, you do need to come to terms with the command line.

So, getting back to Zvoni's answer, Virtual Box, its free, it runs on Windows (I believe) you can install any linux distro you like (and they are also free) and you get your GUI, much faster response, no security worries.

A typical linux install in a VM (Virtual Machine) needs about 20G disk space, if you can give it it two CPUs (but one will work).  To install a linux distro, download a .iso file from the distro's download page, eg my favourite,

https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.7.0-amd64-mate.iso

Its 3Gig and is easy to use, light on resources.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

MarkMLl

  • Hero Member
  • *****
  • Posts: 8013
Re: Quick questions
« Reply #7 on: September 19, 2024, 01:14:15 pm »
Bottom line: Webservers based on any *nix (Linux, Unix) are 99.9999% without "GUI"/Desktop, but 99.9999% commandline via SSH
and don't forget "tmux"..... Saved my behind a few times after losing network-connection during an active SSH-Session

There's various GUI/TUI systems which are intended to provide a relatively-friendly configuration environment, but they almost invariably rely on infrastructure set up by the system provider. I can't off the top of my head remember examples, but the bottom line is that the system provider might have his own ideas on "control panel" or "dashboard" provision and you're stuck with it.

The bottom line is that web servers are not themselves GUI-oriented programs, and unless some sort of dashboard has been provided you're on a steep learning curve of configuration files, restarting daemons and so on.

An alternative to tmux is the GNU screen program, I'd expect a competent distro to provide at least one of those.

The bottom line is that you've apparently got root access, so you can install whatever you want (and expose X11 to the Internet, at which point you'll get hacked withing seconds). As Zvoni says, set yourself up a local system and do your learning on that. Better, set yourself up two: one mimicking the remote server, and another on which you've got development tools (which will likely include stuff that you /don't/ want on the server).

Updated: the dashboard I was thinking of was Webmin. Bottom line appears to be that you've got root access so subject to the site owner's firewall/rack/VM/etc. policies you've got full control.

MarkMLl
« Last Edit: September 19, 2024, 01:19:23 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Zvoni

  • Hero Member
  • *****
  • Posts: 2738
Re: Quick questions
« Reply #8 on: September 19, 2024, 01:20:57 pm »
Probably not.  Honestly, if you wish to become a power Linux user, you do need to come to terms with the command line.

So, getting back to Zvoni's answer, Virtual Box, its free, it runs on Windows (I believe) you can install any linux distro you like (and they are also free) and you get your GUI, much faster response, no security worries.
It does. VB is available for Windows

SideNote: Never forget the VirtualBox Guest-Extensions (or whatever they are called)

Quote
A typical linux install in a VM (Virtual Machine) needs about 20G disk space, if you can give it it two CPUs (but one will work).  To install a linux distro, download a .iso file from the distro's download page, eg my favourite,

https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.7.0-amd64-mate.iso

Its 3Gig and is easy to use, light on resources.

Davo

Or even use a ready made image: https://www.linuxvmimages.com/images/virtualbox/

Though in that case you WILL suffer the "TASTE" of the user who set up those images.
Nevermind probably learning nothing about Linux

@Mark,
Yes. Correct for "Dashboard".
I always forget those blasted things....
« Last Edit: September 19, 2024, 01:25:59 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

egsuh

  • Hero Member
  • *****
  • Posts: 1489
Re: Quick questions
« Reply #9 on: September 19, 2024, 01:28:48 pm »
@Zvoni, MarkLui, dbannon,

Really thank you for your replies.

Temporary conclusions:

- I can compile my Lazarus project on Windows machine targeting Linux binary.
- Setting up the remote server can be done via ssh in commandline mode.

So assuming that I can setup Firebird and Apache/nginx on the Linux server, I make a binary file of my webserver on Windows machine and copy it to the server. This is the mininum that I can do.

- Additionally I can set-up VM and do the programming and testing there.
- I found mentions on Gnome, etc. on web, but it seems not very easy to use in my case based on your replies.

These are good enough for now. It would have costed a few weeks to reach those conclusions by myself.  Thanks again.


dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Quick questions
« Reply #10 on: September 19, 2024, 01:32:53 pm »
.....and expose X11 to the Internet, at which point you'll get hacked withing seconds).
No, generally, you would tunnel your xsession over ssh. From memory, there were tools in the putty stable to do so on Windows. Trivial on Linux.

Its possible to tunnel vnc too I believe, don't know ...

Updated: the dashboard I was thinking of was Webmin. Bottom line appears to be that you've got root access so subject to the site owner's firewall/rack/VM/etc. policies you've got full control.

Yes, but sooner or later you will need to get down and dirty with the command line. And if you put that off, installing more and more work-arounds, you will pay a price.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Zvoni

  • Hero Member
  • *****
  • Posts: 2738
Re: Quick questions
« Reply #11 on: September 19, 2024, 01:57:05 pm »
@Zvoni, MarkLui, dbannon,

Really thank you for your replies.

Temporary conclusions:

- I can compile my Lazarus project on Windows machine targeting Linux binary.
- Setting up the remote server can be done via ssh in commandline mode.

So assuming that I can setup Firebird and Apache/nginx on the Linux server, I make a binary file of my webserver on Windows machine and copy it to the server. This is the mininum that I can do.

- Additionally I can set-up VM and do the programming and testing there.
- I found mentions on Gnome, etc. on web, but it seems not very easy to use in my case based on your replies.

These are good enough for now. It would have costed a few weeks to reach those conclusions by myself.  Thanks again.
To summarize:
You're coming from Windows and used to "Click here and there, and something will happen"
Right, THERE are "GUI"-Helpers, but as Dave and Mark said: Get used to the CLI and everything it entails, because not every Server-Provider will give you a "Windows-Friendly" Interface.

For testing: Use a virtual machine locally (VirtualBox) to get used to Linux, and in case of your Webserver: How to setup daemons (=Service in Windows-Speak) from the commandline.
When everything runs as expected, THEN look for a Provider to rent a Server
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

MarkMLl

  • Hero Member
  • *****
  • Posts: 8013
Re: Quick questions
« Reply #12 on: September 19, 2024, 02:10:43 pm »
.....and expose X11 to the Internet, at which point you'll get hacked withing seconds).
No, generally, you would tunnel your xsession over ssh. From memory, there were tools in the putty stable to do so on Windows. Trivial on Linux.

Its possible to tunnel vnc too I believe, don't know ...

I definitely wasn't intending to suggest that it was a good idea (and in practice it might be blocked by the site owner's firewall). Basically, you can tunnel just about anything (certainly TCP) over SSH: even things of interest only to the weird minority such as IRC **

MarkMLl

** I'm not trying to get at anybody there. I'm just saying that I /have/ used it for IRC to monitor traffic either related to our ISP or to a project's development... might have been Hurd, but in any event it was clear it wasn't going anywhere. By and large it was painless, and if necessary I could probably find my notes. I might possibly also have looked at tunneling VNC, either predating significant encryption of its own or with the intention of minimising what was exposed by a firewall... been a long time.
« Last Edit: September 19, 2024, 02:15:08 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

alpine

  • Hero Member
  • *****
  • Posts: 1297
Re: Quick questions
« Reply #13 on: September 19, 2024, 02:58:52 pm »
@egsuh
I do my Lazarus development on a desktop with a full blown Linux (Ubuntu 20.04) machine, then I just drop the binary on the target (Debian 12) using mc over "Shell link...", (BTW scp can do the same) and then I debug remotely with the gdbserver. Works like a charm. The only inconvenience is that gdb debugger is somewhat inferior to FpDebug.

No need to burden the target with the X+gnome or whatever graphical stuff.

The development can be done in the same way with Win VirtualBox hosting a Linux guest.
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: Quick questions
« Reply #14 on: September 19, 2024, 03:47:01 pm »
As an alternative to using a virtual environment to run Linux (which is pretty good advise) you could also opt of running linux on a separate machine in you (own) LAN to get a more 1:1 experience (or run the VM on another machine)

Although perhaps not the most efficient solution (support is usually limited) it is pretty cheap to get f.e. a banana pi for a couple of bucks and install Linux on it. There are also  SBC's that have a x86 processor these days (instead of arm/risc).

It is perhaps a bit more convoluted but you would be able to get your hands dirty all the way and doing so with a big splash.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

 

TinyPortal © 2005-2018