- Clone this repo first and
cd
into it. - Was tested and successfully working on Ubuntu 16.04 GCP VM and Ubuntu 18.04 locally.
- If you're feeling lazy to build from scratch, use this pre-built docker image.
cd hope/
sudo apt install -y mysql-server
sudo service mysql start
- Ensure you know the root password of MySQL, which you'll have to enter below.
sudo mysql -u root -e "CREATE DATABASE hope" -p
sudo mysql -u root -e "CREATE USER dataturks@'127.0.0.1' IDENTIFIED BY '12345';" -p
sudo mysql -u root -e "GRANT SELECT, INSERT, UPDATE, DELETE ON hope.* TO dataturks@127.0.0.1;FLUSH PRIVILEGES;" -p
sudo mysql -u root hope -p < docker/mysqlInit.sql
sudo apt update
sudo apt install -y openjdk-8-jdk openjdk-8-jre maven
mvn package -DskipTests
(Ensure that java -version
command gives the java version as 1.8
)
java -Djava.net.useSystemProxies=true -server -jar target/dataturks-1.0-SNAPSHOT.jar server onprem.yml
- Don't kill it.
- You might have to open a new Terminal to continue further steps.
cd bazaar/
chmod -R 777 *
sudo apt install -y apache2 php7.0 libapache2-mod-php7.0
sudo a2enmod proxy_http
sudo a2enmod php7.0
sudo service apache2 restart
sudo cp ../hope/docker/onprem-dataturks.com.conf /etc/apache2/sites-available/
sudo sed -i "s|/home/dataturks/bazaar|`pwd`|g" /etc/apache2/sites-available/onprem-dataturks.com.conf
sudo a2dissite 000-default.conf
sudo a2ensite onprem-dataturks.com.conf
sudo cp ../hope/docker/dataturks-ssl.conf /etc/apache2/sites-available/
sudo sed -i "s|/home/dataturks/bazaar|`pwd`|g" /etc/apache2/sites-available/dataturks-ssl.conf
sudo a2ensite default-ssl.conf
sudo service apache2 restart
sudo apt install -y build-essential
curl -sL https://deb.nodesource.com/setup_8.x >/tmp/install_node.sh
chmod 777 /tmp/install_node.sh
sudo /tmp/install_node.sh
sudo apt install -y nodejs
sudo npm i -g nodemon
npm install && npm run build-onprem
npm prune #Optional
npm run start-onprem
- Now, you should be able to go to http://localhost:3000 and view the on-prem website.
Do export NODE_ENV=development
Then use the following to build and run the front-end:
npm run build-onprem-dev
npm run start-onprem-dev
sudo apt install phpmyadmin
sudo service apache2 restart
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo service apache2 reload
Now you can visit http://localhost/phpmyadmin to access it (Use DB's root username and password to login)
- Follow this: Secure Apache with Let's Encrypt
sudo a2ensite le-redirect-*.conf
sudo ufw disable
sudo iptables -F
- Ensure all the ingress/egress ports are open in your computer/VM.