Submitted by LeGiangAnh on Tue, 08/18/2015 - 09:38 Pro Licensee
Is there any way to move a virtual host directly to another server. I have root account and both server use custom port (different with 22). Do I need to delete the existed virtual server (I created the same one there) in the destination server?
Thanks, Giang Anh
Status:
Active
Comments
Submitted by andreychek on Tue, 08/18/2015 - 10:00 Comment #1
Howdy -- it is possible to migrate a Virtual Server to a new server.
To do that, you can create a backup of your existing Virtual Server, copy that backup to your new server, and restore it on the new server.
A simple way to do that would be to use the "Transfer Virtual Server" option in Server Configuration.
In the "Hostname of destination system" field, you can add a custom SSH port by using a hostname like the following:
example.com:2222
Yes, you would need to remove the Virtual Server from the destination server first.
Submitted by LeGiangAnh on Tue, 08/18/2015 - 10:48 Pro Licensee Comment #2
Hi,
But in this ticket you told me that I cannot backup my server: http://virtualmin.com/node/37817#comment-152857 Can I still using "Transfer Virtual Server" option?
Submitted by andreychek on Tue, 08/18/2015 - 10:55 Comment #3
Unfortunately, unless backups are working, the above won't work properly.
The "Transfer Virtual Server" option just performs a backup, copy, and restore for you. It's the same as doing the steps manually, except that it performs all the steps for you.
Submitted by LeGiangAnh on Thu, 08/20/2015 - 10:28 Pro Licensee Comment #4
Hi,
I was able to move the virtual server from Apache server to nginx server by manually move the public_html director and MySQL. However, after moving, my site cannot connect anymore, it shows: ERR_CONNECTION_TIMED_OUT message. http://jplay.tv
Do I need to config any special setting?
Thanks, Giang Anh
Submitted by andreychek on Thu, 08/20/2015 - 10:34 Comment #5
When I do a DNS lookup on that domain, it shows it pointing to the IP "23.97.59.121", is that correct?
Also, when looking in the access logs for your domain in $HOME/logs/access_log (on the new server), do you see the incoming connection attempt?
And if so, is there an error in $HOME/logs/error_log?
Submitted by LeGiangAnh on Thu, 08/20/2015 - 10:53 Pro Licensee Comment #6
23.97.59.121 is correct. Yes there are incoming connection attempts. There are errors:
2015/08/20 09:09:13 [error] 1582#0: *10008 open() "/home/jplay/public_html/categories/live-stream/captain-strike/summit1g" failed (2: No such file or directory), client: 180.76.15.18, server: jplay.tv, request: "GET /categories/live-stream/captain-strike/summit1g HTTP/1.1", host: "dev.jplay.tv"
2015/08/20 09:10:23 [error] 1582#0: *10012 client intended to send too large body: 15411981 bytes, client: 115.79.47.73, server: jplay.tv, request: "POST /phpmyadmin/import.php HTTP/1.1", host: "jplay.tv", referrer: "http://jplay.tv/phpmyadmin/index.php?db=jplay&target=db_import.php&token=ceb0455e4436143e94b3f9708d9357d5#PMAURL-2:db_import.php?db=jplay&table=&server=1&target=&token=ceb0455e4436143e94b3f9708d9357d5"
2015/08/20 09:17:38 [error] 1582#0: *10052 open() "/home/jplay/public_html/muieblackcat" failed (2: No such file or directory), client: 94.102.52.174, server: jplay.tv, request: "GET /muieblackcat HTTP/1.1", host: "23.97.59.121"
2015/08/20 10:39:54 [error] 1582#0: *10271 open() "/home/jplay/public_html/rom-0" failed (2: No such file or directory), client: 46.172.71.251, server: jplay.tv, request: "GET /rom-0 HTTP/1.1", host: "23.97.59.121"
2015/08/20 11:19:24 [error] 1582#0: *10401 open() "/home/jplay/public_html/favicon.ico" failed (2: No such file or directory), client: 115.79.47.73, server: jplay.tv, request: "GET /favicon.ico HTTP/1.1", host: "jplay.tv", referrer: "http://jplay.tv/"
2015/08/20 11:25:45 [error] 1582#0: *10429 upstream sent invalid status "0 Facebook needs the CURL PHP extension." while reading response header from upstream, client: 10.0.0.5, server: jplay.tv, request: "GET / HTTP/1.0", upstream: "fastcgi://unix:/var/php-nginx/143979903845399.sock/socket:", host: "www.jplay.tv"
2015/08/20 11:31:48 [error] 1582#0: *10450 open() "/home/jplay/public_html/categories/football-stadium" failed (2: No such file or directory), client: 66.249.79.72, server: jplay.tv, request: "GET /categories/football-stadium?task=mediaform.meta&return=aHR0cDovL2Rldi5qcGxheS50di9jYXRlZ29yaWVzL3Nwb3J0cy9mb290YmFsbC1zdGFkaXVtP1BhZ2VTcGVlZD1ub3NjcmlwdA==&bbce467ddf9b34da0dfb314b9a9f0504=1&tmpl=component&PageSpeed=noscript HTTP/1.1", host: "dev.jplay.tv"
2015/08/20 13:04:11 [error] 1583#0: *10705 open() "/home/jplay/public_html/manager/html" failed (2: No such file or directory), client: 222.186.190.148, server: jplay.tv, request: "GET /manager/html HTTP/1.1", host: "23.97.59.121:80"
2015/08/20 13:13:16 [error] 1583#0: *10734 open() "/home/jplay/public_html/vi/game/mediaitem/anime-arena-hack-ios-and-android-mod-proof" failed (2: No such file or directory), client: 66.249.79.107, server: jplay.tv, request: "GET /vi/game/mediaitem/anime-arena-hack-ios-and-android-mod-proof HTTP/1.1", host: "jplay.tv"
2015/08/20 14:42:22 [error] 1583#0: *10956 open() "/home/jplay/public_html/games/clash-of-allstars" failed (2: No such file or directory), client: 66.249.79.119, server: jplay.tv, request: "GET /games/clash-of-allstars HTTP/1.1", host: "jplay.tv"
2015/08/20 15:22:32 [error] 1583#0: *11067 open() "/home/jplay/public_html/categories" failed (2: No such file or directory), client: 66.249.79.84, server: jplay.tv, request: "GET /categories?task=mediaform.meta&id=42&return=aHR0cDovL2Rldi5qcGxheS50di9jYXRlZ29yaWVzL2J1c2luZXNzL2J1aWxkaW5ncw==&1646c353ff061f1b5a68942b899af474=1&tmpl=component&PageSpeed=noscript HTTP/1.1", host: "dev.jplay.tv"
Submitted by andreychek on Thu, 08/20/2015 - 11:06 Comment #7
Well, I see a few different errors that your application is giving.
However, one in particular that stands out is that it's missing the PHP Curl module.
You may want to try installing the PHP Curl package and see if that helps.
Submitted by LeGiangAnh on Thu, 08/20/2015 - 11:39 Pro Licensee Comment #8
Hi,
I installed it but there is no new error created.
Thanks, Giang Anh
Submitted by andreychek on Thu, 08/20/2015 - 11:54 Comment #9
Could you try setting up a new test domain on this server, just to see if that works properly?
In that new domain, Just add in a simple HTML file or PHP script to see if the web server is properly answering queries.
Submitted by LeGiangAnh on Thu, 08/20/2015 - 12:11 Pro Licensee Comment #10
Hi,
It doesn't work: http://legianganh.com/test.php
400 Bad Request
The plain HTTP request was sent to HTTPS port
nginx/1.4.6 (Ubuntu)
Submitted by andreychek on Thu, 08/20/2015 - 13:14 Comment #11
Hmm, if it's trying to answer incoming requests on port 80 with SSL, then it definitely sounds like there is a configuration problem.
Do you know if any changes were made to the Nginx config from the default?
Also, what distro/version is it that this new server is running on?
Submitted by LeGiangAnh on Thu, 08/20/2015 - 20:20 Pro Licensee Comment #12
Hi,
I don't change any setting since you told me that you don't support unofficial package in the last ticket. I'm using Ubuntu 14.04.3 Also, I installed SSL in one of my virtual server: jplay.tv
Submitted by andreychek on Thu, 08/20/2015 - 20:32 Comment #13
Okay, what is the output of these commands:
ps auxw | grep nginx
dpkg -l 'nginx*'
netstat -anlp | grep :80
Submitted by LeGiangAnh on Thu, 08/20/2015 - 20:51 Pro Licensee Comment #14
Here:
root@JPlaySite:~# ps auxw | grep nginx
root 1483 0.0 0.0 86616 2928 ? Ss 08:21 0:00 nginx: master process /usr/sbin/nginx
www-data 1484 0.0 0.0 86616 3656 ? S 08:21 0:00 nginx: worker process
www-data 1485 0.0 0.0 86616 3656 ? S 08:21 0:00 nginx: worker process
www-data 1486 0.0 0.0 86616 3656 ? S 08:21 0:00 nginx: worker process
www-data 1487 0.0 0.0 86616 5644 ? S 08:21 0:00 nginx: worker process
jplay 2736 0.0 0.0 25092 5528 ? S 08:21 0:00 /usr/bin/perl /usr/bin/php-loop.pl /usr/bin/php5-cgi -b /var/php-nginx/143979903845399.sock/socket
jplayvn 2744 0.0 0.0 25092 5688 ? S 08:21 0:00 /usr/bin/perl /usr/bin/php-loop.pl /usr/bin/php5-cgi -b /var/php-nginx/143980241848201.sock/socket
anh 2752 0.0 0.0 25096 5548 ? S 08:21 0:00 /usr/bin/perl /usr/bin/php-loop.pl /usr/bin/php5-cgi -b /var/php-nginx/14400900274362.sock/socket
jplayvn 2760 0.0 0.3 292628 22868 ? Ss 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143980241848201.sock/socket
anh 2761 0.0 0.3 288280 22768 ? Ss 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/14400900274362.sock/socket
jplay 2763 0.0 0.3 288280 22676 ? Ss 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143979903845399.sock/socket
jplayvn 2767 0.0 0.0 292628 4820 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143980241848201.sock/socket
jplayvn 2768 0.0 0.0 292628 4820 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143980241848201.sock/socket
jplayvn 2769 0.0 0.0 292628 4820 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143980241848201.sock/socket
anh 2770 0.0 0.0 288280 4748 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/14400900274362.sock/socket
jplayvn 2771 0.0 0.0 292628 4820 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143980241848201.sock/socket
anh 2772 0.0 0.0 288280 4748 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/14400900274362.sock/socket
anh 2773 0.0 0.0 288280 4748 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/14400900274362.sock/socket
anh 2774 0.0 0.0 288280 4748 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/14400900274362.sock/socket
jplay 2775 0.0 0.0 288280 4744 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143979903845399.sock/socket
jplay 2776 0.0 0.0 288280 4744 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143979903845399.sock/socket
jplay 2777 0.0 0.0 288280 4744 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143979903845399.sock/socket
jplay 2778 0.0 0.0 288280 4744 ? S 08:21 0:00 /usr/bin/php5-cgi -b /var/php-nginx/143979903845399.sock/socket
root 3641 0.0 0.0 10472 2192 pts/0 S+ 08:44 0:00 grep --color=auto nginx
root@JPlaySite:~# dpkg -l 'nginx*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii nginx 1.4.6-1ubunt all small, powerful, scalable web/pro
ii nginx-common 1.4.6-1ubunt all small, powerful, scalable web/pro
ii nginx-core 1.4.6-1ubunt amd64 nginx web/proxy server (core vers
un nginx-doc <none> <none> (no description available)
un nginx-extras <none> <none> (no description available)
un nginx-full <none> <none> (no description available)
un nginx-light <none> <none> (no description available)
un nginx-naxsi <none> <none> (no description available)
root@JPlaySite:~# netstat -anlp | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1483/nginx
tcp 0 0 10.0.0.5:56180 168.63.129.16:80 TIME_WAIT -
tcp 0 0 10.0.0.5:56186 168.63.129.16:80 TIME_WAIT -
tcp 0 0 10.0.0.5:56183 168.63.129.16:80 TIME_WAIT -
tcp6 0 0 :::80 :::* LISTEN 1483/nginx
root@JPlaySite:~#
Submitted by LeGiangAnh on Thu, 08/20/2015 - 22:26 Pro Licensee Comment #15
Hi,
I worked now with https links. If I use http link it still shows the error. I don't know why it works actually.
Submitted by andreychek on Thu, 08/20/2015 - 22:33 Comment #16
Do you have an example URL that works using https? I had tested with that earlier and it wasn't working properly then. Thanks!
Submitted by LeGiangAnh on Thu, 08/20/2015 - 22:41 Pro Licensee Comment #17
Yes. those links worked. Then I tried to reload nginx and now it cannot be started. =____=
Submitted by andreychek on Thu, 08/20/2015 - 22:44 Comment #18
Ah, the problem keeping Nginx from starting may be what's causing your sites to not work.
Are you receiving an error when trying to start Nginx? Or are any errors showing in the logs?
Hopefully this means we're close to figuring out the issue :-)
Submitted by LeGiangAnh on Thu, 08/20/2015 - 22:54 Pro Licensee Comment #19
I could not start because the port is already used:
2015/08/21 10:39:28 [emerg] 3641#0: bind() to 10.0.0.5:443 failed (98: Address already in use)
2015/08/21 10:39:28 [emerg] 3641#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2015/08/21 10:39:28 [emerg] 3641#0: bind() to [::]:80 failed (98: Address already in use)
2015/08/21 10:39:28 [emerg] 3641#0: bind() to 10.0.0.5:443 failed (98: Address already in use)
2015/08/21 10:39:28 [emerg] 3641#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2015/08/21 10:39:28 [emerg] 3641#0: bind() to [::]:80 failed (98: Address already in use)
2015/08/21 10:39:28 [emerg] 3641#0: bind() to 10.0.0.5:443 failed (98: Address already in use)
2015/08/21 10:39:28 [emerg] 3641#0: still could not bind()
I tried to restart the server some times and now it started. You can open the site here: https://jplay.tv/ However http doesn't work.
Submitted by andreychek on Thu, 08/20/2015 - 23:07 Comment #20
Ah! Then it looks like Nginx is currently started, so it wouldn't be possible to launch it again.
I don't know the exact filename in your particular case, but do you know where the Nginx jplay.tv.conf file is located?
If so, could you include it's contents here?
Submitted by LeGiangAnh on Thu, 08/20/2015 - 23:20 Pro Licensee Comment #21
I think other process took that port. Then I have to restart server some times so that nginx can take it back. Here is the content, I used Joomla for this site:
Submitted by andreychek on Fri, 08/21/2015 - 09:15 Comment #22
Okay, the very last line in your Nginx config is this one:
ssl on;
Try commenting out that line.
Then, restart Nginx.