Trials & Tribulations

  • Home
  • AMAZON.CA

Step by step install Engine X (nginx) and php-fpm in FreeBSD

Posted by admin on September 8, 2009 – 4:12 pm      
Filed under BSD, phpBB, server side
Tagged as

1. Install nginx

# cd /usr/ports/www/nginx
# make install

choose :

HTTP_MODULE
HTTP_REWRITE_MODULE
HTTP_SSL_MODULE
HTTP_STATUS_MODULE
.....

2. Install php

# cd /usr/ports/lang/php5
# make install

choose :

CLI
CGI
SUHOSIN
IPV6
FASTCGI
PATHINFO
.....

3. Install php-fpm freebsd ports

# wget

save.

edit /usr/local/etc/nginx/nginx.conf

Find this lines in nginx.conf and adjust :

root /usr/local/www/nginx;

location / {
index index.php index.html index.htm;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/nginx$fastcgi_script_name;
include fastcgi_params;
}

Edit /usr/local/etc/php-fpm.conf

Find these lines :

nobody –>
nobody –>

change nobody into www (or your www user)

www
www

Run the services

# /usr/local/etc/rc.d/php-fpm start
# /usr/local/etc/rc.d/nginx start

5. Testing

# cd /usr/local/www/nginx

# nano info.php

save.

done.

Compatible with Apache’s log file format

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                        '$status $body_bytes_sent "$http_referer" '
                        '"$http_user_agent" "$http_x_forwarded_for"';

FROM HERE

Permalink - Comments RSS Feed - Post a comment - Trackback URL

Post a Comment

Click here to cancel reply.

Your email is never published nor shared. Required fields are marked *

*
*

  • Subscribe

  •  

    September 2009
    M T W T F S S
    « Aug   Oct »
     123456
    78910111213
    14151617181920
    21222324252627
    282930  
  • Pages

    • AMAZON.CA
  • Archives

    • June 2011
    • May 2011
    • April 2011
    • October 2010
    • September 2010
    • June 2010
    • January 2010
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
  • Categories

    • BSD
    • Drupal
    • JeepKings.ca
    • Joomla
    • life
    • nginx
    • phpBB
    • police
    • postfix
    • python
    • server side
    • The Game
    • TODO
    • Uncategorized
    • WEB-DEV-LOG


Content © Trials & Tribulations. Proudly powered by WordPress 20 queries, 0.086 seconds.

"Black Hat" theme by Nicki Faulk. For best results, please view with Firefox.   [ Log in ]