This repo is about provisioning AWS EC2 Ubuntu server and related services and monitoring it using Promethius and Grafana while testing the load using Apache Jmeter
I configured Moodle open-source application inside this EC2. It's not necessary to configure that. If you don't need to configure that, you will not need RDS to provision.
Download the 'PrometheusNodeExporter' script file and move it to the EC2 server and run it.
In security group that attached to EC2, Allow 9090 port for Prometheus
Allow 9100 port for Node Exporter
Download Grafana.sh script and move it to the EC2 and run it.
Check the status of Grafana using, "sudo systemctl status grafana-server" command
In security group that attached to EC2, Allow 3000 port for Grafana
Open the Browser and run, http://<"EC2-Public-IP">:3000
Default credentials: username: admin
password: admin (you’ll be asked to set a new password)
Login to Grafana (http://<"EC2-Public-IP">:3000)
Go to Configuration → Data Sources → Add data source
Select Prometheus
In the URL, enter: http://localhost:9090
Click Save & Test
Grafana has prebuilt dashboards for Node Exporter.
In Grafana → left menu → Dashboards → Import
Enter this dashboard ID: 1860 (popular Node Exporter Full) Or use official ones: 13978 / 14513
Select your Prometheus data source and import.
You’ll now see CPU, memory, disk, network, and more stats from your EC2 in a nice dashboard 🚀
After setting up, you will be able to loging Grafana with using "http://yourdomain.com/grafana"
Run below commands,
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod headers
sudo a2enmod rewrite
sudo a2enmod sslThen Restart Apche using -> sudo systemctl restart apache2
Then create a conf file using sudo nano /etc/apache2/sites-available/grafana.conf
Add all the content of grafana.conf file.
Then add below line to that conf file between "VritualHost" tags.
# -------- Grafana Proxy --------
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /grafana http://localhost:3000/grafana
ProxyPassReverse /grafana http://localhost:3000/grafana
<Location /grafana/>
Require all granted
ProxyPassReverseCookiePath / /grafana
</Location>Save & Exit.
Edite Grafana Config:
sudo nano /etc/grafana/grafana.ini[server]
protocol = http
http_addr =
http_port = 3000
domain = YourDomain.com
root_url = https://YourDomain.com/grafana
serve_from_sub_path = true
sudo systemctl restart grafana-server
sudo systemctl reload apache2Now you can access to Grafana useing "https://yourdomain.com/grafana"
Prerequisites-> Java must be installed on your machine (JDK 8 or higher).
you can check if java is installed by running
java --versionDownload the zip file using this link "https://jmeter.apache.org/download_jmeter.cgi" and extract the zip folder into your program files in C drive.
To Run JMeter (GUI mode)
On Windows:
Navigate to the extracted JMeter folder.
Go to the bin folder.
Double-click on jmeter.bat (Or right-click → Open with Command Prompt)
✅ After Launching JMeter You’ll see the Apache JMeter GUI.
From there you can:
Create a Test Plan
Add a Thread Group
Add HTTP Request Samplers
Add Listeners to view the results
Click Start (Green triangle) to run the test
While testing, you can watch the Grafana dashboard to monitor the EC2 server.