Fix the Nginx module in Webmin (Ubuntu 18.04)

May 6, 2020
Posted by 
Andre

For a long time now, the Nginx plugin that exists for Webmin did not work after installing it on Ubuntu/Debian. I never got around to figure out how to fix this, but today I did. Here's how to fix the Nginx plugin in Webmin on a Ubuntu server.

Now in all honesty I have no idea what step of all the steps below did the trick of actually getting it to work, but I'm guessing it had something to do with the brackets in the config file. I still need to try this out on a different server without installing the Perl modules first. You're free to experiment yourself if you dare. If so, let me know what the specific fix was.

First of course you need to install the Nginx module for Webmin. It's a third party module, so add it using the correct option on the screen you see here.

webmin nginx

Search for Nginx, select it and install it. Once it is installed, you will find the tab on the left under Servers. If not, refresh your modules first. Chances are very likely that you will see a page with some errors that are Perl related. If this is the case, continue to follow these steps.

In webmin open the Others tab, and then Perl Modules. Choose "From CPAN, named" and search for DBD::mysql and install it. Do the same thing for all the following:

HTML::Entities
DBI
GD
DBD::mysql

If you run into any problems, you can alternatively install the plugin through the command line. To start, first use this command:

perl -MCPAN -e shell

Now you can install any plugin by entering:

i HTML::Entities

When it's installed, optionally do a "reload cpan" or install more plugins. Use te "quit" command to exit the perl inputline. If you're running the earlier mentioned command for the first time, you might also want to start of with "install CPAN" and "reload CPAN"

The next step may seem difficult, but it really isn't. We need to add some \ to a config file. So edit the following file and make the changes I placed below.

nano /usr/share/webmin/nginx/nginx-lib.pl

Go to line 199 and add a backslash before the opening bracket.

if ($if ($line =~ /server \{$/) {

Do not forget to add a backslash before the closing bracket on line 202.

if ($line =~ /\}$/) {

Save the file and now it should work after refreshing the Webmin Nginx page.

RATE THIS POST!

These related posts may also be of interest to you ▷

2 comments on “Fix the Nginx module in Webmin (Ubuntu 18.04)”

  1. Just editing the nginx-lib.pl file did the trick for me. Didn't touch any of the PERL modules.

Leave a Reply

Your email address will not be published. Required fields are marked *

◁ BACK

Menu

Subscribe

Receive notifications of new posts

In case you found any of the tutorials helpful, and you want to somehow show your appreciation, feel free to paypal me, or buy a slice of pizza for me.

Archives

Copyright © All rights reserved
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram