NSLU2-Linux
view · edit · print · history

HowTo.ReverseProxy History

Hide minor edits - Show changes to markup

October 08, 2008, at 02:57 AM by colin gebhart -- formatting
Changed lines 67-70 from:

# killall nginx # /opt/sbin/nginx

to:
# killall nginx
# /opt/sbin/nginx
Changed lines 91-94 from:

# killall nginx # /opt/sbin/nginx

to:
# killall nginx
# /opt/sbin/nginx
October 08, 2008, at 02:54 AM by colin gebhart -- formatting
Changed lines 69-70 from:
      # /opt/sbin/nginx
to:

# /opt/sbin/nginx

Changed lines 94-95 from:
      # /opt/sbin/nginx
to:

# /opt/sbin/nginx

October 08, 2008, at 02:52 AM by colin gebhart -- formatting
Changed lines 68-70 from:

@@# killall nginx

        # /opt/sbin/nginx@@
to:

# killall nginx

      # /opt/sbin/nginx
Changed lines 93-95 from:

@@# killall nginx

        # /opt/sbin/nginx@@
to:

# killall nginx

      # /opt/sbin/nginx
October 08, 2008, at 02:50 AM by colin gebhart -- fixing error cause /opt/var/run/nginx.pid doesn\'t exist
Changed lines 66-69 from:

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

to:

Restart nginx

@@# killall nginx

        # /opt/sbin/nginx@@
Changed lines 91-94 from:

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

to:

Restart nginx

@@# killall nginx

        # /opt/sbin/nginx@@
October 08, 2008, at 02:36 AM by colin gebhart -- another minor change
Changed lines 59-60 from:

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

to:

Add the following lines to /opt/etc/nginx/nginx.conf http server section:

October 08, 2008, at 02:35 AM by colin gebhart -- correcting a few minor errors
Changed lines 50-51 from:

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

to:

Change /opt/etc/nginx/nginx.conf http server to listen on port 7007 instead of the default 8082

September 07, 2008, at 03:38 PM by BrianZhou -- lock
Changed lines 107-118 from:

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

to:

Page Password

Due to spam, lock the page with password being the same as page title, all lower case.

September 07, 2008, at 03:34 PM by BrianZhou -- revert from spam
Changed lines 1-118 from:

Cool site goodluck :) <a href=" http://community.vh1.com/Post/Cheapest-Airline-Tickets/053DF8A01018ADF530008009FB2F7 ">airline discount ticket military</a> zxypa

to:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

September 07, 2008, at 01:36 AM by Kwbafenc -- kJxtHiGTDCONbuMUZZr
Changed line 1 from:

i'm fine good work <a href=" http://community.vh1.com/Post/Airline-Discount-Ticket-Military/053DF8A01018ADF530008009FB2F4 ">Airline Discount Ticket Military</a> =-D

to:

Cool site goodluck :) <a href=" http://community.vh1.com/Post/Cheapest-Airline-Tickets/053DF8A01018ADF530008009FB2F7 ">airline discount ticket military</a> zxypa

September 06, 2008, at 11:07 PM by Pcygukdb -- HxynsQjaEvc
Changed line 1 from:

Very Good Site http://www.freewebtown.com/ticketsmaster/tragedy-tour-tickets.html Dirt Cheap Airline Tickets >:DD http://www.freewebtown.com/ticketsmaster/traffic-ticket-taxation.html cheap international airline tickets =]

to:

i'm fine good work <a href=" http://community.vh1.com/Post/Airline-Discount-Ticket-Military/053DF8A01018ADF530008009FB2F4 ">Airline Discount Ticket Military</a> =-D

September 06, 2008, at 10:52 PM by Ugufayes -- bsdluszbvkhKKGHhQf
Changed line 1 from:

Best Site Good Work <a href=" http://community.vh1.com/Post/Real-Time-Flight-Tracking/053DF8A01018ADF530008009FB2F3 ">Dirt Cheap Airline Tickets</a> 094

to:

Very Good Site http://www.freewebtown.com/ticketsmaster/tragedy-tour-tickets.html Dirt Cheap Airline Tickets >:DD http://www.freewebtown.com/ticketsmaster/traffic-ticket-taxation.html cheap international airline tickets =]

September 06, 2008, at 08:39 PM by Mpgmrppl -- UpONfTaFNcxDjtraOs
Changed line 1 from:

Best Site Good Work <a href=" http://community.vh1.com/Post/Military-Discount-Airline-Fares/053DF8A01018ADF530008009FB2F1 ">airline tickets for military families</a> 769665

to:

Best Site Good Work <a href=" http://community.vh1.com/Post/Real-Time-Flight-Tracking/053DF8A01018ADF530008009FB2F3 ">Dirt Cheap Airline Tickets</a> 094

