Как развернуть приложение Symfony3 в CentOS

Я до сих пор не могу понять, что происходит на моем сервере
когда я отправляю свой код через сервер в / public_html и хочу получить домашнюю страницу моего приложения следующим образом:

Http: /www.example.com/web/

Сервер показывает мне содержимое / web (файлы и каталог, которые существуют внутри / web)

и это происходит после того, как я следую командной строке шага, чтобы развернуть Symfony 3 в этой ссылке:
https://symfony.com/doc/3.1/deployment.html

Я до сих пор не могу понять, что там происходит !!

любая помощь будет чрезвычайно ценится!

-2

Решение

1)
yum install nginx

2-)service nginx start

3-) Добавьте конфигурацию Nginx в /etc/nginx/conf.d/project_name.conf

server{
set $web_host "domain_name";
set $web_root "web_directory";

server_name $web_host;
root $web_root;

location / {
try_files $uri /app.php$is_args$args;
}
# DEV
# This rule should only be placed on your development environment
# In production, don't include this and don't deploy app_dev.php or config.php
#    location ~ ^/(app_dev|config)\.php(/|$) {
#        fastcgi_pass 127.0.0.1:9000;
#        fastcgi_split_path_info ^(.+\.php)(/.*)$;
#        include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
#        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
#        fastcgi_param DOCUMENT_ROOT $realpath_root;
#    }
# PROD
location ~ ^/app\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/app.php/some-path
# Remove the internal directive to allow URIs like this
internal;
}

error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}

4-) `chmod -R nginx: nginx / var / www / html / project«

5-) service nginx restartа также service php-fpm restart

1

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector