A multi-tier Java web application demonstrating a production-grade infrastructure stack deployed locally using Vagrant and VirtualBox.
User β Nginx (Reverse Proxy) β Tomcat (App Server) β MySQL (Database)
β Memcached (Cache)
β RabbitMQ (Message Broker)
| 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) |
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 |
- Oracle VirtualBox
- Vagrant
- Git Bash (Windows) or Terminal (Mac/Linux)
1. Install Vagrant plugins
vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-vbguest2. Clone the repository
git clone https://github.com/YOUR_USERNAME/vprofile-project.git
cd vprofile-project
git checkout local3. Start all VMs
cd vagrant/Manual_provisioning_WinMacIntel
vagrant upNote: First run downloads base boxes and may take 10β20 minutes depending on your connection.
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.
vagrant ssh db01
# Import the database dump
mysql -u root -padmin123 accounts < /vagrant/src/main/resources/db_backup.sqlvagrant 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 tomcatOnce all VMs are up and provisioned, open your browser:
http://web01
Default credentials:
Username: admin_vp
Password: admin_vp
- First request β data fetched from MySQL β inserted into Memcached
- Subsequent requests β data served directly from Memcached
- This mirrors real production caching behavior
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
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.
This project is based on the VProfile Project by Imran Teli / HKH Infotech, used for DevOps learning and infrastructure practice.