You can use the Raspberry Pi 3b+ as a server?

January 5, 2025, 00:06

dcscenter

I wanted to publish my website online with a custom host but since I couldn't afford servers, I wanted to know if I could use that Raspberry Pi model as a web server?

thunder07337

1 GB RAM is a bit tight, but if your website is not too big and complex, it should work.

oops.se

For simple web sites with low load (few users hitting it) it is an excellent choice as a web server is quite moderate in demanding resources. If you use a database or a programming language will demanding more resources and can slow down the browsing experience to a painful experience.

oops.se

And just so you can get a correlation a home router have between 8 - 256MB RAM (some have more and some have less) and that serves a admin web interface and other features.

dcscenter

The website in Php, very small databases in Json, connected via lan to Wi-Fi, would you know how to set it up for free as a host?

oops.se

You need a public IP and make a port forward of web (http) and perhaps https trough your router/firewall to your web server. And then take a look at DynDNS to get a name (URL) instead of a IP Adr. Just do a search for how to have your own web server at home and there are many guides that can assist you. If you get into a standstill just howler and you will probably get an assistance

dcscenter

okay , thank you so much , now im installing ubuntu server

oops.se

Advice: There is a larger userbase using the Raspberry Pi OS (Debian) than Ubuntu Server.

dcscenter

Oh, i need to install Raspberry pi os???

dcscenter

Thank you for the advice

oops.se

No you can Use Ubuntu Server, but you will find less users in the Raspberry Pi community with skills in that OS.

k9t33n

You don't need to Ubuntu might be better if you know it well but rpi os is just generally slightly easier on a rpi

dcscenter

okok

dcscenter


dcscenter

Is it normal that I had 3 terminals open, and suddenly it reboots?

k9t33n

Might be a stability problem

k9t33n

Check the logs

k9t33n

Sudo journalctl

k9t33n

And make sure your power supply is sufficient

dcscenter

okok, it's normal after reboot the second time.. put Lode not Raspberry pi os [sorry for my english, I'm no english]

dcscenter

?

dcscenter

in the terminal/console mod i use this command "startx"

k9t33n

Okay

k9t33n

What do you intend to do with that?

dcscenter

Server web

dcscenter

with apache2

dcscenter

it's normal the problem???

k9t33n

No problem it's just startx can be used for a lot

k9t33n

If it works for you it works for you so don't mind me

dcscenter

ohh okok, but when i shutdown menu say Lode

dcscenter

but ok..

dcscenter

thank you

thunder07337

If you only want a web server take the Lite OS, then you have more RAM left, gui consumes too much and is unnecessary for a web server.

dcscenter

Since I got along quite well with the first Raspberry Pi as a web server, I'm buying another one, I think I'll put the system either Lite OS or Raspberry Pi OS, thank you very much

dcscenter

A question, in my website there are small databases, the data is saved in the ssd? Because the ssd is 32gb and the new one that I ordered is 128gb ssd,

dcscenter

?

k9t33n

whats the question?

k9t33n

if you put it on the ssd then it will be stored on the ssd. if you don't it won't.

dcscenter

I mean the ssd where I put the operating system, is it saved in the same ssd as the operating system?

k9t33n

im not sure what your using for your database but by default i would assume so

dcscenter

I use Json

dcscenter

SQL too complicated for me

k9t33n

This is the right channel

k9t33n

I don't know enough about databases

k9t33n

Also I was talking about your specific software for databases

k9t33n

Anyway if the SSD is the one you have the os installed on do you even have any other drive attached?

dcscenter

No..

dcscenter

Okok, sry

dcscenter

No problem

k9t33n

Okay

k9t33n

We can talk about it tomorrow

dcscenter

Okok, perfect!

dcscenter

Thank you

k9t33n

You don't have to stay online if I talk to you now, if you want to go to sleep go to sleep lol 😭

dcscenter

No problem, I'll stay up until 4:30 in the morning hahahahah

oops.se

JSON isn't a database! JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays (or other serializable values). A database is an organized collection of data or a type of data store based on the use of a database management system (DBMS). Examples of DBMS's include MySQL, MariaDB, PostgreSQL, Microsoft SQL Server, Oracle Database, and Microsoft Access. Just to straighten up the way different definitions is used in IT. And using a definition in another way is confusing.

dcscenter

okok i know, but i use it .. database

dcscenter

for users [password / username sha256]

oops.se

No you store data in a JSON format and that is not a database

dcscenter

[i dont speek english very well sorrry]

dcscenter

oh

oops.se

A database is more than storing data! And a file with values is just that. Check https://en.wikipedia.org/wiki/Database for a better and more comprehensive background.

dcscenter

okok, i use php for storing data in the json file

dcscenter

On my Raspberry it worked.. do you know how to make a website work with ginx from Raspberry Pi 3b+? (Website in Php SQL js CSS Json CSS)

thunder07337

Simply posting the question again will not help. Have you informed yourself? Have you already started to set something up in this regard? If so, what and where are you stuck?

dcscenter

l So should I ask another question?

dcscenter

That's the question

dcscenter

Anyway, everything is set as always and it works without any errors but when I open the site it shows the Apache welcome page, I try with nginx and it shows the same thing even if the Apache services are stopped

k9t33n

Try after your ip or domain name including the port your website is hosted on

k9t33n

After a :

dcscenter

Already done

dcscenter

But nothing:/

k9t33n

So that's http://ip:port

k9t33n

Okay

dcscenter

It seems strange to me that it doesn't work..

thunder07337

Simply setting up Apache or Nginx is not enough, it must also be configured correctly. Search for “nginx vhost config”

dcscenter

The apache welcome file has been deleted, my site is located in the /var/www/html/ directory

thunder07337

Permissions set correctly. Does your website have an index.html or index.php?

thunder07337

Otherwise, maybe try a tutorial. There are plenty on the internet. https://pimylifeup.com/raspberry-pi-apache/

dcscenter

All permissions, yes, index.php, set as main in the configuration file

dcscenter

Thank you