apache2 – Configure apache to listen on port other than 80 – Stack Overflow

In /etc/apache2/ports.conf, change the port as

Listen 8079

Then go to /etc/apache2/sites-enabled/000-default.conf

And change the first line as

<VirtualHost *: 8079>

Now restart

sudo service apache2 restart

Apache will now listen on port 8079 and redirect to /var/www/html

 

Source: apache2 – Configure apache to listen on port other than 80 – Stack Overflow

apache2 – Configure apache to listen on port other than 80 – Stack Overflow was last modified: June 20th, 2022 by Jovan Stosic

Install Grafana on Ubuntu 20.04 

1. Install Grafana

Update the system packages.

$ sudo apt update

Install required system packages.

$ sudo apt-get install -y gnupg2 curl software-properties-common

Add Grafana GPG key.

$ curl https://packages.grafana.com/gpg.key | sudo apt-key add -

Install the Grafana repository.

$ sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

Update the system packages.

$ sudo apt update

Install Grafana

$ sudo apt -y install grafana

Start Grafana service.

$ sudo systemctl start grafana-server

Enable Grafana service to start on system boot.

$ sudo systemctl enable grafana-server

Check the service status.

$ sudo systemctl status grafana-server

By default, Grafana is accessible on port 3000. To use Grafana on port 80, you can run a reverse proxy to forward all traffic on port 3000 to port 80. To do this, you can follow the instructions in the next step. Otherwise, use port 3000 to access the Grafana web interface.

2. Install and Configure Nginx Reverse Proxy (Optional)

Install Nginx.

$ sudo apt install nginx -y

Start Nginx service.

$ sudo systemctl start nginx

Enable Nginx service to start on system boot.

$ sudo systemctl enable nginx

Check Nginx service status.

$ sudo systemctl status nginx

Unlink the default configuration file.

$ sudo unlink /etc/nginx/sites-enabled/default

Create a new configuration file.

$ sudo nano /etc/nginx/sites-available/grafana.conf

Add the following code in the new file, save and close the file:

server {
    listen 80;
    location / {
        proxy_pass http://localhost:3000;
    }
}

Link and activate the new configuration file.

$ sudo ln -s /etc/nginx/sites-available/grafana.conf /etc/nginx/sites-enabled/grafana.conf

Test the configuration file.

$ sudo service nginx configtest

Restart Nginx service.

$ sudo systemctl restart nginx

3. Access Grafana Dashboard

To access the Grafana Web Interface without reverse proxy, go to your browser and visit http://Server_IP:3000/. For example:

http://192.0.2.10:3000/

To access the Grafana Web Interface over the reverse proxy, go to your browser and visit http://Server_IP/. For example:

http://192.0.2.10/

Source: Install Grafana on Ubuntu 20.04 – Vultr.com

Install Grafana on Ubuntu 20.04  was last modified: June 20th, 2022 by Jovan Stosic