-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"start" and "server-configuration" pages added
- Loading branch information
Showing
6 changed files
with
136 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.idea | ||
.svn/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[title[=Настройка сервера]] | ||
[sidemenu[ru/manual/sidemenu]] | ||
[menu server configuration[= | ||
<ul> | ||
<li><a href="#nginx">Nginx</a></li> | ||
</ul> | ||
]] | ||
<article> | ||
<header> | ||
<h1>Настройка веб-сервера для работы PinPIE</h1> | ||
</header> | ||
|
||
<section> | ||
<header> | ||
<h1> | ||
<a name="nginx" href="#nginx">#</a> | ||
Nginx | ||
</h1> | ||
</header> | ||
<h2>Простой</h2> | ||
<code class="nginx"> | ||
<pre>server { | ||
server_name site.com; | ||
root /var/www/site.com/; | ||
access_log /var/log/nginx/site.com.access.log main; | ||
|
||
location / { | ||
fastcgi_pass unix:/var/run/php-fpm.sock; | ||
fastcgi_param SCRIPT_FILENAME $document_root/index.php; | ||
fastcgi_read_timeout 30s; | ||
include /etc/nginx/fastcgi_params; | ||
} | ||
|
||
location ~* ^.+\.(jpg|jpeg|gif|ico|txt|png)$ { | ||
access_log off; | ||
} | ||
}</pre> | ||
</code> | ||
<h2>С шардингом статик серверов</h2> | ||
<code> | ||
<pre>server { | ||
server_name site.com; | ||
root /var/www/site.com/; | ||
access_log /var/log/nginx/site.com.access.log main; | ||
|
||
location / { | ||
fastcgi_pass unix:/var/run/php-fpm.sock; | ||
fastcgi_param SCRIPT_FILENAME $document_root/index.php; | ||
fastcgi_read_timeout 30s; | ||
include /etc/nginx/fastcgi_params; | ||
} | ||
|
||
location ~* ^.+\.(jpg|jpeg|gif|ico|txt|png)$ { | ||
access_log off; | ||
} | ||
} | ||
|
||
server { | ||
server_name s1.site.com s2.site.com s3.site.com; | ||
root /var/www/site.com/; | ||
}</pre> | ||
</code> | ||
<h3></h3> | ||
</section> | ||
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,68 @@ | ||
[title[=Начало работы с PinPIE]] | ||
[sidemenu[ru/manual/sidemenu]] | ||
[menu start[= | ||
<ul> | ||
<li><a href="#entry-point">Точка входа</a></li> | ||
<li><a href="#preinclude">preinclude.php</a></li> | ||
</ul> | ||
]] | ||
<article> | ||
<header> | ||
<h1>Начни использовать PinPIE</h1> | ||
</header> | ||
<section> | ||
<header> | ||
<a name="dfdf">#</a> | ||
<h1></h1> | ||
<h1> | ||
<a name="entry-point" href="#entry-point">#</a> | ||
Точка входа | ||
</h1> | ||
</header> | ||
<p> | ||
Для запуска PinPIE необходимо инклудить его в главной точке входа вашего проекта, | ||
а все запросы направить на этот файл. | ||
Обычно, главная точка входа в код сайта это "/index.php". | ||
Чтобы PinPIE начал работать, внутри этого файла должна быть такая строчка: | ||
</p> | ||
<?= pcx('include "pinpie/pinpie.php";') ?> | ||
<p>В принципе, это всё, что требуется для того, чтобы начать использовать PinPIE.</p> | ||
<p> | ||
Обеспечить направление всех запросов на "/index.php" или другой файл можно в конфиге веб-сервера. | ||
Примеры конфигов можно найти в разделе документации по | ||
<a href="/ru/manual/server-configuration">конфигурации сервера</a>. | ||
</p> | ||
</section> | ||
<section> | ||
|
||
<section> | ||
<header> | ||
<h1>Точка входа</h1> | ||
<h1> | ||
<a name="preinclude" href="#preinclude">#</a> | ||
Файлы preinclude.php и postinclude.php | ||
</h1> | ||
</header> | ||
<p>PinPIE require to be included in main entry point of your project, and all requests have to be rerouted to that file. Generally, the main entry point for site code is `ROOT/index.php`. This file require to have `include 'pinpie/pinpie.php';` line to start PinPIE working.</p> | ||
<p>This, in fact, are the only things you have to do to start using PinPIE.</p> | ||
<h2>About preinclude.php and postinclude.php</h2> | ||
<p> | ||
For every request there are to files, that will be included if they exist. Before processing a page file `ROOT/preinclude.php` will be included. And `ROOT/postinclude.php` will be included after page is processed and assembled. If you will upgrade PinPIE with new version, this files will not be overwritten, because this | ||
files doesn't exist in PinPIE project. So feel free to modify them corresponding your needs.</p> | ||
При каждом запросе PinPIE попытается подключить два файла, если они существуют: | ||
<?= scx("ROOT/preinclude.php") ?> и <?= scx("ROOT/preinclude.php") ?>, | ||
где <?= scx("ROOT") ?> это <a href="/ru/manual/constants#root">константа корневого пути</a>. | ||
Пути к этим файлам можно изменить в <a href="http://pinpie.ru/ru/manual/config">конфиге</a>. | ||
</p> | ||
<p> | ||
Сначала проверяется существование файла <?= scx("ROOT/preinclude.php") ?>. | ||
Если он есть — он инклудится. Его отличие от <?= scx("ROOT/index.php") ?> в том, | ||
что в момент его инклуда уже заданы основные параметры PinPIE: прочитан конфиг, | ||
определён файл-обработчик запроса <?=scx('PinPIE::$document', 'php')?>, который можно изменить | ||
по своему усмотрению. | ||
</p> | ||
<p>Данный файл подходит для размещения кода автозагрузчика классов. | ||
Впрочем, для этой задачи подходит и <?= scx("ROOT/index.php") ?>.</p> | ||
<p> | ||
Потом, когда закончена обработка запроса, PinPIE пытается включить файл <?= scx("ROOT/preinclude.php") ?>. | ||
Этот файл подходит для вывода дебаг информации и отложенных действий, | ||
например с помощью <a href="http://php.net/manual/en/function.fastcgi-finish-request.php">fastcgi_finish_request()</a>. | ||
</p> | ||
<p> | ||
При обновлении файлов PinPIE на новую версию, эти файлы не пропадут и не будут перезаписаны, | ||
т.к. они отсутствуют в самом PinPIE. Так что можете уверенно использовать эти файлы | ||
для своих нужд. | ||
</p> | ||
</section> | ||
</article> |