September 06, 2008, at 06:01 PM by Xxfcerfo -- tTkIMoqlpgVY
Changed line 1 from:

I'm happy very good site <a href=" http://community.vh1.com/Post/Cheap-International-Airline-Tickets/053DF8A01018ADF530008009FB2E8 ">military discount airline fares</a> 122089

to:

Best Site Good Work <a href=" http://community.vh1.com/Post/Military-Discount-Airline-Fares/053DF8A01018ADF530008009FB2F1 ">airline tickets for military families</a> 769665

September 06, 2008, at 03:26 PM by Kbgpcmlo -- rNocAyvUYm
Changed line 1 from:
 <a href=" http://community.vh1.com/Post/Discounted-Tickets-For-Military/053DF8A01018ADF530008009FB2E2 ">Cheapest Airline Tickets</a>  64326
to:

I'm happy very good site <a href=" http://community.vh1.com/Post/Cheap-International-Airline-Tickets/053DF8A01018ADF530008009FB2E8 ">military discount airline fares</a> 122089

September 06, 2008, at 12:15 PM by Kobfzqpg -- HfARtIjPVVRttcrtqgr
Changed line 1 from:

good material thanks <a href=" http://community.vh1.com/Post/Airline-Tickets-For-Military-Families/053DF8A01018ADF530008009FB2DA ">cheap international airline tickets</a> 551581

to:
 <a href=" http://community.vh1.com/Post/Discounted-Tickets-For-Military/053DF8A01018ADF530008009FB2E2 ">Cheapest Airline Tickets</a>  64326 
September 06, 2008, at 09:44 AM by Woxtqqtf -- CIOMzGJfkxge
Changed line 1 from:

very best job <a href=" http://community.vh1.com/Post/Dirt-Cheap-Airline-Tickets/053DF8A01018ADF530008009FB2D0 ">cheap international airline tickets</a> oqvp

to:

good material thanks <a href=" http://community.vh1.com/Post/Airline-Tickets-For-Military-Families/053DF8A01018ADF530008009FB2DA ">cheap international airline tickets</a> 551581

September 06, 2008, at 07:09 AM by Scldsvqr -- KEFQBuDf
Changed lines 1-118 from:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

to:

very best job <a href=" http://community.vh1.com/Post/Dirt-Cheap-Airline-Tickets/053DF8A01018ADF530008009FB2D0 ">cheap international airline tickets</a> oqvp

September 06, 2008, at 05:42 AM by BrianZhou -- revert from spam
Changed lines 1-118 from:

Wonderfull great site <a href=" http://community.vh1.com/Post/Super-Cheap-Airplane-Tickets/053DF8A01018ADF530008009FB2BC ">airline discount ticket military</a> 57709

to:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

September 06, 2008, at 04:35 AM by Pahlsygx -- LpWhSCcxscXZI
Changed lines 1-118 from:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

to:

Wonderfull great site <a href=" http://community.vh1.com/Post/Super-Cheap-Airplane-Tickets/053DF8A01018ADF530008009FB2BC ">airline discount ticket military</a> 57709

August 31, 2008, at 01:53 PM by olivier heinry -- Restoring from spam
Changed lines 1-118 from:

Hello good day <a href=" http://forum.xnxx.com/member.php?u=207091 ">xnxx movies</a> %-)))

to:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

August 29, 2008, at 09:42 PM by Tqgghhew -- CAeLllzKaWXyGlhHQYU
Changed lines 1-118 from:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

to:

Hello good day <a href=" http://forum.xnxx.com/member.php?u=207091 ">xnxx movies</a> %-)))

August 29, 2008, at 12:55 PM by fcarolo -- undid spam
Changed lines 1-118 from:

It's serious <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24otra_pussy_tube ">Lolita Tube</a> %- <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24otmh_incest_tube ">Ebony Tube</a> =]] <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24otpl_lolita_tube ">Free Fucktube</a> xzxt

to:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

August 29, 2008, at 07:17 AM by Cicgpswl -- ygdDSWxOXpISghnu
Changed line 1 from:

this post is fantastic <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24ot7c_free_ebonytube ">Free Adulttube</a> %

to:

It's serious <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24otra_pussy_tube ">Lolita Tube</a> %- <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24otmh_incest_tube ">Ebony Tube</a> =]] <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24otpl_lolita_tube ">Free Fucktube</a> xzxt

August 28, 2008, at 08:54 PM by Vwtkzgns -- lMeNCISzHTwrRdBVCm
Changed lines 1-118 from:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

to:

this post is fantastic <a href=" http://www.lastfm.ru/user/Crowelz/journal/2008/08/24/24ot7c_free_ebonytube ">Free Adulttube</a> %

August 26, 2008, at 07:31 PM by fcarolo -- undid vandalism
Changed lines 1-118 from:

r8rkiR sdlfRnd6M2HvO4

to:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

