Create virtual server error on 12.04

Managed to install on Ubuntu 12.04, I understand that this version of virtualmin is unsupported so putting this issue up fyi. Configuration (before registering any domains/vhosts) checks out ok. When I try to create a virtual host I get the following:

Creating administration group blog ..
.. done
Creating administration user blog ..
.. done

Creating aliases for administration user ..
.. done

Adding administration user to groups ..
.. done

Creating home directory ..
.. done

Creating mailbox for administration user ..
.. done

Adding new DNS zone ..
.. done

Creating Nginx virtual host ..
.. Nginx website failed! : virtualmin-nginx::feature_setup failed : Missing file to open at WebminCore::/usr/share/webmin/web-lib-funcs.pl line 3017 at /usr/share/webmin/web-lib-funcs.pl line 1360.

Setting up log file rotation ..
.. no logging directive found in webserver configuration!

Creating MySQL login ..
.. done

Creating MySQL database blog ..
.. done

Creating SSL certificate and private key ..
.. done

Adding SSL to Nginx virtual host ..
.. no virtual host named blog.mydomain.com exists

Creating Webmin user ..
.. done

Re-starting DNS server ..
.. done

Re-loading Webmin ..
.. done

Saving server details ..
.. done

a check of the log shows the following:

Argument "32/64/128" isn't numeric in int at /usr/share/webmin/virtualmin-nginx/virtual_feature.pl line 136.
Missing file to read at virtualmin_nginx::/usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 236
Use of uninitialized value in addition (+) at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 282.
Use of uninitialized value in addition (+) at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 285.
Use of uninitialized value in subtraction (-) at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 287.
Use of uninitialized value $file in string eq at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 313.
Use of uninitialized value $file in string eq at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 313.
Use of uninitialized value $file in string eq at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 313.
Use of uninitialized value $file in string eq at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 313.
Use of uninitialized value in splice at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 292.
[10/May/2012:13:54:00 +0000] Reloading configuration
Status: 
Closed (fixed)

Comments

It is possible that Virtualmin isn't finding your Nginx configuration properly..

If you go (from the left menu) to Webmin -> Servers -> Nginx Webserver, does a virtual host for your new domain appear in the list of Nginx virtual hosts?

Hi James, It says:

Virtual Hosts
No http section was found in your Nginx config file /etc/nginx/nginx.conf. Maybe it is not setup as a webserver?

I had another error previously which I found a post about multi line directives not being processed correctly so I amended the nginx.conf file to this:

worker_processes 4;
events { worker_connections 1024; }
http { include mime.types; default_type application/octet-stream; server_names_hash_max_size 4096; server_names_hash_bucket_size 4096; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; keepalive_timeout 65; sendfile on; include /etc/nginx/sites-enabled/*; server_names_hash_bucket_size 128; }

Did splitting those directives across multiple lines fix the issue?

Would it be possible for you to attach your Nginx config file to this bug report?

Have attached both the current version and the original.

The original version looks better, but you should change the http and events block starts so that the { is on the same line. Like :

http {
etc..

Tried it and got the same error as before "Perl execution failed". Re-installed and had another go but still no luck. I had been using this stackscript (amended to install onto 12.04): http://www.linode.com/stackscripts/view/?StackScriptID=3229

So I tried another one: http://www.linode.com/stackscripts/view/?StackScriptID=3722

which again I amended to run on 12.04 and everything pretty much sailed through smoothly. No errors and I have a fully functioning virtualmin install serving multiple virtual hosts.

This guide was pretty useful: http://aeturnalus.com/software/setting-virtualmin-controlled-ubuntu-12-0...

Thanks for your help and also for your work in putting Webmin/Virtualmin. As soon as I have a few pennies saved I'll definitely be upgrading to the pro version.

gutiersa's picture
Submitted by gutiersa on Sat, 05/05/2018 - 11:19 Pro Licensee

Hi, I am working out of a Freebsd server with all applications installed from ports. I am still having this problem with the Virtualmin-Nginx module. All my applications are up to date. I am still getting this same error message:

 "Virtual Hosts:
 No http section was found in your Nginx config file /usr/local/etc/nginx/nginx.conf. Maybe it is not setup as a webserver?"

I already turned the http {...} section into one continuous line. I have verified all configurable options, but still having this problem.

Further more, when I attempt to make changes to the "global network configuration" I get the following error:

 "Missing file to read at virtualmin_nginx::virtualmin-nginx-lib.pl line 257"

If I click on "Mime Types" I get this error:

 "Error - Perl execution failed
 Can't use an undefined value as an ARRAY reference at /usr/local/lib/webmin/virtualmin-nginx/edit_mime.cgi line 24."

I am sure these errors are related, but I am not able to figure it out.

Thanks for any help you can provide me.

BTW, thanks for this thing of beauty that is Virtualmin.

Sandra

gutiersa - can you open a separate ticket for this?