RSS

Nginx and php upload_max_filesize : other setups

30 May

Nginx and PHP-FPM Installation

inShare
Jump to: navigation, search

Nginx Installation in ProcessMaker has been included under an experimental section, since this installation has not being tested by QA Department yet, so this is not officialy supported by ProcessMaker.

Follow these instructions to install ProcessMaker 2.0 on top of a LNMP (Linux, Nginx, MySQL, PHP-FPM) stack in Ubuntu (Maverick Meerkat) 10.10 and later.

Nginx

nginx (pronounced “Engine X” is a lightweight, high-performance server. It’s used among websites with high traffic to improve page responses and serving external files (CSS, JS, images) faster and with less memory footprint than the Apache webserver.

PHP-FPM

PHP-FastCGI Process Manager is a set of patches for PHP to work with the FastCGI process manager, turning PHP-FPM into a service rather than loading all of its libraries everytime a PHP request it’s made. PHP-FPM it’s used in conjunction with Nginx to drastically improve performance and to deal with many concurrent users.

Install Nginx, PHP-FPM and MySQL

Please note: You need to have the Apache webserver uninstalled or stopped to install Nginx

Open a shell by going to Applications > Accessories > Terminal. Enter the following:

sudo apt-get install nginx mysql-server mysql-client php5-fpm php5-mysql php5-curl php5-cli php5-common php5-geoip php5-mcrypt php5-memcache php-xml-serializer php-xml-parser php-soap php5-ldap php5-gd

When apt-get installs MySQL, a dialog box will appear asking for a new root password for MySQL.

EnterMySQLRootPassword.png

Enter a password and select the option OK. If everything worked, you should be able to go to http://localhost

Install ProcessMaker

Follow the instructions at http://wiki.processmaker.com/index.php/2.0/ProcessMaker_Ubuntu_Installation#Install_ProcessMaker

Configure MySQL

Follow the instructions at http://wiki.processmaker.com/index.php/2.0/ProcessMaker_Ubuntu_Installation#Configure_MySQL

Configure PHP-FPM

Type this in your terminal:

sudo vi /etc/nginx/nginx.conf

locate the worker_processes line and change it to this:

worker_processes 5;

save the changes and close the file.

We also need to edit the php.ini file:

sudo vi /etc/php5/fpm/php.ini

Each ProcessMaker session needs a minimum of 80MB RAM to run properly, so set the memory_limit to 80M or greater:

memory_limit = 80M

In order to upload Input Documents, upgrade ProcessMaker and add plugins and languages, file_uploads need to be enabled:

file_uploads = On

ProcessMaker needs to use PHP’s short opening tags:

short_open_tag = On

If planning on uploading large Input Documents while running processes, the post_max_size and upload_max_filesize should be increased to more than the default 2MB. For instance, if planning on uploading files as large as 16MB, then:

post_max_size = 16M 
upload_max_filesize = 16M

Now we restart the PHP-FPM service:

sudo /etc/init.d/php5-fpm stop
sudo /etc/init.d/php5-fpm start

Configure Nginx

The last step is to configure Nginx. We’ll follow the same structure found on http://wiki.processmaker.com/index.php/2.0/ProcessMaker_Ubuntu_Installation#Configure_Apache but using nginx directives:

sudo vi /etc/nginx/sites-available/pmos

Copy and paste the following:

server {
listen your_ip_address:80;
server_name _;
root /opt/processmaker/workflow/public_html;
index index.html;
rewrite ^/.*/(.*)$ /sysGeneric.php last;
# Every PHP script must be routed to PHP-FPM
location ~ \.php$ {
     if(!-f $request_filename) { return 404; }
     fastcgi_pass     127.0.0.1:9000;
     fastcgi_index    index.php;
     fastcgi_param    SCRIPT_FILENAME   /opt/processmaker/workflow/public_html$fastcgi_script_name;
     include fastcgi_params;
  }
}

Replace your_ip_address with the IP number or domain name of the server running ProcessMaker. If only planning on running and accessing ProcessMaker on your local machine, then use the IP address “127.0.0.1”. If using ProcessMaker on a machine whose IP address might change (such as a machine whose IP address is assigned with DHCP), then just use “80”.

If your DNS or /etc/hosts has a defined domain for ProcessMaker, then use that domain instead of the underscore “_” on the server_name line. Otherwise, just leave it as it is.

Now we need to enable the processmaker site:

sudo ln -s /etc/nginx/sites-available/pmos /etc/nginx/sites-enabled/pmos

Restart the server

sudo /etc/init.d/nginx restart

Setting Up ProcessMaker

Follow the instructions at http://wiki.processmaker.com/index.php/2.0/ProcessMaker_Ubuntu_Installation#Setting_up_ProcessMaker

SSL on Nginx

Nginx has an SSL module which can be used with ProcessMaker. Read more at http://wiki.nginx.org/HttpSslModule

Advertisements
 
67 Comments

Posted by on May 30, 2013 in nginx

 

Tags: , ,

67 responses to “Nginx and php upload_max_filesize : other setups

  1. career in nursing

    July 2, 2013 at 8:12 am

    I simply couldn’t leave your web site prior to suggesting that I really enjoyed the standard information an individual supply on your visitors? Is going to be again incessantly to investigate cross-check new posts

     
  2. Luther

    July 3, 2013 at 2:50 am

    Good day! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in trading links or maybe guest
    authoring a blog article or vice-versa? My site goes over a lot of the same subjects as yours and I think we could greatly benefit from each other.
    If you might be interested feel free to send me an e-mail.
    I look forward to hearing from you! Excellent blog by the way!

     
  3. Frances

    July 3, 2013 at 4:37 am

    hello!,I like your writing so much! percentage we keep
    up a correspondence extra about your post on AOL?
    I require a specialist on this house to solve my problem.
    Maybe that is you! Taking a look forward to see you.

     
  4. Jeanette

    July 3, 2013 at 9:18 am

    Why visitors still make use of to read news papers when in this technological world the
    whole thing is existing on web?

     
  5. dietician and nutritionist

    July 3, 2013 at 11:55 am

    It’s wonderful that you are getting ideas from this article as well as from our argument made at this time.

     
  6. Natasha

    July 3, 2013 at 1:44 pm

    When someone writes an post he/she keeps the image of a user
    in his/her brain that how a user can know it.
    Thus that’s why this paragraph is outstdanding. Thanks!

     
  7. Clarissa

    July 4, 2013 at 6:28 am

    Greetings! Very useful advice within this article!
    It is the little changes that make the most important
    changes. Thanks a lot for sharing!

     
  8. career in nursing

    July 4, 2013 at 6:42 am

    Admiring the dedication you put into your site and
    detailed information you offer. It’s nice to come across a blog every once in a while that isn’t the
    same old rehashed material. Great read! I’ve bookmarked your site and I’m adding your RSS feeds to my
    Google account.

     
  9. myjuicymouth.com

    July 4, 2013 at 7:06 am

    It’s enormous that you are getting ideas from this article as well as from our discussion made here.

     
  10. Ashli

    July 4, 2013 at 7:38 am

    I quite like reading through an article that can make men and women think.
    Also, thank you for allowing for me to comment!

     
  11. nursing field

    July 4, 2013 at 8:05 am

    Hi to every one, it’s genuinely a nice for me to go to see this web page, it includes useful Information.

     
  12. gold

    July 4, 2013 at 8:31 am

    Good web site you have here.. It’s difficult to find good quality writing like yours these days. I truly appreciate people like you! Take care!!

     
  13. sleeping disorder

    July 4, 2013 at 1:27 pm

    Ahaa, its fastidious dialogue about this article here at this website, I have read all that, so at this time me also commenting at this place.

     
  14. Chelsey

    July 4, 2013 at 1:47 pm

    There is definately a great deal to learn about this issue.
    I really like all the points you’ve made.

     
  15. fetishfinder.net

    July 4, 2013 at 3:53 pm

    Thanks a bunch for sharing this with all people you really recognise what you’re talking approximately! Bookmarked. Please additionally consult with my web site =). We can have a hyperlink exchange contract between us

     
  16. penis ist nicht beschnitten

    July 13, 2013 at 10:27 am

    On the penis ist nicht beschnitten arms associated with a well-informed
    operator Redi-Trax offers great outcomes.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: