среда, 6 ноября 2013 г.

Установка Nginx + PHP + MariaDB


MariaDB

Для ubuntu saucy

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mirror.timeweb.ru/mariadb/repo/5.5/ubuntu saucy main'

sudo apt-get update
sudo apt-get install mariadb-server mariadb-client

Для других дистрибутивов надо смотреть инструкции https://downloads.mariadb.org/mariadb/repositories/



Nginx

sudo apt-get install nginx



PHP

sudo apt-get install php5-cli php5-common php5-mysql php5-gd php5-fpm php5-cgi php5-fpm php-pear php5-mcrypt php5-curl php5-imap php5-memcache php5-xsl php5-json


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

cgi.fix_pathinfo = 0



sudo gedit /etc/php5/fpm/pool.d/www.conf

security.limit_extensions = .php



sudo gedit /etc/nginx/sites-available/default

server {
listen 80;

index index.php index.html;

server_name *.localhost;

root /home/user/www/$subdomain;

set $subdomain "";

if ($host ~* ^([a-z0-9-\.]+)\.localhost$) {
set $subdomain $1;
}

location / {

try_files $uri $uri/ /index.php /index.html;

}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

location ~* \.(?:jpg|ico|gif|png|css|js|svg)$ {
access_log off;
expires 30d;
}
}

Комментариев нет:

Отправить комментарий