normativeai / frontend

GNU General Public License v3.0
5 stars 3 forks source link

Installing the frontend on nai.uni.lu #1

Closed shaolintl closed 5 years ago

shaolintl commented 5 years ago

It seems that the uni will not create the DNS name until we have the frontend running on the root on port 80. I am running the backend and since they cannot register, they always get an error message and apparently, it is not enough. Can you set it on the nai machine with the correct http server? Should we use the Node server for both?

The server is running right now on 80 although it doesnt not have an automatic pull (I just made a pull though).

The backend is installed in /opt/nai-backend with HOME=/etc/opt/nai-backend I am running the server as nai (sudo -H -u nai bash -c )

lex-lex commented 5 years ago

Yes, it's a good idea to start making preparations on the server side. I haven't made it my mind about which web server to use – but since the web server (for the front end) will only serve static files and the index.html, any web server will probably do. A simple web server with nodeJS for that purpose is described at https://gist.github.com/ryanoglesby08/1e1f49d87ae8ab2cabf45623fc36a7fe

Did I understand correctly that your back end is running on port 80? Or can I just simply start a web server (à la that link above) on port 80 (or do I need to combine it with your back end server somehow)?

shaolintl commented 5 years ago

Right now it runs on port 80 since I was hoping they will create the DNS name nai.uni.lu . I will connect now and run the server on port 4000 and will free port 80. I already granted nai permissions to run servers on port 80.

shaolintl commented 5 years ago

I just made the change and was surprised to see that the root was pinged every second. The server sent 404 so it might be the reason the DNS name doesnt exist yet. Expect to see immediate pings once you set up the server.

lex-lex commented 5 years ago

I was doing a bit of research and found that nginx seems to be a easy-to-use and nice front end server; it can later also be used as a reverse proxy for passing the back end api calls to the nodeJS instance. Once the VPN likes me again, I will install nginx and set-up the front end with it. Does that sound ok to you?

shaolintl commented 5 years ago

Sounds very good, thanks.

lex-lex commented 5 years ago

nginx is installed and is running. I created a virtual server instance for port 80 with root /var/www/html/nai-frontend which is a softlink to /opt/nai-frontent (owned by nai). I already tested browsing it while in VPN (with address http://nai). It seems to work nicely. I registered a new user using the front-end as "test@test.com" (usual test password) and was able to log in. Nice! :)

In a next step, it might make sense to have nginx re-route /api calls on port 80 internally to the nodeJS server on 4000. But for testing, the current API link "http://nai:4000/api" is fine.

shaolintl commented 5 years ago

Great, thanks! I have also updated the backend to the latest version which supports also the full API for queries as well as consistency checks and execute query. I just installed all the required libraries for nai and checked that it is working.

I opened a ticket reminding them about the DNS name.

On Tue, 1 Jan 2019 at 17:56, Alexander Steen notifications@github.com wrote:

nginx is installed and is running. I created a virtual server instance for port 80 with root /var/www/html/nai-frontend which is a softlink to /opt/nai-frontent (owned by nai). I already tested browsing it while in VPN (with address http://nai). It seems to work nicely. I registered a new user using the front-end as "test@test.com" (usual test password) and was able to log in. Nice! :)

In a next step, it might make sense to have nginx re-route /api calls on port 80 internally to the nodeJS server on 4000. But for testing, the current API link "http://nai:4000/api" is fine.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/normativeai/frontend/issues/1#issuecomment-450743148, or mute the thread https://github.com/notifications/unsubscribe-auth/AFj8VUGggcW1eIYaIO3UBMzQcUtKQrWJks5u-5M_gaJpZM4Zlz0B .

lex-lex commented 5 years ago

I think this is resolved.