Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Language specific forums Russian (Русский) Веб сервер
  • Search

Шаблон для phpBB Topic is solved

Вопросы по работе Веб сервера
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
8 posts • Page 1 of 1
pr0g
Posts: 5
Joined: Thu Jul 13, 2017 4:18 am

Os: CentOS 6x
Web: nginx + php-fpm
Шаблон для phpBB
  • Quote

Post by pr0g » Thu Nov 22, 2018 9:10 pm

Привет! Есть ли в природе шаблон Nginx для phpBB?
Пробовал сделать сам, но в итоге не получилось :(
Top

grayfolk
Support team
Posts: 1111
Joined: Tue Jul 30, 2013 10:18 pm
Contact:
Contact grayfolk
Website Facebook Skype Twitter

Os: CentOS 6x
Web: nginx + php-fpm
Re: Шаблон для phpBB
  • Quote

Post by grayfolk » Thu Nov 22, 2018 10:33 pm

pr0g wrote: ↑
Thu Nov 22, 2018 9:10 pm
Привет! Есть ли в природе шаблон Nginx для phpBB?
Пробовал сделать сам, но в итоге не получилось :(
Вот можно взять как образец, к примеру: https://github.com/phpbb/area51-phpbb3/ ... ample.conf
Top

pr0g
Posts: 5
Joined: Thu Jul 13, 2017 4:18 am

Os: CentOS 6x
Web: nginx + php-fpm
Re: Шаблон для phpBB
  • Quote

Post by pr0g » Fri Nov 23, 2018 2:41 am

grayfolk wrote: ↑
Thu Nov 22, 2018 10:33 pm
Вот можно взять как образец, к примеру: https://github.com/phpbb/area51-phpbb3/ ... ample.conf
Так я его и брал как образец, но секцию install так и не смог заставить работать.
Top

grayfolk
Support team
Posts: 1111
Joined: Tue Jul 30, 2013 10:18 pm
Contact:
Contact grayfolk
Website Facebook Skype Twitter

Os: CentOS 6x
Web: nginx + php-fpm
Re: Шаблон для phpBB
  • Quote

Post by grayfolk » 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;
	}
Top

pr0g
Posts: 5
Joined: Thu Jul 13, 2017 4:18 am

Os: CentOS 6x
Web: nginx + php-fpm
Re: Шаблон для phpBB
  • Quote

Post by pr0g » Fri Nov 23, 2018 3:00 pm

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;
	}
Спасибо за конфиг, помогло. Инсталляция прошла, но теперь если зайти на сайт по адресу http://site.ru (без файла index.php) выдает сообщение:
Image

С файлом index.php все ок:
Image

Можете поделиться вашим полным шаблоном?

Мой шаблон:

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*;
}
Top

pr0g
Posts: 5
Joined: Thu Jul 13, 2017 4:18 am

Os: CentOS 6x
Web: nginx + php-fpm
Re: Шаблон для phpBB
  • Quote

Post by pr0g » Fri Nov 23, 2018 6:49 pm

Проблема решилась. У корневой директории отсутствовали права чтения для анонимов.
Top

trom
Posts: 39
Joined: Tue Jul 14, 2015 3:16 am

Re: Шаблон для phpBB
  • Quote

Post by trom » Thu Mar 04, 2021 3:52 pm

та же проблема не запускается установка форума phpBB
при нажатии на вкладку 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*;
}
Top

trom
Posts: 39
Joined: Tue Jul 14, 2015 3:16 am

Re: Шаблон для phpBB
  • Quote

Post by trom » Thu Mar 04, 2021 4:13 pm

При таком конфиге получаю
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*;
}
Top


Post Reply
  • Print view

8 posts • Page 1 of 1

Return to “Веб сервер”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password