You can host an Angular web app by apache
package. You need to export the project then copy data on the default path of apache
.
Installation
Install the apache
:
sudo apt-get install apache2
Enable/Start the service:
sudo systemctl start apache2
sudo systemctl enable apache2
Now, you can check the default page of apache
by opening 127.0.0.1
or the hostname/IP address of the raspberry pi on the browser.
Default path:
/var/www/html/
Every web page you put will be accessible over your root domain or IP address.
As an example, we made a directory named khar
(full path is /var/www/html/khar
) create a simple gav.html
file (full path is /var/www/html/khar/gav.html
). This page would be accessible on 127.0.0.1/khar/gav.html
on the browser.
All you need is that getting an export of your Angular page and copy all the files on /var/www/html/
.
Configuration
If you want to change the ports, change the Listen
section of /etc/apache2/ports.conf
config file. Also, there are many more ways to change the configuration and default port.
References:
apache2
package to host your Angular web app?serve
as well asapache
should be accessible. Is both the devices in same network? If yes, is the IP correct? Can you connect via SSH? If yes, then the webserver might be blocking the request.