Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble getting setup #20

Closed
kinghat opened this issue Dec 8, 2021 · 5 comments
Closed

trouble getting setup #20

kinghat opened this issue Dec 8, 2021 · 5 comments

Comments

@kinghat
Copy link

kinghat commented Dec 8, 2021

i used the install instructions on the site for v3.0.0 but i cant connect to a forwarded port:

apt update && apt install nginx php-fpm php-curl sqlite3 php-sqlite3 -y
wget https://github.com/lxdware/lxd-dashboard/archive/v3.0.0.tar.gz
tar -xzf v3.0.0.tar.gz
cp -a lxd-dashboard-3.0.0/default /etc/nginx/sites-available/
cp -a lxd-dashboard-3.0.0/lxd-dashboard /var/www/html/
mkdir -p /var/lxdware/data/sqlite
mkdir -p /var/lxdware/data/lxd
mkdir -p /var/lxdware/backups
chown -R www-data:www-data /var/lxdware/
chown -R www-data:www-data /var/html
chown -R www-data:www-data /var/www/html/
systemctl restart nginx
exit

$ lxc config device add lxd-dashboard lxd-dashboardHttps proxy listen=tcp:0.0.0.0:9112 connect=tcp:127.0.0.1:8080

$ lxc config show lxd-dashboard -e
...
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
lxd-dashboardHttps:
connect: tcp:127.0.0.1:8080
listen: tcp:0.0.0.0:9112
type: proxy

when i go to host-ip:9112 i get: "connection reset".

@matthewalanpenning
Copy link
Contributor

@kinghat. The first set of steps look good for setting up the webserver. You should not need to do anything else to after restarting Nginx. You can then connect to the dashboard by navigating in your web browser to the IP address of the nginx server you installed. So adding the lxc device is not necessary.
The LXD Dashboard does not have to be installed on your actual LXD servers. It connects to your LXD servers using the REST API.
Let me know if you still are having issues.

@kinghat
Copy link
Author

kinghat commented Dec 8, 2021

You can then connect to the dashboard by navigating in your web browser to the IP address of the nginx server you installed. So adding the lxc device is not necessary.
The LXD Dashboard does not have to be installed on your actual LXD servers. It connects to your LXD servers using the REST API.

i installed lxd-dashboard into a container on the server where my other containers are so to be able to access it across my network dont i need to map the ports to the lxd-dashboard container i created and installed to?

@matthewalanpenning
Copy link
Contributor

matthewalanpenning commented Dec 8, 2021

Ah, ok I see what you are doing now. Yes you will need to map the ports. I think the issue may be that Nginx listens on port 80 by default, and your current setup is looking for the web server to be listening on on a different port than that. You can change the listening port in the Nginx default file that was moved to /etc/nginx/sites-available/. Based on your setup the Nginx port should be changed to 8080. Let me know if that fixes it.
You would then need to restart Nginx after changing the default file.
Also you would want to connect using http:// rather than https:// unless you have reconfigured the default nginx file to use ssl/tls certs.

@kinghat
Copy link
Author

kinghat commented Dec 8, 2021

Ah, ok I see what you are doing now. Yes you will need to map the ports. I think the issue may be that Nginx listens on port 80 by default, and your current setup is looking for the web server to be listening on on a different port than that. You can change the listening port in the Nginx default file that was moved to /etc/nginx/sites-available/. Based on your setup the Nginx port should be changed to 8080. Let me know if that fixes it. You would then need to restart Nginx after changing the default file. Also you would want to connect using http:// rather than https:// unless you have reconfigured the default nginx file to use ssl/tls certs.

ya this was an issue with my config. i got it working with:

devices:
  eth0:
    name: eth0
    network: lxdbr0
    type: nic
  httpProxy:
    connect: tcp:127.0.0.1:80
    listen: tcp:0.0.0.0:4111
    type: proxy

ironically, ive opted to use the docker container instead as its much lighter on resources. thanks for providing that! also, thanks for the work you've put into this. its very clean.

@kinghat kinghat closed this as completed Dec 8, 2021
@matthewalanpenning
Copy link
Contributor

Thanks. I am glad that you got things working. I do use a docker container as well for the lxd dashboard.I find LXD wonderful for setting up infrastructure and custom applications and then often use docker containers for the simple application deployments. I find mixing both technologies works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants