Posts tagged nginx

php-logo

PHP-FPM + OPcache + Nginx + Capistrano stable deploy

2

Capistrano is great for deploying web applications. But the “current” symlink construction causes issues with PHP-FPM and OPcache enabled. PHP-FPM will display old pages after deployment or PHP-FPM just hangs. The hanging / freeze will result in your browser loading for minutes but you will just see a white screen.

To fix this, use $realpath_root instead of $document_root and set the SCRIPT_FILENAME in Nginx to pass to PHP-FPM.

fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
fastcgi_param  DOCUMENT_ROOT    $realpath_root;

This will pass the actual path “releases/20150208145800″ to PHP-FPM instead of “current” that is switched to the new release directory. OPcache can’t detect More >

Nginx

Configure Nginx 1.2 as proxy for Jira 5

0

By default Jira runs on a certain port, in this example at port 8090. It is accessible by http://example.com:8090/. This tutorial will make the Jira application available at port 80 with jira as path like: http://example.com/jira. Two configurations are possible, with or without SSL.

Make sure you perform all actions as root.

Without SSL

Change the file /opt/atlassian/jira/conf/server.xml file with:

nano /opt/atlassian/jira/conf/server.xml

Search for the part <Service name=”Catalina”> and make it look like:

<Service name="Catalina">         <Connector port="8090"            

More >

solr-4

Ubuntu 12.04 – Install Solr 4 with Jetty 9

8

This tutorial requires that Jetty is installed as described at http://pietervogelaar.nl/ubuntu-12-04-install-jetty-9.

In this tutorial we use an example project named “airport” and a core named “flight”.

cd /opt
wget http://apache.hippo.nl/lucene/solr/4.0.0/apache-solr-4.0.0.tgz
tar -xvf apache-solr-4.0.0.tgz
cp apache-solr-4.0.0/dist/apache-solr-4.0.0.war /opt/jetty/webapps/solr.war
cp -R apache-solr-4.0.0/example/solr /opt

Optionally you can copy the “dist” and “contrib” folder as while if you want to use the data import handler for example:

cp -r /opt/apache-solr-4.0.0/dist /opt/solr
cp -r /opt/apache-solr-4.0.0/contrib /opt/solr

Add to the bottom of /etc/default/jetty this line:

JAVA_OPTIONS="-Dsolr.solr.home=/opt/solr $JAVA_OPTIONS"

Add a Solr core, as example copy the More >

Nginx

Ubuntu 12.04 + Nginx 1.2.6 + PHP-FPM server block / vhost example

0

On the internet there is not a clean and good example that is basic and follows the best practices. Below I created a working server block / vhost or virtual host example that works on Ubuntu 12.04 and Nginx 1.2.6..

Read the page Nginx basic configuration carefully to understand how location directives work, it really explains it well! Especially this part is important:

Directives are processed in the following manner:

  • Exact string matches are processed first. If a match is found, nginx stops searching and fulfills the request.
  • Remaining literal string directives are processed next. If

More >

Go to Top