August 26, 2008, at 05:55 PM by mikle -- MLxlrLXUvTHuAFAFST
Changed lines 1-118 from:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Launch nginx

# /opt/sbin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8008/;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/bin/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. nginx English wiki
  3. Nginx - Small, But Very Powerful and Efficient Web Server
  4. nginx and Rimuhosting

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

to:

r8rkiR sdlfRnd6M2HvO4

January 06, 2007, at 04:36 PM by Marcelo --
Added lines 106-118:

Update

In order to be able to run nginx successfull (if you install nginx only) you need also to install:

zlib openssl pcre libstdc++

please use ipkg install zlib (and the name of the other components previously listed)

CIAO

October 24, 2006, at 11:16 PM by BrianZhou -- added trailing / for cherokee proxy_pass
Changed line 62 from:
            proxy_pass      http://127.0.0.1:8008;
to:
            proxy_pass      http://127.0.0.1:8008/;
September 21, 2006, at 05:21 PM by BrianZhou -- added pointer to nginx english wiki
Added line 103:
  1. nginx English wiki
September 03, 2006, at 08:08 PM by BrianZhou -- beefed up, fine tune font
Changed lines 32-33 from:
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.
to:
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.
Changed lines 40-44 from:

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

to:

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php
Changed lines 50-51 from:

Change /opt/nginx/conf/nginx.conf http server to listen on 7007 instead of the default 80

to:

Change /opt/nginx/conf/nginx.conf http server to listen on port 7007 instead of the default 80

Changed lines 56-57 from:
  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.
to:
  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.
Changed lines 70-72 from:
  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.
to:
  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.
Changed lines 74-75 from:

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

to:

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

Changed lines 94-97 from:
  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!
to:
  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!
September 03, 2006, at 07:50 PM by BrianZhou -- beefed up
Changed line 62 from:
            proxy_pass      http://127.0.0.1:8081;
to:
            proxy_pass      http://127.0.0.1:8008;
September 03, 2006, at 07:48 PM by BrianZhou -- beefed up
Changed lines 54-55 from:

# /opt/bin/nginx

to:

# /opt/sbin/nginx

Changed lines 59-60 from:

Add the following lines to /opt/nginx/conf/nginx.conf http server:

to:

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

Changed lines 74-75 from:

Add the following lines to /opt/nginx/conf/nginx.conf http server:

to:

Add the following lines to /opt/nginx/conf/nginx.conf http server section:

Changed lines 88-89 from:

# /opt/php-fcgi -b 9009

to:

# /opt/bin/php-fcgi -b 9009

September 03, 2006, at 07:43 PM by BrianZhou -- beefed up
Changed lines 22-35 from:

Installation

# ipkg update
# ipkg install nginx

Configuration

... to add

Testing

... to add

References

  • nginx
  • Nginx - Small, But Very Powerful and Efficient Web Server
  • nginx and Rimuhosting
to:

Let's say we want to test nginx (localhost:7007) in front of cherokee (localhost:8008, an example of http web/app server) and PHP (localhost:9009, an example of fastcgi).

Preparation

Install cherokee and php-fcgi

# ipkg update
# ipkg install cherokee
# ipkg install php-fcgi
  • Browse to http://slug:8008 and you should see cherokee serving /opt/share/www/cherokee/ content.

Verify php-fcgi version

# /opt/bin/php-fcgi -v
PHP 5.1.6 (cgi-fcgi) (built: Aug 25 2006 08:50:32)
...

Prepare a simple info.php, with just a single line of "<?php phpinfo(); ?>"

# mkdir -p /opt/share/www/php
# echo "<?php phpinfo(); ?>" > /opt/share/www/phpinfo.php

Install, config & test nginx.

Basic setup

# ipkg install nginx

Change /opt/nginx/conf/nginx.conf http server to listen on 7007 instead of the default 80

Launch nginx

# /opt/bin/nginx

  • Browse to http://slug:7007/ and you should see nginx serving /opt/share/www/nginx/ content.

Add cherokee

Add the following lines to /opt/nginx/conf/nginx.conf http server:

        location /cherokee/ {
            proxy_pass      http://127.0.0.1:8081;
            proxy_redirect  default;
        }

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ (== /opt/nginx/html/) content.
  • Browse to http://slug:7007/cherokee/ and you should see cherokee serving /opt/share/www/cherokee/ content thru nginx.

Add php-fcgi

Add the following lines to /opt/nginx/conf/nginx.conf http server:

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9009;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /opt/share/www/php/$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }

Launching php-fcgi

# /opt/php-fcgi -b 9009

Bounce nginx

# kill -HUP `cat /opt/var/run/nginx.pid`

  • Browse to http://slug:7007/ and you should still see nginx serving /opt/share/www/nginx/ content.
  • Browse to http://slug:7007/cherokee/ and you should still see /opt/share/www/cherokee/ content.
  • Browse to http://slug:7007/info.php and you should now see the PHP info page!

