Skip to content

Abdelrahman-Noaman/Vprofile-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Vprofile Project

A multi-tier Java web application demonstrating a production-grade infrastructure stack deployed locally using Vagrant and VirtualBox.

Architecture

User β†’ Nginx (Reverse Proxy) β†’ Tomcat (App Server) β†’ MySQL (Database)
                                                    β†’ Memcached (Cache)
                                                    β†’ RabbitMQ (Message Broker)

Tech Stack

Layer Technology
Web Server Nginx
Application Server Apache Tomcat
Framework Spring MVC, Spring Security, Spring Data JPA
Database MySQL 8
Caching Memcached
Message Broker RabbitMQ
Search ElasticSearch
Build Tool Maven 3.9
Language Java (JDK 17 / 21)

Infrastructure

5 VMs provisioned automatically via Vagrant:

VM Role IP
web01 Nginx reverse proxy 192.168.56.11
app01 Tomcat application server 192.168.56.12
rmq01 RabbitMQ message broker 192.168.56.13
mc01 Memcached caching layer 192.168.56.14
db01 MySQL database 192.168.56.15

Prerequisites

Getting Started

1. Install Vagrant plugins

vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-vbguest

2. Clone the repository

git clone https://github.com/YOUR_USERNAME/vprofile-project.git
cd vprofile-project
git checkout local

3. Start all VMs

cd vagrant/Manual_provisioning_WinMacIntel
vagrant up

Note: First run downloads base boxes and may take 10–20 minutes depending on your connection.

Manual Provisioning Order

Services must be provisioned in this exact order:

1. MySQL      (db01)   β€” Database
2. Memcached  (mc01)   β€” Caching layer
3. RabbitMQ   (rmq01)  β€” Message broker
4. Tomcat     (app01)  β€” Application server
5. Nginx      (web01)  β€” Web server / reverse proxy

Refer to VprofileProjectSetupWindowsAndMacIntel.pdf for detailed provisioning steps.

Database Setup

vagrant ssh db01

# Import the database dump
mysql -u root -padmin123 accounts < /vagrant/src/main/resources/db_backup.sql

Build & Deploy

vagrant ssh app01

# Build the application
cd /tmp/vprofile-project
/usr/local/maven3.9/bin/mvn install

# Deploy to Tomcat
systemctl stop tomcat
cp target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war
systemctl start tomcat

Accessing the Application

Once all VMs are up and provisioned, open your browser:

http://web01

Default credentials:

Username: admin_vp
Password: admin_vp

How the Caching Layer Works

  • First request β†’ data fetched from MySQL β†’ inserted into Memcached
  • Subsequent requests β†’ data served directly from Memcached
  • This mirrors real production caching behavior

Project Structure

vprofile-project/
β”œβ”€β”€ src/
β”‚   └── main/
β”‚       β”œβ”€β”€ java/          # Spring MVC application code
β”‚       β”œβ”€β”€ resources/
β”‚       β”‚   β”œβ”€β”€ application.properties
β”‚       β”‚   └── db_backup.sql
β”‚       └── webapp/        # JSP views
β”œβ”€β”€ vagrant/
β”‚   └── Manual_provisioning_WinMacIntel/
β”‚       └── Vagrantfile
└── pom.xml

Troubleshooting

VBoxManage E_INVALIDARG on import This occurs when your VirtualBox version (7.1.x) is incompatible with the box OVF format. Use centos/stream9 box instead of generic/centos9s in the Vagrantfile.

VM stuck at boot Run vagrant up again β€” Vagrant resumes from where it stopped.

Port collision on SSH Vagrant handles this automatically by remapping to the next available port.

License

This project is based on the VProfile Project by Imran Teli / HKH Infotech, used for DevOps learning and infrastructure practice.

About

πŸ› οΈ End-to-End VProfile Deployment using Vagrant, Nginx, Tomcat, MariaDB & RabbitMQ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors