I have a server with a bunch of websites served by apache. I didn’t want to install yunohost directly on that host so I installed in a VM that sits behind a NAT on an internal (virtual) subnetwork. For now I am accessing the yunohost web server through some ssh tunnels.
Redirect app is helping me serve these existing websites (awaiting proper migration if/when possible).
This is how to automate the configuration :
- login via ssh
- write the list of domain names in in a text file
- run the following bash loops (assuming 192.168.122.1 is the internal IP of your virtual machine host) :
for i in `cat domains.list `; do yunohost --admin-password YOURADMINPASSWORD domain add $i; done
for i in `cat domains.list `; do yunohost app install https://github.com/YunoHost-Apps/redirect_ynh --args "domain=$i&path=/&redirect_path=http://192.168.122.1&is_public=1&redirect_type=proxy" --label $i; done
then DNAT the 80/443 to your VM (192.168.122.Y) and your existing websites should be served via apache and nginx.