Tighten security

Try to run PHP or app server as non-root, and only pass certain environment variables to PHP. See reference.

References

  1. nginx
  2. Nginx - Small, But Very Powerful and Efficient Web Server
  3. nginx and Rimuhosting
September 03, 2006, at 04:33 PM by BrianZhou --
Changed lines 27-28 from:
to:

... to add

Changed lines 30-31 from:

... this doc is still work in progress

to:

... to add

References

  • nginx
  • Nginx - Small, But Very Powerful and Efficient Web Server
  • nginx and Rimuhosting
September 03, 2006, at 03:52 PM by BrianZhou --
Changed lines 23-25 from:
  1. ipkg update
  2. ipkg install nginx
to:

# ipkg update
# ipkg install nginx

September 03, 2006, at 03:48 PM by BrianZhou --
Changed lines 3-4 from:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes the request to the corresponding server based on specified configuration. The advantage of this approach is:

to:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes requests to the corresponding server based on configuration. The advantage of this approach is:

Changed lines 17-18 from:

It makes a lot of sense to use nginx on the slug, in the following two scenarios:

to:

It makes a lot of sense to use nginx on the slug, especially in the following scenarios:

Added lines 21-30:

Installation

  1. ipkg update
  2. ipkg install nginx

Configuration

Testing

... this doc is still work in progress

September 03, 2006, at 06:37 AM by BrianZhou -- added URLs
Changed lines 15-16 from:

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

to:

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

September 03, 2006, at 06:33 AM by BrianZhou --
Changed line 19 from:
  1. If you want to use a slug to the fullest, and some of your content are dynamicly generated on the slug, yet you don't want to use a full web server;
to:
  1. If a slug is all you want to use, for dynamicly generated content as well as static content, yet you don't want to use a full web server;
September 03, 2006, at 06:30 AM by BrianZhou -- Added two scenarios
Changed lines 3-4 from:

ReverseProxy is a component that sits in front of web server(s) or app server(s), this is to add

to:

ReverseProxy is a component that sits in front of web server(s) or app server(s), and routes the request to the corresponding server based on specified configuration. The advantage of this approach is:

Changed lines 11-12 from:
  • Optionally serving static content by the reverse proxy server.
to:
  • Optionally, if the reverse proxy server supports, it can efficiently serve static content and thus let the app server(s) focus on dynamic content.
Changed lines 15-20 from:

On nslu2 with optware, there are pound and nginx as lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and efficiently serve static content.

to:

On nslu2 with optware, pound and nginx are two lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and serve static content.

It makes a lot of sense to use nginx on the slug, in the following two scenarios:

  1. If you want to use a slug to the fullest, and some of your content are dynamicly generated on the slug, yet you don't want to use a full web server;
  2. If you would like to use a slug as a reverse proxy in front of your other app server(s).
September 03, 2006, at 06:18 AM by BrianZhou --
Changed line 9 from:
  * With a reverse proxy server, different server technologies can mix and match and co-exists. Subsite1 maybe served by PHP, subsite2 by python django, subsite3 by RoR, and subsite34 by tomcat.
to:
  * With a reverse proxy server, you can mix and match different server technologies and have them co-exist. For example, subsite1 maybe served by PHP, subsite2 by python app, subsite3 by RoR, and subsite34 by tomcat.
Changed lines 15-17 from:

On nslu2 with optware, there are pound and nginx as lightweight reverse proxy servers. Pound is strictly "reverse proxy and load balancer" only, while nginx can also connect to upstream (backend) PHP server with fastcgi and efficiently serve static content.

to:

On nslu2 with optware, there are pound and nginx as lightweight reverse proxy servers. Pound is strictly a "reverse proxy and load balancer", while nginx can also connect to upstream (backend) PHP server with fastcgi protocol and efficiently serve static content.

September 03, 2006, at 06:09 AM by BrianZhou -- create the page
Added lines 1-17:

ReverseProxy is a component that sits in front of web server(s) or app server(s), this is to add

  • Security
    • App server can be behind reverse proxy server and not directly accessible
    • For selective subsite, reverse proxy server can add SSL encryption
  • Flexibility
    • With a reverse proxy server, different server technologies can mix and match and co-exists. Subsite1 maybe served by PHP, subsite2 by python django, subsite3 by RoR, and subsite34 by tomcat.
  • Scalability with load balancing.
  • Optionally serving static content by the reverse proxy server.

Using apache or even lighttpd for reverse proxy seems overkill.

On nslu2 with optware, there are pound and nginx as lightweight reverse proxy servers. Pound is strictly "reverse proxy and load balancer" only, while nginx can also connect to upstream (backend) PHP server with fastcgi and efficiently serve static content.

Page last modified on October 08, 2008, at 02:57 AM