# Frontend Building

Frontend is the display layer of the OJ. It is made ~~ugily~~ simply. It should be built on the same machine as the Server Manager

## Prerequirement

* Any OS
* [Java 1.8](https://www.java.com)
* [Apache Tomcat](http://tomcat.apache.org/)
* Basic Knowledge of Tomcat Application Building

## Downloading Tomcat & The War Pack

After downloing the War file in the Github release, you need to put it in the webapps folder of the Tomcat. Then, go to the bin folder of Tomcat. Run `./startup.sh` or `startup.bat` depending on you OS to start the server.

{% hint style="info" %}
To shut down the server, just run `./shutdown.sh` or `shutdown.bat`
{% endhint %}

## Setting up config file

Now, your website should be able to found at `http://localhost:8080/HellOJ`, enter the "Problemsets" page and you will see an Internal Server Error message. Now you need to set up a config file. The file's location varies from system to system. It's related to your calling position. But if you don't know, open `<tomcat path>/logs/catalina.out`and you should be seeing an error message&#x20;

> FATAL: CANNOT FIND CONFIG FILE. SEE DOCUMENTATION FOR DETAIL
>
> EXPECTED TO FIND IT HERE: \<somewhere>

Then the place is where you need to create a config file. In the config file(named config.json), write the following things:

```javascript
{
    "port":7512, //port of the server manager
    "path":"G:/test/server" //the location of the server manager
}
```

and you are set!
