Create a web server using Centos 9 with Google Cloud and Docker

Issues related to applications and software problems and general support
Post Reply
fefe75
Posts: 3
Joined: 2022/05/28 09:34:11

Create a web server using Centos 9 with Google Cloud and Docker

Post by fefe75 » 2022/05/28 09:47:11

Hello everybody,
I have a Linux Centos 9 VM on Google Cloud. I would like to configure this system as a web server to host a dynamic website created in spring boot. I have opened this thread to help with the initial configuration steps because I will be installing all services using Docker.
I did the following:
1.added a 2GB swap partition (my OS only has 600MB of RAM)
2.added a password to centos and root users
I was unable to update the system:

Code: Select all

login as: centos
Authenticating with public key "centos"
Last login: Sat May 28 09:16:16 2022 from 151.82.124.173
[centos@webserver ~]$ apt-get update && apt-get upgrade -y
-bash: apt-get: command not found
[centos@webserver ~]$ locate apt-get
-bash: locate: command not found
[centos@webserver ~]$
You can help me?

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Create a web server using Centos 9 with Google Cloud and Docker

Post by jlehtone » 2022/05/28 11:51:34

The 'apt' is for Debian-based package management. It does not exist in Red Hat's family of distros. The management tool is 'dnf'.
The equivalent of apt-get update && apt-get upgrade -y is dnf --refresh up.

Red Hat documents (the use of) RHEL 9 extensively: https://access.redhat.com/documentation ... se_linux/9
The CentOS Stream 9 is a preview, a development branch for RHEL 9, so most of that documentation applies.

You have VM and you want Apache in container inside that VM? Why not have Apache directly on the VM?

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: Create a web server using Centos 9 with Google Cloud and Docker

Post by tunk » 2022/05/28 13:07:40

CentOS Stream is a rolling prelease of the next RHEL point release
(in this case 9.1), and you will have to expect more bugs and problems
compared to running e.g. RHEL 9. I don't think Stream is recommended
for anything remotely critical. And there's a 1.5GB minimum required
memory for RHEL 9.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Create a web server using Centos 9 with Google Cloud and Docker

Post by TrevorH » 2022/05/28 13:47:25

Also, you were not root when you attempted to run apt* so even if had existed, it would not have worked. You need to use yum not apt and you need to be root.

The comments about Stream 9 being unsuitable for production use are also worth considering. There's not enough history for Stream 9 to judge it yet but for Stream 9, security related updates lag considerably over RHEL and the 'clones' of RHEL (Alma/Rocky/OEL). One kernel update to fix a critical issue took 3 weeks before it was patched in Stream 8 after it was patched in RHEL. A similarly important update for Apache httpd took 71 days.

Alma Linux have already released their clone of RHEL 9.0. I would use that if I was not able to use RHEL 9 (there is a free developer subscription that allows for use of up to 16 copies of RHEL).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

fefe75
Posts: 3
Joined: 2022/05/28 09:34:11

Re: Create a web server using Centos 9 with Google Cloud and Docker

Post by fefe75 » 2022/05/28 20:48:35

Thank you very much for your messages. I am very interested in jlehtone's comment.
I have an app created in Spring Boot 2.7 that connects to a DB and I'm struggling with these images:
dpage / pgadmin4: latest
openjdk: 11.0.15-jre-slim
kartoza / postgis: 13.0

I still have problems redirecting to https and creating the volume that allows me to access tomcat files.
Can you give me some advice?
Thank you

Post Reply