morph1904 / Tyger2

A Reverse Proxy Application
GNU General Public License v2.0
51 stars 11 forks source link

Fresh Ubuntu Server install issues #13

Closed charredchar closed 4 years ago

charredchar commented 4 years ago

This is actually my second attempt, both failing in the same way. I installed Ubuntu Server 18.04 and the first time I do is run your script, the following is a direct output.

https://pastebin.com/GJQzNJE4

The install then interface URL seems to work fine. I attempt to create a proxy, http://jellyfin.example.com which should forward to http://192.168.5.101:8096, doesn't seem to work though. The following is the Caddy log with an error I noticed.

https://pastebin.com/ys8WTMtg

Just to make sure I have information entered right because I'll always question myself...

Under Apps I used the name "Jellyfin", under URL I enter "http://192.168.5.101:8096" with no other options selected.

Under Addresses I have the URL as "http://jellyfin.example.com", Application as "Jellyfin", Google Cloud DNS (which I understand doesn't matter right now) with no other options selected.

I have this app proxy through Apache fine but can't get this to work.

charredchar commented 4 years ago

I did manage to get it running from Docker and I noticed a couple of things.

First, in the management page I saw that the left menu for the Ubuntu install that it just says "Hi, " instead of the user name.

Second would be something I think is out of your control but I want to point it out. I am attempting to proxy Windows Admin Center, using Websocket and HTTPS you end up with a "502 Bad Gateway" error. I saw this with Apache too though and after about two days of Googling I think it has more to do with WAC as lots of people have issues. But anything you might be able to shed light on here would be nice.

Also a quick note which again might be my own issue as I know little about Docker Compose or even Docker as a whole. While using your Sample with a fresh install of Compose using apt-get it complained about the Version number not matching. I removed that line and it installed and ran fine.

cmoro-deusto commented 4 years ago

Just in case it helps, I've just installed Tyger2 from docker-compose (as explained in the README) and it's working handsomely. I cannot see the issue about the username mentioned by @charredchar

I did have to create the "data/logs" directory manually in my mapped volume directory though: if you just map an empty "data" directory, it fails to start.

morph1904 commented 4 years ago

@charredchar I have Tyger2 proxying windows admin center at the moment without any issues. If you could send me a copy of your caddyfile.conf I can compare it with mine and see what the difference may be. I will also set up a clean test environment to take a closer look.

charredchar commented 4 years ago

@charredchar I have Tyger2 proxying windows admin center at the moment without any issues. If you could send me a copy of your caddyfile.conf I can compare it with mine and see what the difference may be. I will also set up a clean test environment to take a closer look.

I actually didn't bother attempting WAC the second time around so I don't have anything of it. Would it be possible to set up right from Tyger2 or is there something more involved? If it is just a setting I messed up while adding it from the Tyger2 page I can try again later.

charredchar commented 4 years ago

I am still having quite a lot of issues with reliability on a Ubuntu 18.04.3. So the docker-compose I had running for awhile eventually stopped working after a reboot. I did not keep the log, I am sorry, I had it happen once before and I just reformatted that install and started fresh again and it worked for awhile

This time around I am having no luck. I first tried, once again, to use the Ubuntu install script. This time everything seemed okay server side, no errors in the logs, created a couple of Apps and Addresses. Issue is I could not access any of them, when ever I attempted to it would return a "Connection Refused" error on the browser.

I eventually gave up and tried the docker-compose again. Same thing where I had to change Version to 3.3 or it would complain and not run. It installed and I got to through the install page fine but on the config page I would constantly receive, "Failed to communicate with backend." and I would need to refresh the page. I attempted a reboot on the VM but once up and docker-compose loaded again I can no longer access the config page, only the install page which says it is already installed.

Honestly, when this works it is amazing and I am so happy to have a decent front-end to a reverse proxy.. but it seems to have some serious issues keeping stable, I want to do what ever I can to get this working and help to do so.

morph1904 commented 4 years ago

@charredchar I would like to understand your issues better and see if I can get this sorted for you. I am running the docker version using portainer (but i am using a stack which uses compose v2). Docker would be the preferred method of running Tyger2 as it is easier to keep up to date, back up your configuration and easier to diagnose any issues.

In a new release of Tyger2 I am likely to drop support for anything other than Docker.

If you would like, I would be interested in having a screensharing session with you to look at your install and see if i can pinpoint the issues you are having. Forgive me but without viewing the issues step by step with details it is hard for me to assist. Please contact me if you are happy to do this.

charredchar commented 4 years ago

I am happy to do what ever we can to figure it out, I don't mind using docker if it means we can get it running stably. Honestly, the only reason I try and install it bare onto Ubuntu is because I am running it in a VM anyway with nothing else and I've had a lot of issues in the past getting Docker images to work or troubleshoot. But if I have you to help I am willing to do so.

What stack are you using of Docker? I would like to use the exact same so we can see if it is just the version I am installing or something else. I wouldn't mind attempting to use Portainer too as I see in the ReadMe that is what you use. I attempted it during one install but couldn't figure out how to make a container from the webui.

Lets go ahead with me installing everything first using the same software and versions as you are to see if it either just works or does not. From there we can set up a screenshare session to figure out what is going on with the install or do another free one at that point while you monitor it.

Thanks!

morph1904 commented 4 years ago

I simply run an ubuntu 18 vm with portainer.

If you can get fellow these steps and then let me know when running that would be great.

  1. Install new install of ubuntu 18 and update it fully.

  2. Install docker and portainer following the installation instructions on the portainer website

  3. On your router, forward ports 80 and 443 to the ip address of this new ubuntu server.

Thanks

morph1904 commented 4 years ago

Here are my system details fyi but this will work on any current version of docker/portainer

OS Information | linux x86_64 Ubuntu 18.04.3 LTS Kernel Version | 4.15.0-74-generic Total CPU | 24 Total memory | 10.5 GB

Version 18.09.7 (API: 1.39)
Root directory /var/lib/docker
Storage Driver overlay2
Logging Driver json-file
Volume Plugins local
Network Plugins bridge, host, macvlan, null, overlay
charredchar commented 4 years ago

I've been hitting my head against the wall for awhile attempting this, I have no clue what could be going wrong. The only errors I really see are related to logs.

So I have 18.04.3 installed and updated.

I installed Docker, Docker-Compose using apt then Portainer using the instructions on the website. Updated again to be sure.

The router has been forwarded.

I tried a couple more times using Docker-Compose. Same kind of thing as I mentioned earlier today, once I am on the main page I get constant connection issues like it saying it "Could not save the proxy! Please check your data and try again" but when I refresh it is there. I also forgot to mention that when I close the Docker-Compose that is running and attempt to re-run it the main page fails to load. The install page still works, shows that it is already installed but I can't access the main page.

morph1904 commented 4 years ago

OK, you jumped a little further ahead than I expected. I was going to walk you through using Portainer rather than Docker-Compose so that we could do some troubleshooting.

One of the great things about Portainer is it gives you really easy access to both the logs and the console of the running containers so that you can see what is going on.

If you are available today, we can arrange a screenshare session I am keen to find out what is happening with your install. As I am not experiencing the issues that you are and it would be good to see what might be different so that I can fix it.

charredchar commented 4 years ago

I see. Well, I re-installed Ubuntu again to start where I should, since it is a VM it isn't too difficult to make another attempt.

I should be available in 8 hours for the screenshare session, thank you again for all of the help.

morph1904 commented 4 years ago

Unfortunately, in my timezone that will be about midnight, and I have an early engagement every day this week. If you can get as far as having installed Portainer, I can make myself available at midnight on Friday if this suits you?

charredchar commented 4 years ago

I don't want to make you help me at midnight your time. I can work on making myself available earlier for you, I will update you further.

Would you prefer to work on this part through another means of communication so it does not need to be in your public ticket?

morph1904 commented 4 years ago

Sure do you have a preferred method?

charredchar commented 4 years ago

If you have a gmail account we can use Hangouts. Please contact me via charredchar@gmail.com.

charredchar commented 4 years ago

I have found part of the issue I was having, the reason it will return an error that it did not add the host was the time and timezone being off, it is set to UTC and every attempt I make to change it fails.

During another test I installed it directly onto Ubuntu but for some reason it is still rejecting the connection.

morph1904 commented 4 years ago

Hi Sorry for the late reply it has been a mad week in the day job.

Where have you been changing the timezone settings? There is a Django settings file where this setting is stored a good test is to change this value to match your timezone and see if this fixes your issue the file is /backend/backend/settings.py and line 145 is where the setting is changed.

The format looks like this TIME_ZONE = 'Europe/London'

Try setting it to your local timezone and see if this solves your issue. You may need to restart the UWSGI service for the setting to take effect.

If you are using docker, you may be able to do this by restarting the docker container, be careful not to rebuild it as this will reset the change.

In ubuntu, you can simple run service uwsgi restart

If this solves your issue I will see what i can do to sort this more permenantly for you. I am considering recoding this application in NodeJS so that I can create a simplified Electron Application and a smaller, easier to manage docker container and will make note of this issue to consider in the newer version.

charredchar commented 4 years ago

Ultimately this did not solve my issue. No matter what I did I could not get the docker containers to take the new time zone even after I managed to get my Ubuntu install to update (which wasn't as hard). In the mean time I gave up on Tyger2 and used NGINX just to get stuff online with HTTPS, sadly this gives me a lot of (different) issues too and I would much rather go back to Tyger2 if I can ever manage to get it working.

I did manage to edit the Django settings (this was no where as easy as it probably could have been) but even restarting the container from Portainer the date was still UTC. I really don't know if this is the cause to all of my issues while using Docker.

I then went and removed the Docker container and went to a bare install on the server. Again, this way I don't get the Saving Proxy error but when ever I attempt the connection from my cell phone I get a Rejection.