- Preparing required instruments
- Installing MySQL
- Installing Java Development Kit
- Installing Tomcat
- Preparing a deployment directory
- Installing Git version control system
- Installing maven build automation system
- Installing, building, preparing to run
- Downloading the application
- Database dump deploying
- Database user creating
- Setting up the project
- Application building
- The application deploying
Car rent application studing project.
The application requires MySQL version 5.7 and higher.
The application requires Java Development Kit version 8 (1.8)
The application has been tested in Tomcat 8.5 Download and install Tomcat 8.5
Remove or move the content of tomcat/webapps/ROOT to another directory.
Git installation is optional, in order to simplify downloading application from git-hub.
Maven 3.3 build automation system is required to build, test and deploy application.
To download the application use the following in command line:
git clone https://github.com/MaximChshelokov/CarRentWebApp.git
To deploy the database dump type in command line:
mysql -u root -p < project path/db_dump.sql
Then input the root user's password. Database scheme will be created automatically.
To deploy the test database dump (whether is required to successfully build the project) input into command line:
mysql -u root -p < project path/test_db_dump.sql
Then input the root user's password. Database scheme will be created automatically.
The application uses default database username car_rent_app (and password Un3L41NoewVA). To create the user run the mysql terminal and input:
CREATE USER 'car_rent_app'@'localhost' IDENTIFIED BY 'Un3L41NoewVA';
If you want to use another username and password, you have to specify them to database properties file
Use the following command to grant to the user access to the database (scheme):
GRANT SELECT, INSERT, UPDATE, DELETE ON * . * TO 'car_rent_app'@'localhost';
There is an error might occure during connect to the database if you're using the Windows OS because of MySQL couldn't set timezone automatically. To fix it run the mysql terminal and input:
SET GLOBAL time_zone = 'YOUR TIMEZONE';
Give your timezone in +7:00 format instead of YOUR TIMEZONE.
In order to use an arbitrary username and password, change the following lines in src/main/resources/db_params.properties file:
LOGIN=database user's name
PASSWORD=database user's password
You also could change another database connection parameters, if necessery:
URL=jdbc:mysql://localhost/DATABASE NAME?autoReconnect=true&useSSL=false&characterEncoding=utf-8
POOL_SIZE=CONNECTION POOS SIZE
Input the following command to build the project:
mvn clean install
Copy directory project path/target/car_rent-1.0-SNAPSHOT/ content to the tomcat/webapps/ROOT directory. Note: target directory creation covered in Application building
Для запуска контейнера Tomcat перейдите в директорию tomcat/bin и в командной строке выполните:
startup
Чтобы открыть страницу приложения, в браузере в адресной строке введите localhost:8080 и нажмите "перейти". Для того, чтобы войти под администратором, используйте логин [email protected] и пароль admin1. Чтобы войти под пользователем, логин [email protected] и пароль client.