1. устанавливаем
cd /usr/ports/www/nginx
make install clean
создаем каталог где будут хранится наши сайты
cd /usr/local/www
mkdir websites
cd websites
mkdir home (каталог для первого сайта)
правим конфиг /usr/local/etc/nginx/nginx.conf
у меня такой
user www;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 512;
use kqueue;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
charset utf-8;
#access_log logs/host.access.log main;
location / {
root /usr/local/www/nginx;
index index.php index.html index.htm;
}
#error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
# php
location ~ \.php$ {
# root html;
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;
}
}
# another virtual host (второй хост)
server {
listen 80;
server_name www.home.loc home.loc;
charset utf-8;
location / {
root /usr/local/www/websites/home;
index index.php index.html index.htm;
}
# php
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/websites/home$fastcgi_script_name;
include fastcgi_params;
}
}
}
! в файл /etc/hosts добавляем
127.0.0.1 www.home.loc home.loc
2. ставим php
cd /usr/ports/lang/php55
make install clean (обязательно выбираем опцию FPM)
cd /usr/ports/lang/php55-extentions
make install clean
3. /etc/rc.conf
nginx_enable="YES"
php_fpm_enable="YES"
запускаем /usr/local/etc/rc.d/php-fpm start
/usr/local/etc/rc.d/nginx start
cd /usr/ports/www/nginx
make install clean
создаем каталог где будут хранится наши сайты
cd /usr/local/www
mkdir websites
cd websites
mkdir home (каталог для первого сайта)
правим конфиг /usr/local/etc/nginx/nginx.conf
у меня такой
user www;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 512;
use kqueue;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
charset utf-8;
#access_log logs/host.access.log main;
location / {
root /usr/local/www/nginx;
index index.php index.html index.htm;
}
#error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
# php
location ~ \.php$ {
# root html;
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;
}
}
# another virtual host (второй хост)
server {
listen 80;
server_name www.home.loc home.loc;
charset utf-8;
location / {
root /usr/local/www/websites/home;
index index.php index.html index.htm;
}
# php
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/websites/home$fastcgi_script_name;
include fastcgi_params;
}
}
}
! в файл /etc/hosts добавляем
127.0.0.1 www.home.loc home.loc
2. ставим php
cd /usr/ports/lang/php55
make install clean (обязательно выбираем опцию FPM)
cd /usr/ports/lang/php55-extentions
make install clean
3. /etc/rc.conf
nginx_enable="YES"
php_fpm_enable="YES"
запускаем /usr/local/etc/rc.d/php-fpm start
/usr/local/etc/rc.d/nginx start
Комментариев нет:
Отправить комментарий