Quantcast
Viewing all articles
Browse latest Browse all 5425

General discussion • Re: API + Frontend, to simplify debugging/running small IoT devices

Can I run the web server code on Apache2 running on a Pi with Raspberry Pi OS (Bookworm) ?
That is a good question Image may be NSFW.
Clik here to view.
:-)
At least, you can run both the API and the WEB using the builtin .NET Kestrel webbserver

I asked claude.AI - if "he" is to be believed, it is possible to host using Apache on a RPi.

To host a .NET 8 application on Apache on a Raspberry Pi 4, you'll need to take a few steps:

Install .NET 8 on your Raspberry Pi 4. The RPi 4 uses ARM64 architecture, which is supported by .NET 8.
Install Apache on your Raspberry Pi.
Set up a reverse proxy using Apache to forward requests to your .NET application.

Here's a brief outline of the process:

Install .NET 8:
Download and install the ARM64 version of .NET 8 for your RPi 4.
Install Apache

Code:

sudo apt-get updatesudo apt-get install apache2
Configure Apache as a reverse proxy:
Enable necessary Apache modules:

Code:

sudo a2enmod proxysudo a2enmod proxy_http
Create a virtual host configuration for your .NET app:
Edit a new config file:

Code:

sudo nano /etc/apache2/sites-available/dotnet-app.conf
Add the following (adjust as needed):

Code:

<VirtualHost *:80>    ServerName yourdomain.com    ProxyPreserveHost On    ProxyPass / http://localhost:5000/    ProxyPassReverse / http://localhost:5000/</VirtualHost>
Enable the site and restart Apache

Code:

sudo a2ensite dotnet-app.confsudo systemctl restart apache2
Run your .NET application on the specified port (5000 in this example).

Good luck!

// Lazze

Statistics: Posted by Lazzerman — Fri Aug 09, 2024 6:44 pm



Viewing all articles
Browse latest Browse all 5425

Trending Articles