Submitted by stretch on Mon, 08/15/2016 - 08:12
When trying to restore a backup of a virtual top-level server with nginx enabled the following error occurs:
Restoring Nginx webserver configuration ..
Nginx virtualhost was not found after restore!?
When trying to restore a backup of a virtual sub-server with nginx enabled the following error occurs:
Restoring backup for virtual server subdomain.domain.com ..
Restoring Nginx webserver configuration ..
.. no virtual host named subdomain.domain.com exists
.. failed! See the progress output above for the reason why.
Status:
Closed (fixed)
Comments
Submitted by andreychek on Mon, 08/15/2016 - 09:30 Comment #1
Howdy -- are you able to create backups of that particular Virtual Server? Is it just a problem restoring them?
Also, did that problem just begun occurring recently?
Submitted by stretch on Tue, 08/16/2016 - 07:50 Comment #2
yes, backups are created and the file seems to be correct inside- it contains nginx.conf for a particular domain. This issue occurs from early virtualmin releases with nginx support.
Submitted by andreychek on Tue, 08/16/2016 - 10:11 Comment #3
Hmm, well that's unusual! Could you generate a new backup of one of the problem domains, and paste in the output that you receive during that backup? Thanks!
Submitted by stretch on Tue, 08/16/2016 - 12:32 Comment #4
sure, it happens every time with any domain, even with the just created one.
Submitted by JamieCameron on Tue, 08/16/2016 - 23:45 Comment #5
Can you check if a server entry for the domain was created anywhere under the
/etc/nginx
directory on the destination system?Submitted by stretch on Wed, 08/17/2016 - 07:18 Comment #6
yes, an empty file example.com is created in
/etc/nginx/sites-available
, although example.com_virtualmin-nginx in a backup file is not empty.Submitted by JamieCameron on Thu, 08/18/2016 - 01:32 Comment #7
Can you post the
example.com_virtualmin-nginx
file from your backup?Submitted by stretch on Thu, 08/18/2016 - 07:14 Comment #8
It's strange that it isn't stored inside
server { }
block, here are the contents of the fileserver_name example.com www.example.com;
listen 111.251.131.50;
root /home/example/public_html;
index index.html index.htm index.php;
access_log /var/log/virtualmin/example.com_access_log;
error_log /var/log/virtualmin/example.com_error_log;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/example/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/example/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/php-nginx/14671509331841.sock/socket;
}
listen 111.251.131.50:443 ssl;
ssl_certificate /home/example/ssl.cert;
ssl_certificate_key /home/example/ssl.key;
Submitted by JamieCameron on Thu, 08/18/2016 - 23:23 Comment #9
Ok, that looks fine.
In your main Nginx config file, is there an
include
for the /etc/nginx/sites-available directory? If so, what does it look like?Submitted by stretch on Fri, 08/19/2016 - 05:53 Comment #10
yes it's there! I'm using virtualmin on debian jessie x64, you could see this behavior if you'd install it yourself, or I can give you access to a freshly installed VM.
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server_names_hash_bucket_size 128;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
Submitted by JamieCameron on Sat, 08/20/2016 - 00:47 Comment #11
If you could give me remote access to a system that's seeing this problem, that would be great!
Submitted by stretch on Sat, 08/20/2016 - 05:44 Comment #12
Please post your public SSH key(
cat ~/.ssh/id_rsa.pub
), so I can add it to the system for authenticationSubmitted by andreychek on Sat, 08/20/2016 - 09:11 Comment #13
This is Jamie's SSH key:
ssh-dss AAAAB3NzaC1kc3MAAACBALPtrQgus8wMeTrxiQREVKNGK1b8S9MLcsVngXsaNL2IpzHzajjDxEhkxARlpREFdvhPB9XEMa8IYVRmScyYaAMoespibzq1A24kcBQ3iLDrgoTb/UiRxv7c84WhQud1YpbteKpcpfG582wste+3FqkzvQ6pbNcI0Kkuruhb0s+HAAAAFQDDRVRFXdmNFNR+N3D/XwkIAb7hhQAAAIB0GN+AIuA9OonKbJpgoKz3TKhWNf6DAm39y8Zb//zMaK8/Lc1FMpOsNI/R4Y6LPvCJeAyDXuf/5OT3+613xu70bSSUi2g4UXA6RM/PlSUhdEH4XmG8SoB9abaIObU2AkH84Dkf25qVlSRAL/5aU/R7InXk7jJYFD+cz7vau/4jKAAAAIA1keU19UdRAzUKpbHFotBso8UnQzurcoFWNq8YtjkV9x32sjHuatab+mSXvjjSV9VDZ1Ru+6h5q/Vf6tr4yUuAYIo9s9LGA/MQgOVl7k+Dsn6N9UCta8/yoDXPMBbYQoiUJ2sOQ0pCaPeYXH6WTbB9edgxRow8WFQjGW26t6cF5Q== dsa-key-20031024 # Virtualmin: Jamie
Submitted by stretch on Thu, 08/25/2016 - 13:45 Comment #14
Jamie, you should be able to login to the server with freshly installed virtualmin:
ssh root@139.59.157.242
you will find user password for logging in to virtualmin web interface in
/root/virtualmin-password.txt
Submitted by JamieCameron on Sat, 08/27/2016 - 11:55 Comment #15
Thanks, I'm logged in now. Where can I find the backup file that you were having trouble restoring though?
Submitted by JamieCameron on Sat, 08/27/2016 - 12:14 Comment #16
Actually, I was able to reproduce this by creating a domain on your system, backing it up, and then restoring. Turns out that actually the backup process is incomplete - it doesn't save the Nginx config properly, resulting in a broken domain on restore.
We'll fix this, but for now the only work-around is to disable and then re-enable Nginx on these domains post restore.
Submitted by stretch on Sun, 08/28/2016 - 05:55 Comment #17
Yes I know this work around, hope you'll fix it in the next release! Do you still need the test server?
Submitted by JamieCameron on Sun, 08/28/2016 - 10:59 Comment #18
No, you can shut it down now. Thanks for setting it up!
Submitted by JamieCameron on Sun, 08/28/2016 - 10:59 Comment #19