How can I disable the default virtualhost to host a webserver on another physical server?

Hi everyone!

I have a little problem here and have been trying to solve it for many days.
I have a Nethserver (Server A) which is used for mail, web, nextcloud, SOGO + reverse proxy. On Server B, which is running Ubuntu Server, I designed a new version of the website hosted by Server A. Now, I would like to make that live. The problems starts here.

Try 1: I tried to use Nginx Proxy Manager to point mydomain.com, www.mydomain.com to the local address of Server B. That didn’t work out quite well because I use SOGO and ActiveSync, so because it didn’t have access to port 80, SOGO wasn’t working, so all the iOS clients couldn’t connect to the mail server. Tried many things to make SOGO alive but no luck there. Also, the whole new site was broken. Maybe the links were, I don’t know. Abandoned.

Try 2: I tried to migrate the new site from Server B to Server A but I literally broke the old site because nearly everything was a lot newer on Server B than Server A. (mysql, php, wordpress etc…) Glad I made a backup. Abandoned.

Try 3: Last night, I reversed everything and turned off Nginx proxy manager, so Nethserver controls everything. For mail server, I use mail.mydomain.com. I would like to forward mydomain.com to Server B but I can’t because I can’t turn off Nethserver’s default virtualhost. Using only http, I can access Server B but with https, I can’t. Server A’s site comes up.

I’m really getting out of ideas and I’m standing with a broken website and a new one only accessible on the local network.

Please, give me any, any ideas to make this thing alive!

Thank you for reading and in advance for any help!!

Hi Martin,

As Markus once wrote:

The minimal way: create a file /var/www/html/index.html with

<meta http-equiv="refresh" content="0; URL='https://ip-address-of-internal-server'" />

The 0 is the time (in seconds), to wait for the redirection to take effect.

● If you already have an index.php in the default /var/www/html/, then index.html have precedence over index.php.
● If you already have an index.html in the default /var/www/html/, don’t forget to make a backup ot the file.
● This is not the most elegant way but it will redirect the web domain.

→ This is the easiest way to redirect if you have only one domain.

For the time been, you can try this way until someone on this forum gives you a better solution (and someone will) for the redirection with a vhost, or ProxyPass module, or .htaccess

Michel-André

P.S. The redirection will interfere with the renewal of Let’s Encrypt certificate if you don’t have a .well-known directory with its sub-directory on B server.

P.P.S. Since you are using WordPress, you can use the extension Duplicator or XCloner to move you web. For a test and getting used to it, try it on a Virtual Machine first.
If you used only relative path instead of full path in you pages, it will be easy to move your site.
The extension “Velvet Blues Update URLs” will help you change old urls and links in your new website.
Have a look: https://www.micronator.org/affaires/produit/nethserver-101-cahier-09duplicator-migration/

This will only work if that IP address is accessible from the outside world, and even then it will give a certificate error.

this could be a similar case:

2 Likes

2 posts were split to a new topic: Why LetsEncrypt certificate path has a suffix on the domain?

Thank you very much for the info, I will take a look next weekend when I will have a little freetime again.
Meanwhile, I “solved” the problem by creating a whole new database and moved every wp file in /var/www/html to a subfolder on Server A, started wordpress from scratch and transferred everything individually from Server B. Then, fixed the links, the design issues. It failed many times on transferring the pages, posts, media etc, but for now, it working.