TurnKey Linux Virtual Appliance Library

TKLPatch - nginx + php + mysql

I have worked on my first tkl patch -- an nginx webserver.  It is not quite ready for release, there are a couple things I need some help with.  (Please move this to the support forum if it is more appropriate.)

Current status:

  • Nginx server pulling latest stable version from nginx ppa.
  • PHP 5.3.2 from lucid repos
  • php-fpm from Brian Mercer's ppa
  • APC and Memcached (I haven't tested these yet)
  • MySQL, and webmin-mysql package
  • PHPMyAdmin on port 12322 over https
  • I took the default home page from the LAMP server and modified it.

Problems:

  • There is an issue with the phpmyadmin.conf.  During the build, it says it can't import the data.  After you boot to a new instance from the patched iso, you can't log into phpmyadmin using your root password until you manually update the password for the mysql admin account.  I also noticed you are not prompted for MySQL passwords during the install.
  • I would like to display the phpmyadmin address on the confconsole. Fixed.
  • I am currently using a ppa for php-fpm.  I would really like to use php5.3.3 instead.  I see nginx has a ppa for it (it's commented out in the conf script).  Whenever I tried using it, apache2 kept coming up as a dependency (I think from the php5 package).  I don't want apache running in this.
  • I am not aware of a webmin module for nginx.  If there is one, please let me know and I can include it.
  • I have not yet created a phpinfo() page. Fixed.

I started from Basil's LAMP patch and modified it by removing the apache stuff and then put in the nginx stuff, so I thought the mysql/phpmyadmin configs wouldn't have any issues.  Also, since I don't really have any experience with nginx configuration, any comments would be appreciated!

Currently the patch is located at http://github.com/slacker/tklpatch-nginx.  Feel free to fork it and help out.  I will upload a tarball here once the major bugs are worked out.

Jeremy's picture

Good on you Dan!

I have only just released my first TKLPatch too (incomplete), although yours looks a little more involved than mine! I like the idea of putting the patch on github, someone else has done that too I think. I will look into that because github seems like a great way to allow others to be easily involved.

BTW I think that for TKLPatches, even in an incomplete state, here in the general forum is the right place (until we get a dedicated TKLPatch forum anyway!) although Alon & Liraz may correct me.

Basil Kurian's picture

I have submitted the patch


Wish I saw that earlier!

Wow, I honestly didn't see that before.  I will definitely take a look at it.

Some differences spotted

I see that we are doing some things a little differently.  The question is what would be best for a TKL appliance?  My goal with this is to have a patch that builds an appliance to my specifications for my personal use.  So I will keep on refining this until it is as good as I can get it.  I am definitely open to discussing ideas on how to make it better.  Thanks!

Jeremy's picture

I don't think that its all bad

Whilst in some respects it may be a waste of effort to replicate something that someone else has already done. OTOH there are often many different approaches to acheive the same (or similar) ends.

Having multiple patches for same or similar appliances allows Liraz and Alon to look at the different approaches and decide which they think is best. Perhaps they may choose to pick bits from each, or maybe do it a completely different way altogether. Regardless the work that is put in is never really wasted because at the very least it raises awareness about different software (as many of your patches have Basil) and may highlight differing usage scenarios and configurations. Also as there is usually a degee of research involved in TKLPatching it will almost always save the devs some leg work regardless of which direction they take with a patch.

I guess though that in this situation, even if Dan had decided to take a different path it may well have been useful for him to have tweaked Basil's patch to his desire or to at least recycle some of his work.

Anyway... Good work all round I say!

Liraz Siri's picture

A comparison of LEMP stacks

Congratulation Dan on your first TKLPatch! Don't worry about the overlap with Basil's earlier patch. There has been a lot of development activity recently and it's easy to miss stuff. A few days ago JedMeister suggested we should summarize all development activity on the development wiki, but we haven't gotten around to that yet. So much to do, so little time...

Anyhow, I took a look at your patch and compared it with Basil's:

Nginx installation: You installed nginx from a PPA (0.7.67-4) while Basil installed it from Lucid universe (0.7.65). When a package is already available in the standard distribution there has to be a compelling reason to go for an unofficial PPA due. In general, using a PPA has security and stability implications.

FastCGI integration: Basil used php5-cgi with some glue code to support FastCGI. You used php5-fpm from a PPA. Same concerns as above. On a personal note, I've been using php5-cgi to provide FastCGI services on one of my servers and it works very well.

memcached integration: Dan, could you elaborate a bit regarding the rational for including memcached in your LEMP stack? We haven't included that in the TurnKey LAMP stack because we figured anyone sophisticated enough to need/use memcached in their applications could easily install it themselves, and for everyone else it would just be another unnecessary process. Perhaps you have a different take on this?

Opcode optimizers - APC vs xcache: Basil included xcache for opcode optimization. Dan went with APC. I know a couple of years back when I last checked APC had stability issues with many programs. I've been using xcache myself and have been happy with it, but I'm hearing that APC is the "officially blessed" solution that will eventually get built into PHP 6. I'd love to hear more thoughts from the community on the pros and cons of each. Not only for the LEMP stack but also for the new LAMP stack and all dependent appliances.

Nginx appliance

hey folks.  I just wanted to share with this community the appliance I made.   It uses Nginx with the conditional cache purge module for caching with Nginx instead of a plugin.   I like turnkey but the appliance I wanted wasnt here so I built my own.

have a look

http://maximize-seo.com/xpress-ubuntu-virtual-appliance/

critique or suggestions welcome

Wayne

Jeremy's picture

Did you try the TKL Nginx appliance?

The TKL Nginx applince is here: http://www.turnkeylinux.org/nginx-php-fastcgi

If so what wasn't near enough on that to base your build? What would you recommend the TKL devs do to change their appliance and why?

I wanted to follow the

I wanted to follow the WordPress codec as closely as possible.  I also wanted Nginx to cache Wordpress which means you need the conditional cache purge module to purge the cache.

I tried one of the appliances honestly cant remember if this was the one.

mind you I built it with WordPress in mind.

I dont see apc either.  Nginx without APC or someother caching method isnt going to wow anyone

Also something I wish my appliance had is https://github.com/pagespeed/ngx_pagespeed module....that would be cool that just came out though.

Pretty impressed with you guys and hope posting a link to my appliance didnt rub anyone the wrong way.  I came looking for a fast way to spin out Nginx/WordPress server with caching setup couldnt find it built my own.

cheers

PS srry bout resserecting the long dead post wasnt paying attention

old post is old

damnit  this is 2 years old /sigh

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)