We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Шаблон для phpBB Topic is solved
Шаблон для phpBB
Привет! Есть ли в природе шаблон Nginx для phpBB?
Пробовал сделать сам, но в итоге не получилось :(
Пробовал сделать сам, но в итоге не получилось :(
-
- Support team
- Posts: 1111
- Joined: Tue Jul 30, 2013 10:18 pm
- Contact:
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: Шаблон для phpBB
Вот можно взять как образец, к примеру: https://github.com/phpbb/area51-phpbb3/ ... ample.conf
Re: Шаблон для phpBB
Так я его и брал как образец, но секцию install так и не смог заставить работать.grayfolk wrote: ↑Thu Nov 22, 2018 10:33 pmВот можно взять как образец, к примеру: https://github.com/phpbb/area51-phpbb3/ ... ample.conf
-
- Support team
- Posts: 1111
- Joined: Tue Jul 30, 2013 10:18 pm
- Contact:
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: Шаблон для phpBB
Сделал так:
Code: Select all
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# Correctly pass scripts for installer
location /install/ {
# phpBB uses index.htm
try_files $uri $uri/ @rewrite_installapp;
# Pass the php scripts to fastcgi server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /install/app.php$is_args$args;
fastcgi_pass 127.0.0.1:9014; // - должно быть то же самое, что и в секции location / дефолтного шаблона
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /install/app.php/$1 last;
}
Re: Шаблон для phpBB
Спасибо за конфиг, помогло. Инсталляция прошла, но теперь если зайти на сайт по адресу http://site.ru (без файла index.php) выдает сообщение:grayfolk wrote: ↑Fri Nov 23, 2018 9:35 amСделал так:
Code: Select all
location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } # Correctly pass scripts for installer location /install/ { # phpBB uses index.htm try_files $uri $uri/ @rewrite_installapp; # Pass the php scripts to fastcgi server specified in upstream declaration. location ~ \.php(/|$) { # Unmodified fastcgi_params from nginx distribution. include fastcgi_params; # Necessary for php. fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; try_files $uri $uri/ /install/app.php$is_args$args; fastcgi_pass 127.0.0.1:9014; // - должно быть то же самое, что и в секции location / дефолтного шаблона } } location @rewrite_installapp { rewrite ^(.*)$ /install/app.php/$1 last; }
С файлом index.php все ок:
Можете поделиться вашим полным шаблоном?
Мой шаблон:
Code: Select all
server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
auth_basic "Restricted";
auth_basic_user_file /usr/local/vesta/.htpasswd;
location / {
# phpBB uses index.htm
index index.php index.html index.htm;
try_files $uri $uri/ @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# Deny access to internal phpbb files.
location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
deny all;
# deny was ignored before 0.8.40 for connections over IPv6.
# Use internal directive to prohibit access on older versions.
internal;
return 404;
}
# Pass the php scripts to fastcgi server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /app.php$is_args$args;
fastcgi_index index.php;
fastcgi_pass %backend_lsnr%; # - должно быть то же самое, что и в секции location / дефолтного шаблона
}
# Correctly pass scripts for installer
location /install/ {
# phpBB uses index.htm
try_files $uri $uri/ @rewrite_installapp;
# Pass the php scripts to fastcgi server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /install/app.php$is_args$args;
fastcgi_pass %backend_lsnr%; # - должно быть то же самое, что и в секции location / дефолтного шаблона
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /install/app.php/$1 last;
}
# Deny access to version control system directories.
location ~ /\.svn|/\.git {
deny all;
internal;
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
# include %home%/%user%/conf/web/%domain%.auth
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
}
Re: Шаблон для phpBB
Проблема решилась. У корневой директории отсутствовали права чтения для анонимов.
Re: Шаблон для phpBB
та же проблема не запускается установка форума phpBB
при нажатии на вкладку install показывает ошибку 404
использую такой конфиг для ngnix
это то что vesta сама сделала плюс секция location от grayfolk из этой темы
при нажатии на вкладку install показывает ошибку 404
использую такой конфиг для ngnix
это то что vesta сама сделала плюс секция location от grayfolk из этой темы
Code: Select all
server {
listen 192.168.0.21:80;
server_name kkk.kk www.kkk.kk;
root /home/admin/web/kkk.kk/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/kkk.kk.log combined;
access_log /var/log/nginx/domains/kkk.kk.bytes bytes;
error_log /var/log/nginx/domains/kkk.kk.error.log error;
location / {
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias /home/admin/web/kkk.kk/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location /vstats/ {
alias /home/admin/web/kkk.kk/stats/;
include /home/admin/conf/web/kkk.kk.auth*;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# Correctly pass scripts for installer
location /install/ {
# phpBB uses index.htm
try_files $uri $uri/ @rewrite_installapp;
# Pass the php scripts to fastcgi server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /install/app.php$is_args$args;
fastcgi_pass 127.0.0.1:9001;
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /install/app.php/$1 last;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include /home/admin/conf/web/nginx.kkk.kk.conf*;
}
Re: Шаблон для phpBB
При таком конфиге получаю
500 Internal Server Error
да Vesta стоит на Сentos 7 на виртуалке в локальной сети
500 Internal Server Error
да Vesta стоит на Сentos 7 на виртуалке в локальной сети
Code: Select all
server {
listen 192.168.0.21:80;
server_name kkk.kk www.kkk.kk;
root /home/admin/web/kkk.kk/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/kkk.kk.log combined;
access_log /var/log/nginx/domains/kkk.kk.bytes bytes;
error_log /var/log/nginx/domains/kkk.kk.error.log error;
location / {
# phpBB uses index.htm
index index.php index.html index.htm;
try_files $uri $uri/ @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# Deny access to internal phpbb files.
location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
deny all;
# deny was ignored before 0.8.40 for connections over IPv6.
# Use internal directive to prohibit access on older versions.
internal;
return 404;
}
# Pass the php scripts to fastcgi server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /app.php$is_args$args;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9001; # - должно быть то же самое, что и в секции location / дефолтного шаблона
}
# Correctly pass scripts for installer
location /install/ {
# phpBB uses index.htm
try_files $uri $uri/ @rewrite_installapp;
# Pass the php scripts to fastcgi server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /install/app.php$is_args$args;
fastcgi_pass 127.0.0.1:9001; # - должно быть то же самое, что и в секции location / дефолтного шаблона
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /install/app.php/$1 last;
}
# Deny access to version control system directories.
location ~ /\.svn|/\.git {
deny all;
internal;
}
error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;
location /error/ {
alias /home/admin/web/kkk.kk/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location /vstats/ {
alias /home/admin/web/kkk.kk/stats/;
# include /home/admin/conf/web/kkk.kk.auth
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include /home/admin/conf/web/nginx.kkk.kk.conf*;
}