- Install Python 3 (version >= 3.6.9) and python3-pip. For example,
sudo apt install python3 - Install PostgreSQL (any version) and
postgresql-server-dev-all. For example,sudo apt install postgresql postgresql-server-dev-all - Start PosgreSQL, create a new user login, and configure database information in
server_config.yaml. Example commands are:sudo susu - postgrespsqlcreate user optimizer with password '123456';create database optimizerdb owner optimizer;\qthenexittwice
- Clone/Download this repository:
git clone https://github.com/minhhpham/MASS-webserver cd MASS-webserverpip3 install -r requirements.txt- Run server in development mode:
python3 MASS-webserver.py - If seeing a bug that says Peer authentication failed for user "optimizer" , do the following:
- Navigate to file Postgres' config file named
pg_hba.conf, usually located at/etc/postgresql/10/main/pg_hba.conf - Open file with root privilege:
sudo nano /etc/postgresql/10/main/pg_hba.conf - Navigate to end of file, there will be a table. Change the entire last column to 'md5'
- Save file and restart Postgres service with
sudo systemctl restart postgresql
- Navigate to file Postgres' config file named
- Clone this repository in the parent directory of
MASS-webserverand follow the instruction in theREADME.mdfile. For examlpe, you can run:cd ..git clone https://github.com/ZulqarnainHaider/MASS-Optimizercd MASS-Optimizerand follow the instructions in README.
- Add
juliato PATH:sudo nano ~/.bashrc- Add this line to the file:
export PATH=<path_to_julia>${PATH:+:${PATH}}
- After setting up
MASS-Optimizer, the directory tree should look like this:
MASS-webserver
├── MASS-webserver.py
├── nginx-MASS-flask.conf
├── optimizer_scheduler.py
├── optimizer.sh
├── output
├── README.md
├── requirements.txt
├── server_config.yaml
├── server_scripts
├── setup.py
├── static
└── templates
MASS-Optimizer/
├── optimizer
└── README.md
-
First install Nginx:
sudo apt-get install nginxsudo cp nginx-MASS-flask.conf /etc/nginx/sites-available/defaultsudo systemctl restart nginx
-
Run server:
sudo python3 setup.pysudo systemctl daemon-reload && sudo systemctl start MASS-flask && sudo systemctl start MASS-optimizer-scheduler && sudo systemctl restart apache2
Go to your browser and type localhost:10000