Quick questions lazarus / 1-Linux ---------------------------------------------------------------------- egsuh · 2024-09-19 10:10 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 · 2024-09-19 10:14 Server is Rocky 9. ---------------------------------------------------------------------- Zvoni · 2024-09-19 10:29 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 ---------------------------------------------------------------------- egsuh · 2024-09-19 10:44 QuoteWhy 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 · 2024-09-19 10:54 Focussing on the three questions asked, since I assume that you have an adequate "why". Quote from: egsuh on September 19, 2024, 12:10:27 pm- 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. QuoteIf 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 ---------------------------------------------------------------------- Zvoni · 2024-09-19 10:56 Quote from: egsuh on September 19, 2024, 12:44:51 pmI'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 QuoteI'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" QuoteCurrently 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 Quote from: MarkMLl on September 19, 2024, 12:54:14 pmYou'd make life /far/ easier for yourself if you cut your teeth on a local system... MarkMLlFood for thought, since Mark and I basically tell the same ---------------------------------------------------------------------- dbannon · 2024-09-19 11:05 Quote from: egsuh on September 19, 2024, 12:10:27 pmI'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.  Quote from: egsuh on September 19, 2024, 12:10:27 pm- 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.  Quote from: egsuh on September 19, 2024, 12:10:27 pm- 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 ---------------------------------------------------------------------- MarkMLl · 2024-09-19 11:14 Quote from: Zvoni on September 19, 2024, 12:56:34 pmBottom 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 ---------------------------------------------------------------------- Zvoni · 2024-09-19 11:20 Quote from: dbannon on September 19, 2024, 01:05:54 pmProbably 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) QuoteA 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.... ---------------------------------------------------------------------- egsuh · 2024-09-19 11:28 @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 · 2024-09-19 11:32 Quote from: MarkMLl on September 19, 2024, 01:14:15 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 ... Quote from: MarkMLl on September 19, 2024, 01:14:15 pmUpdated: 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 ---------------------------------------------------------------------- Zvoni · 2024-09-19 11:57 Quote from: egsuh 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. 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 ---------------------------------------------------------------------- MarkMLl · 2024-09-19 12:10 Quote from: dbannon on September 19, 2024, 01:32:53 pmQuote from: MarkMLl on September 19, 2024, 01:14:15 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. ---------------------------------------------------------------------- alpine · 2024-09-19 12:58 @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. ---------------------------------------------------------------------- TRon · 2024-09-19 13:47 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. ---------------------------------------------------------------------- Zvoni · 2024-09-19 13:56 Quote from: TRon on September 19, 2024, 03:47:01 pmAs 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. Correct. Especially considering you can get real bargains buying second hand from Companies that do "upgrades". I still remember getting 4 DELL OptiPlex 3010 including RAM-Modules, Harddisks etc. for under 100 € total. Yeah, definitely NOT the Formula 1 of Hardware, but during developing its not about connection-speed, it's about "stability" resp. "bug- free". As i wrote above: I didn't care that those Queries against MySQL on FreeBSD took some 20 seconds. i was interested if it works! Install whichever OS is your target, install nginx, whatever.... Full steam ahead. It doesn't matter, if "your" such local Webserver takes 20 seconds to display a Page, it's about if it shows the correct stuff ---------------------------------------------------------------------- MarkMLl · 2024-09-19 16:24 Quote from: Zvoni on September 19, 2024, 03:56:29 pmI still remember getting 4 DELL OptiPlex 3010 including RAM-Modules, Harddisks etc. for under 100 € total. Running on a 7020 for which I paid a bit more, particularly after disc upgraid plus extra USB, media slots to support preparing SD-Cards etc. However, while there is a tendency to say "you only need an old machine for Linux" the reality, particularly if you're running a half- competent desktop environment, is much less forgiving. This machine has 32Gb RAM and is on the good side of adequate, it replaced a machine with 4Gb which- after having the latest Debian installed- was very much inadequate. /But/ the old 4Gb machine is now driving a 3D printer and various other things quite happily: it has a desktop installed but almost everything can be done remotely (HTML-based remote control). In all probability a system with a web server and WebMin (or similar, i.e. again using HTML-based remote control) would again be adequate for a modest amount of traffic, and if it was adequate for WebMin it would be more than adequate for SSH in the hands of an experienced user. And subject to space considerations plus the provisioning of screens etc., at this stage having a "real" machine is going to be far more use than a VM etc. because there would be far less risk of contention for "well known" network ports, strange routing configurations and so on. Just my 2d-worth. But I've been doing this stuff for a long time. MarkMLl