virtualmin + nginx

The Nginx support has been built so that it would be your only web server, in place of Apache. It’ll work great for those on VPS’s, and other low-memory systems, as well as for folks on dedicated servers who feel it’s speedier.

So while you could manually configure it to work as a front-end proxy, Virtualmin won’t assist with that setup.

Might there be a feature to use Nginx as a proxy later? Sure, maybe! But, we’re working to get this first version out the door, and then we can discuss other features such as that.

Will it work on Virtualmin GPL? That I’m not sure of yet. It was a costly feature to create, and it’s possible that it could be given to the Pro users for a bit, and then after a few months put into Virtualmin GPL. But we also know that users of both Pro and GPL would benefit from it, so a final decision hasn’t been made there yet :slight_smile:

-Eric

I would also like to see this in the GPL version. But probably the target audience are users with a lot of visitors on their site. They probably make a lot of money with their high volume sites :slight_smile:

@up
The rest of audience are users who’s working with VPS or small servers and need to save their resources ; ), but I understand that you expects to get paid for your job, hopes that it will be aviable for VM GPL someday.

Virtualmin Pro is a great investment and not that expensive really. I don’t see how anyone running more than a couple of sites could not justify the small annual fee. For the amount of support we get from Eric, Joe, Jamie, and the rest of the team, and the continual improvement that is put into the product, I’m very happy to purchase Virtualmin Pro.

Thanks Virtualmin you make my life so much easier! Can’t wait to test out nginx.

1 Like

First off, congratulations on including Nginx in the latest version of Virtualmin, I’m sure lots of blood, sweat and tears went into this.
I’ve been looking forward to this for quite some time and have started testing this new feature.

I have just a single question really.
What is the best way to get PHP-FPM supported within Virtualmin?

Running on CentOS 6 I notice you use the old FastCGI without a manager, which is very easy to break (Just hit it with some traffic and the process dies)
Also, it means that every site will gobble up at least 64 mb (my settings) even when there is no traffic.
With Apache you can have these FastCGI processes reclaimed and I believe php-fpm supports the same.

bvansomeren,

I believe they are still working on nginx integration. I too tried to follow the direction’s given, but when I tried to setup a new server the nginx configuration failed. Hopefully they’ll let us know when it’s ready for beta testing.

Sure it probably needs some work, but I’ve been able to get some sites running on it fine with 3.89
I did add the rewrite rules manually to the configuration because I was unsure to to use the rewrite config option in the GUI (the try files command is very simple to add)

My biggest issue is the ancient fastcgi spawn that is being used over php-fpm.
This is not a flaw in Virtualmin though, I believe both CentOS (5 and 6) and Debian don’t come with php-fpm out of the box.

bavnsomeren,

How did you get it to work? Were you doing a new install on CentOS 6? Can you tell me the steps you followed?

I followed the steps given in the documentation, but when I try to enable Nginx in the plugin and features page it fails at the nginx configuration. Then when I try to create a virtual server I get the same failed nginx failed configuration.

I had to also manually input the nginx full command path in order to try to enable nginx on the plugin and features page.

There does appear to be a bug where Virtualmin isn’t detecting Nginx by default; to correct that, you can go into System Settings -> Features and Plugins -> Nginx website -> Configure, and set “Full path to Nginx command” to “/usr/sbin/nginx”. By default, that appears to be blank.

There’s a bug report regarding that issue filed here:

https://www.virtualmin.com/node/20451

Hi,

Yes, I had to do the same.
Also I moved nginx to port 8080 because I place Varnish in front of the webserver.
Once the config is setup, everything works like a charm.

Well, except for the PHP problem I mentioned.
Let’s hope this is something that is in the pipeline.

Hi, this new module to support alternate webservers is great.

I haven’t seen any code or specs (only read here: http://www.virtualmin.com/documentation/web/nginx) so I’m interested in knowing how Nginx is configured within the server environment.
Some setups have Nginx as a static file server proxy passing dynamic content requests to Apache running on a different port.

I’m interested in whether Nginx will run standalone without Apache as a backend. I currently have the following setup on a server in production and it’s fairly screaming along.

  • Nginx serving static content
  • passing PHP requests off to PHP-FPM
  • PHP-FPM backend is running as a Unix socket, not on a TCP port
  • APC or other opcode caching system in use.

PHP FastCGI Process Manager (http://php-fpm.org/) allows you to run PHP as a process per user. PHP can be restarted or the separate per user processes killed if required.

This is currently the fastest way to serve PHP content on the planet and the load profile for Nginx is shockingly low compared to Apache. I’m still astounded at how fast this setup runs as compared to Apache + PHP using Fcgi.

I’d be interested to know if Nginx + PHP-FPM could be run that way using this new module. Am happy to help out with testing or sample configurations if required.

If Virtualmin could run Nginx + PHP-FPM like this it would be a fair step ahead of any other hosting control panel, open or closed source.

Thanks again

James

Howdy,

Virtualmin sets up Nginx so that it passes off PHP requests to FCGID. It doesn’t need Apache to work though, Nginx is standalone.

Jamie is currently looking into PHP-FPM support, though that doesn’t exist as of yet.

You could certainly setup PHP’s APC module to work alongside that as well.

Does that answer your question?

-Eric

Hi Eric

That’s great and just the info I was after. A lot of Nginx howtos set it up to pass PHP requests through to Apache/FCGID running on another port. Having it standalone is the faster option.

I have a server setup running Nginx + PHP-FPM and it’s blisteringly fast. Happy to help with any config for this setup as I’ve “been there, done that”.

Cheers
James

Hi jameser,

I made a Nginx conf using nginx as a proxy serving static files and forwarding php stuffs to Apache with mod_php, that works really great.
I would be happy to share that and have some informations on how you did the Nginx+PHP-FPM and make Nginx + apache+fcgi work with the user as owner of the virtual host !

andreychek, can we add some posts on the online the documentation ? (reviewed of course :slight_smile: )

Regards,
Marc.

Howdy,

Yup, feel free to share configs (and links to configs)!

And if some cases, we may ask if we can borrow them for our documentation section :slight_smile:

Hi

Aps for the silence, I’ve been beavering away on some configs… what’s the best way to share them ? I can email them or post them to a blog. Obv in public, anyone can use them but you know I want virtualmin to get the jump :wink:

I’d be interested in some feedback on the configs, I’m sure there will be some questions.

Thanks
James

Howdy,

Well, it’d be great if other Virtualmin folks were able to take advantage of them – is there any chance you could start a new forum thread, and either post your configs, or links to your blog posts containing the configs?

And then, folks could offer their feedback in that new forum thread you start.

Thanks!

-Eric

Did anybody compare the new Apache 2.4 version with Nginx. It is supposedly more efficient and faster than Ngix (but still has much bigger feature set than Nginx)? I would be interested in the results.

Hi I found this comparison not a perfect one but seem apache is still ram hungry.
http://mondotech.blogspot.com/2012/02/apache-24-vs-nginx-benchmark-showdown.html

look here http://canmp.googlecode.com