• Почему не работает планировщик задач schedule?

    @Hfnas Автор вопроса
    YepBro,
    над этим когда есть простое решение... Зачем себя мучать?

    Поделитесь, пожалуйста , этим рецептом счастья?
    Вот, я, например, если так буду делать:
    $schedule
                    ->command("ms:test0")
                    ->cron('* * * * *')
                    ->withoutOverlapping()->then(function() {
                        $this->call("ms:test1")
                             ->withoutOverlapping()                          
                             ->then(function() {
                                   $this->call("ms:test2")
                                           ->withoutOverlapping() .....
                             })
                    });


    Какая-то неразбериха получается, получается 10 подзадача вложена в 9, 9 вложена в 8 задачу.... и так до первой задачи...
    Написано
  • Почему не работает планировщик задач schedule?

    @Hfnas Автор вопроса
    YepBro, благодарю за ответ. А если задач много, н-р, 10, то как через цикл вывести? В симфони вообще как-то попроще, написал список команд, поочередно выполнилось. а ларавел никак не пойму., к сожалению
    $schedule->events()[0]->then(function($commands) вообще не работает... Мне кажется, тут надо в очереди выносить, обычный job подойдет, думаю? или лучше смотреть в сторону Rabbit? Мне бы хотелось видеть в таблице ошибки, дату начала выполнения , дату окончания выполнения, флаг завершения задачи. Буду очень благодарна, если подскажете немного.
    Написано
  • Как сделать вывод картинок товара?

    @Hfnas Автор вопроса
    Антон Антон, большое спасибо, очень доходчиво. ( а я никак не могла понять, чем отличается belongTo и hasOne.
    оттуда поняла, из доков не очень.-(
    Написано
  • Почему не получается ресайз картинки?

    @Hfnas Автор вопроса
    Дмитрий Кузнецов, в этом и проблема, спасибо большое!Целый день убила!
    Написано
  • Почему не получается ресайз картинки?

    @Hfnas Автор вопроса
    Дмитрий Кузнецов, нет, ошибка указывает на этот код. См картинку выше. Да, описание ошибки говорит про бд. я никак не понимаю, с чем связана бд с ошибкой?
    Написано
  • Почему не срабатывают стили на продакшен, vite?

    @Hfnas Автор вопроса
    iljaGolubev, самое интересное, почему-то генерация стилей/шаблона/яваскрипт происходило, когда я сделала
    npm run dev
    , при этом в 'resources/js/app.js' есть импорт 'resources/css/app.css'б а когда убрала импорт, приходится только обновлять страницу при каждом изменении. Странно конечно, почему так произошло.
    Написано
  • Почему не срабатывают стили на продакшен, vite?

    @Hfnas Автор вопроса
    iljaGolubev, спасибо большое за ответ!
    > в resources/js/app.js есть импорт resources/css/app.css?

    В этом и фигня была, поэтому ничего не работало, вернула как было :
    import { defineConfig } from 'vite';
    import laravel from 'laravel-vite-plugin';
    
    export default defineConfig({
        plugins: [
            laravel({
                input: [
                     'resources/css/app.css',
                    'resources/js/app.js',
                ],
                refresh: true,
            }),
        ],
    });

    и убрала из resources/js/app.js импорт resources/css/app.css,
    правильно сформировалась карта manifest.json вида:
    {
      "resources/css/app.css": {
        "file": "assets/app-e0a0d534.css",
        "isEntry": true,
        "src": "resources/css/app.css"
      },
      "resources/js/app.js": {
        "file": "assets/app-c98dfa20.js",
        "isEntry": true,
        "src": "resources/js/app.js"
      }
    }

    Не знаю, почему, но все исправилось.
    Что я на локалке сделала команду npm run build, и на сервер закачала папку `build`
    И все стили на сервере встали, почти как на симфони.

    Вопрос, вы стили на продакшен формируете на локалке, а потом закачиваете на сервер?
    Написано
  • Как в sail исправить SET GLOBAL sql_mode?

    @Hfnas Автор вопроса
    Дмитрий, рада бы понять, да не поняла, то есть вы предлагаете писать https://laravel.com/docs/10.x/queries конструктором запросов, правильно.
    Написано
  • Как в sail исправить SET GLOBAL sql_mode?

    @Hfnas Автор вопроса
    Дмитрий, я про sail laravel спрашиваю.
    Написано
  • Как в sail исправить SET GLOBAL sql_mode?

    @Hfnas Автор вопроса
    Дмитрий, то есть как положено , с помощью DB::table ? Ок, попробую.
    Написано
  • Как в sail исправить SET GLOBAL sql_mode?

    @Hfnas Автор вопроса
    Дмитрий, я хочу сделать запрос в бд
    Написано
  • Почему Post возвращает null при ajax?

    @Hfnas Автор вопроса
    AUser0, cпасибо, не знаю, что произошло, вернула как было.
    в файл записался пост, стала строка в файл
    "leads%5Badd%5D%5B0%5D%5Bid%5D=30269601&leads%5Badd%5D%5B0%5D%5Bname%5D=

    которую никак не распарсить,
  • Почему Post возвращает null при ajax?

    @Hfnas Автор вопроса
    AUser0,
    кстати , сейчас на свежую голову попробовала
    let dataforMS = { };
                dataforMS["leads"] = 1234;
    
                $.ajax({
                  url: 'https://site2.ru/send2?yyy=7',
                  method: 'POST',
                  xhr: function() {  // custom xhr
                    myXhr = $.ajaxSettings.xhr();
                    return myXhr;
                  },
                  //Ajax events
                  beforeSend: function (response) {
                      console.log("beforeSend"+response);
                  },
                  success: function (response) {
                      console.log("success"+response);
                  },
                  error: function (response) {
                      console.log("error"+response);
                  },
                  // Form data
                  data: dataforMS,
                  cache: false,
                  contentType: false,
                  processData: false
                });

    get параметр получается, и записывается в файл.(записалось 7) A post по-прежнему null.
  • Почему Post возвращает null при ajax?

    @Hfnas Автор вопроса
    AUser0, я никак не могу понять почему на сервер приходит пустой пост, вернее нулевой пост. (говорю записывается в файл null, также проверяла количество count($_POST), count($_GET) на сервере, их колво =0( я в тупике). то есть никакие данные приходят, хотя на сервер попадает, и возвращает "success".
    Данные конфига nginx верны? Если я уберу 3 строчки в конфиге (см вопрос), то будет ошибка:
    "as been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource".
  • Почему Post возвращает null при ajax?

    @Hfnas Автор вопроса
    dataforMS["leads"] = 1234;
    нужно 1234.
  • Sec-Fetch-Mode и почему он не везде?

    @Hfnas
    DevMan, куда их добавить?(нужны HTTP_SEC_FETCH_SITE=same_origin, HTTP_SEC_FETCH_MODE=cors, HTTP_SEC_FETCH_DEST=empty)
    в nginx?
    (у меня связка nginx+apache)
    ошибка в браузере
    "ERR_NETWORK" axios
  • Как связке апач-nginx настроить переход на https?

    @Hfnas Автор вопроса
    AUser0, спасибо,
    Из apache2.conf стереть строку Listen 127.0.0.1:8080
    -ошибка апача,
    apachectl[79025]: no listening sockets available, shutting down
    apachectl[79025]: AH00015: Unable to open logs
    apachectl[79018]: Action 'start' failed.
    apachectl[79018]: The Apache error log may have more information.
    apache2.service: Control process exited, code=exited, status=1/FAILURE
    -- Subject: Unit process exited


    в общем вернула, как есть.

    тп подсказала
    server {
         listen 80;
         listen  [::]:80;
         server_name _;
         return 301 https://$host$request_uri;
           include /etc/nginx/vhosts-includes/*.conf;
           location @fallback {
                   error_log /dev/null crit;
                   proxy_pass http://127.0.0.1:8080;
                   proxy_redirect http://127.0.0.1:8080 /;
                   proxy_set_header Host $host;
                   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                   proxy_set_header X-Forwarded-Proto $scheme;
                   access_log off ;
           }
    
    }
    
    
    server {
     listen 443 ssl;
     listen [::]:443 ssl;
     root /var/www/crm/public_html/public;
     server_name crm.ru www.crm.ru;
    ssl_protocols TLSv1.2;
    #ssl on;
    ssl_certificate /etc/nginx/ssl/crm.ru.crt;
    ssl_certificate_key /etc/nginx/ssl/crm.ru.key;
    
    location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    
    location ~ /\.ht {
      deny all;
     }
    }

    но по прежнему "Mixed Content: The page at 'https://сrm.ru/' was loaded over HTTPS, but requested ."
    У меня вопрос, эта ошибка возникает на стороне сервера, то есть изз-а настроек симфони +апач зависит зависит?

    сделала, видно, что перенаправления нет, если я правильно понимаю.
    $ curl -vLI http://crm.ru/admin
    *   Trying XXX.XX.XXXX.XXX:80...
    * Connected to crm.ru (XXX.XX.XXXX.XXX) port 80 (#0)
    > HEAD /admin HTTP/1.1
    > Host: crm.ru
    > User-Agent: curl/7.81.0
    > Accept: */*
    > 
    * Mark bundle as not supporting multiuse
    < HTTP/1.1 301 Moved Permanently
    HTTP/1.1 301 Moved Permanently
    < Server: nginx/1.18.0 (Ubuntu)
    Server: nginx/1.18.0 (Ubuntu)
    < Date: Mon, 26 Dec 2022 20:00:37 GMT
    Date: Mon, 26 Dec 2022 20:00:37 GMT
    < Content-Type: text/html
    Content-Type: text/html
    < Content-Length: 178
    Content-Length: 178
    < Connection: keep-alive
    Connection: keep-alive
    < Location: https://crm.ru/admin
    Location: https://crm.ru/admin
    
    < 
    * Connection #0 to host crm.ru left intact
    * Clear auth, redirects to port from 80 to 443
    * Issue another request to this URL: 'https://crm.ru/admin'
    *   Trying XXX.XX.XXXX.XXX:443...
    * Connected to crm.ru (XXX.XX.XXXX.XXX) port 443 (#1)
    * ALPN, offering h2
    * ALPN, offering http/1.1
    *  CAfile: /etc/ssl/certs/ca-certificates.crt
    *  CApath: /etc/ssl/certs
    * TLSv1.0 (OUT), TLS header, Certificate Status (22):
    * TLSv1.3 (OUT), TLS handshake, Client hello (1):
    * TLSv1.2 (IN), TLS header, Certificate Status (22):
    * TLSv1.3 (IN), TLS handshake, Server hello (2):
    * TLSv1.2 (IN), TLS header, Certificate Status (22):
    * TLSv1.2 (IN), TLS handshake, Certificate (11):
    * TLSv1.2 (IN), TLS header, Certificate Status (22):
    * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
    * TLSv1.2 (IN), TLS header, Certificate Status (22):
    * TLSv1.2 (IN), TLS handshake, Server finished (14):
    * TLSv1.2 (OUT), TLS header, Certificate Status (22):
    * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
    * TLSv1.2 (OUT), TLS header, Finished (20):
    * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
    * TLSv1.2 (OUT), TLS header, Certificate Status (22):
    * TLSv1.2 (OUT), TLS handshake, Finished (20):
    * TLSv1.2 (IN), TLS header, Finished (20):
    * TLSv1.2 (IN), TLS header, Certificate Status (22):
    * TLSv1.2 (IN), TLS handshake, Finished (20):
    * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
    * ALPN, server accepted to use http/1.1
    * Server certificate:
    *  subject: CN=www.crm.ru
    *  start date: Dec 16 13:12:51 2022 GMT
    *  expire date: Jan 17 13:12:50 2024 GMT
    *  subjectAltName: host "crm.ru" matched cert's "crm.ru"
    *  issuer: C=BE; O=GlobalSign nv-sa; CN=AlphaSSL CA - SHA256 - G4
    *  SSL certificate verify ok.
    * TLSv1.2 (OUT), TLS header, Supplemental data (23):
    > HEAD /admin HTTP/1.1
    > Host: crm.ru
    > User-Agent: curl/7.81.0
    > Accept: */*
    > 
    * TLSv1.2 (IN), TLS header, Supplemental data (23):
    * Mark bundle as not supporting multiuse
    < HTTP/1.1 302 Found
    HTTP/1.1 302 Found
    < Server: nginx/1.18.0 (Ubuntu)
    Server: nginx/1.18.0 (Ubuntu)
    < Date: Mon, 26 Dec 2022 20:00:37 GMT
    Date: Mon, 26 Dec 2022 20:00:37 GMT
    < Content-Type: text/html; charset=UTF-8
    Content-Type: text/html; charset=UTF-8
    < Connection: keep-alive
    Connection: keep-alive
    < Cache-Control: max-age=0, must-revalidate, private
    Cache-Control: max-age=0, must-revalidate, private
    < pragma: no-cache
    pragma: no-cache
    < Expires: Mon, 26 Dec 2022 20:00:37 GMT
    Expires: Mon, 26 Dec 2022 20:00:37 GMT
    < Link: <http://crm.ru/admin/api/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
    Link: <http://crm.ru/admin/api/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
    < Set-Cookie: PHPSESSID=jd40qqoig7vec8qegrst6aai0b; path=/; httponly; samesite=lax
    Set-Cookie: PHPSESSID=jd40qqoig7vec8qegrst6aai0b; path=/; httponly; samesite=lax
    < Location: http://crm.ru/admin/login
    Location: http://crm.ru/admin/login
    
    < 
    * Connection #1 to host crm.ru left intact
    * Clear auth, redirects to port from 443 to 80
    * Issue another request to this URL: 'http://crm.ru/admin/login'
    * Found bundle for host crm.ru: 0x55b6e1e58ff0 [serially]
    * Can not multiplex, even if we wanted to!
    * Re-using existing connection! (#0) with host crm.ru
    * Connected to crm.ru (XXX.XX.XXXX.XXX) port 80 (#0)
    > HEAD /admin/login HTTP/1.1
    > Host: crm.ru
    > User-Agent: curl/7.81.0
    > Accept: */*
    > 
    * Mark bundle as not supporting multiuse
    < HTTP/1.1 301 Moved Permanently
    HTTP/1.1 301 Moved Permanently
    < Server: nginx/1.18.0 (Ubuntu)
    Server: nginx/1.18.0 (Ubuntu)
    < Date: Mon, 26 Dec 2022 20:00:37 GMT
    Date: Mon, 26 Dec 2022 20:00:37 GMT
    < Content-Type: text/html
    Content-Type: text/html
    < Content-Length: 178
    Content-Length: 178
    < Connection: keep-alive
    Connection: keep-alive
    < Location: https://crm.ru/admin/login
    Location: https://crm.ru/admin/login
    
    < 
    * Connection #0 to host crm.ru left intact
    * Clear auth, redirects to port from 80 to 443
    * Issue another request to this URL: 'https://crm.ru/admin/login'
    * Found bundle for host crm.ru: 0x55b6e1e58650 [serially]
    * Can not multiplex, even if we wanted to!
    * Re-using existing connection! (#1) with host crm.ru
    * Connected to crm.ru (XXX.XX.XXXX.XXX) port 443 (#1)
    * TLSv1.2 (OUT), TLS header, Supplemental data (23):
    > HEAD /admin/login HTTP/1.1
    > Host: crm.ru
    > User-Agent: curl/7.81.0
    > Accept: */*
    > 
    * TLSv1.2 (IN), TLS header, Supplemental data (23):
    * Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    HTTP/1.1 200 OK
    < Server: nginx/1.18.0 (Ubuntu)
    Server: nginx/1.18.0 (Ubuntu)
    < Date: Mon, 26 Dec 2022 20:00:37 GMT
    Date: Mon, 26 Dec 2022 20:00:37 GMT
    < Content-Type: text/html; charset=UTF-8
    Content-Type: text/html; charset=UTF-8
    < Connection: keep-alive
    Connection: keep-alive
    < Cache-Control: max-age=0, must-revalidate, private
    Cache-Control: max-age=0, must-revalidate, private
    < pragma: no-cache
    pragma: no-cache
    < Expires: Mon, 26 Dec 2022 20:00:37 GMT
    Expires: Mon, 26 Dec 2022 20:00:37 GMT
    < Link: <http://crm.ru/admin/api/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
    Link: <http://crm.ru/admin/api/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
    < Set-Cookie: PHPSESSID=cm3kfc5t1l7v81l6agf5cg4i0b; path=/; httponly; samesite=lax
    Set-Cookie: PHPSESSID=cm3kfc5t1l7v81l6agf5cg4i0b; path=/; httponly; samesite=lax
  • Как создать сессию через https в symfony?

    @Hfnas Автор вопроса
    WapSter, я так и поняла, то есть это не от настроек сервера зависит, верно.
    а как исправить, чтобы не было предупреждения
    Mixed Content: The page at 'https://сrm.ru/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'crm.ru/admin/login'. This request has been blocked; the content must be served over HTTPS.
    ?
    и создавался PHPSESSID ?
  • Как связке апач-nginx настроить переход на https?

    @Hfnas Автор вопроса
    default-ssl.conf
    <IfModule mod_ssl.c>
            <VirtualHost _default_:443>
                    ServerAdmin webmaster@localhost
    
                    #DocumentRoot /var/www/html
                    DocumentRoot /var/www/crm/public_html/public
    
                
    
                    ErrorLog ${APACHE_LOG_DIR}/error.log
                    CustomLog ${APACHE_LOG_DIR}/access.log combined
    
                    # For most configuration files from conf-available/, which are
                    # enabled or disabled at a global level, it is possible to
                    # include a line for only one particular virtual host. For example the
                    # following line enables the CGI configuration for this host only
                    # after it has been globally disabled with "a2disconf".
                    #Include conf-available/serve-cgi-bin.conf
    
                    #   SSL Engine Switch:
                    #   Enable/Disable SSL for this virtual host.
                    SSLEngine off
    
                    #   A self-signed (snakeoil) certificate can be created by installing
                    #   the ssl-cert package. See
                    #   /usr/share/doc/apache2/README.Debian.gz for more info.
                    #   If both key and certificate are stored in the same file, only the
                    #   SSLCertificateFile directive is needed.
                    SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
                    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    
                    #   Server Certificate Chain:
                    #   Point SSLCertificateChainFile at a file containing the
                    #   concatenation of PEM encoded CA certificates which form the
                    #   certificate chain for the server certificate. Alternatively
                    #   the referenced file can be the same as SSLCertificateFile
                    #   when the CA certificates are directly appended to the server
                    #   certificate for convinience.
                    #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
    
                    #   Certificate Authority (CA):
                    #   Set the CA certificate verification path where to find CA
                    #   certificates for client authentication or alternatively one
                    #   huge file containing all of them (file must be PEM encoded)
                    #   Note: Inside SSLCACertificatePath you need hash symlinks
                    #                to point to the certificate files. Use the provided
                    #                Makefile to update the hash symlinks after changes.
                    #SSLCACertificatePath /etc/ssl/certs/
                    #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
    
                    #   Certificate Revocation Lists (CRL):
                    #   Set the CA revocation path where to find CA CRLs for client
                    #   authentication or alternatively one huge file containing all
                    #   of them (file must be PEM encoded)
                    #   Note: Inside SSLCARevocationPath you need hash symlinks
                    #                to point to the certificate files. Use the provided
                    #                Makefile to update the hash symlinks after changes.
                    #SSLCARevocationPath /etc/apache2/ssl.crl/
                    #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
    
                    #   Client Authentication (Type):
                    #   Client certificate verification type and depth.  Types are
                    #   none, optional, require and optional_no_ca.  Depth is a
                    #   number which specifies how deeply to verify the certificate
                    #   issuer chain before deciding the certificate is not valid.
                    #SSLVerifyClient require
                    #SSLVerifyDepth  10
    
                    #   SSL Engine Options:
                    #   Set various options for the SSL engine.
                    #   o FakeBasicAuth:
                    #        Translate the client X.509 into a Basic Authorisation.  This means that
                    #        the standard Auth/DBMAuth methods can be used for access control.  The
                    #        user name is the `one line' version of the client's X.509 certificate.
                    #        Note that no password is obtained from the user. Every entry in the user
                    #        file needs this password: `xxj31ZMTZzkVA'.
                    #   o ExportCertData:
                    #        This exports two additional environment variables: SSL_CLIENT_CERT and
      #        Per default this exportation is switched off for performance reasons,
                    #        because the extraction step is an expensive operation and is usually
                    #        useless for serving static content. So one usually enables the
                    #        exportation for CGI and SSI requests only.
                    #   o OptRenegotiate:
                    #        This enables optimized SSL connection renegotiation handling when SSL
                    #        directives are used in per-directory context.
                    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                    <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                    SSLOptions +StdEnvVars
                    </FilesMatch>
                    <Directory /usr/lib/cgi-bin>
                                    SSLOptions +StdEnvVars
                    </Directory>
    
                 
            </VirtualHost>
    </IfModule>


    Есть подозрение, что из-за hostname не открывается, так как hostname другой указан домен(тестовый домен), а сам домен на шаред хостинге. и сайт отрывается по тестовому домену по протоколу http, [хотя я убрала любое упоминание по тестовому домену в конфигах nginx, apache , кроме hostname. Вопрос можно hostname crm.ru выполнить?
  • Как связке апач-nginx настроить переход на https?

    @Hfnas Автор вопроса
    /etc/apache2/ports.conf
    # If you just change the port or add more ports here, you will likely also
    # have to change the VirtualHost statement in
    # /etc/apache2/sites-enabled/000-default.conf
    
    #Listen 80
    
    <IfModule ssl_module>
    #       Listen 443
    </IfModule>
    
    <IfModule mod_gnutls.c>
    #       Listen 443
    </IfModule>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet


    /etc/apache2/ports.conf.orig

    # If you just change the port or add more ports here, you will likely also
    # have to change the VirtualHost statement in
    # /etc/apache2/sites-enabled/000-default.conf
    
    Listen 80
    
    <IfModule ssl_module>
            Listen 443
    </IfModule>
    
    <IfModule mod_gnutls.c>
            Listen 443
    </IfModule>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet


    apache2.conf
    DefaultRuntimeDir ${APACHE_RUN_DIR}
    
    #
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    # This needs to be set in /etc/apache2/envvars
    #
    PidFile ${APACHE_PID_FILE}
    
    #
    # Timeout: The number of seconds before receives and sends time out.
    #
    Timeout 300
    
    #
    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive On
    
    #
    # MaxKeepAliveRequests: The maximum number of requests to allow
    # during a persistent connection. Set to 0 to allow an unlimited amount.
    # We recommend you leave this number high, for maximum performance.
    #
    MaxKeepAliveRequests 100
    
    #
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    #
    KeepAliveTimeout 5
    
    
    # These need to be set in /etc/apache2/envvars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
    
    #
    # HostnameLookups: Log the names of clients or just their IP addresses
    # e.g., www.apache.org (on) or 204.62.129.132 (off).
    # The default is off because it'd be overall better for the net if people
    # had to knowingly turn this feature on, since enabling it means that
    # each client request will result in AT LEAST one lookup request to the
    # nameserver.
    #
    HostnameLookups Off
    
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    #
    ErrorLog ${APACHE_LOG_DIR}/error.log
    
    #
    # LogLevel: Control the severity of messages logged to the error_log.
    # Available values: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the log level for particular modules, e.g.
    # "LogLevel info ssl:warn"
    #
    LogLevel warn
    
    # Include module configuration:
    IncludeOptional mods-enabled/*.load
    IncludeOptional mods-enabled/*.conf
    
    # Include list of ports to listen on
    Include ports.conf
    
    
    # Sets the default security model of the Apache2 HTTPD server. It does
    # not allow access to the root filesystem outside of /usr/share and /var/www.
    # The former is used by web applications packaged in Debian,
    # the latter may be used for local directories served by the web server. If
    # your system is serving content from a sub-directory in /srv you must allow
    # access here, or in any related virtual host.
    <Directory />
            Options FollowSymLinks
            AllowOverride None
            Require all denied
    </Directory>
    
    <Directory /usr/share>
            AllowOverride None
            Require all granted
    </Directory>
    
    <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
    </Directory>
    
    #<Directory /srv/>
    #       Options Indexes FollowSymLinks
    #       AllowOverride None
    #       Require all granted
    #</Directory>
    
    
    
    
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives.  See also the AllowOverride
    # directive.
    #
    AccessFileName .htaccess
    #
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    #
    <FilesMatch "^\.ht">
            Require all denied
    </FilesMatch>
    
    
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive.
    #
    # These deviate from the Common Log Format definitions in that they use %O
    # (the actual bytes sent including headers) instead of %b (the size of the
    # requested file), because the latter makes it impossible to detect partial
    # requests.
    #
    # Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
    # Use mod_remoteip instead.
    #
    LogFormat "%v:%p %a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%a %l %u %t \"%r\" %>s %O" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    
    # Include of directories ignores editors' and dpkg's backup files,
    # see README.Debian for details.
    
    # Include generic snippets of statements
    IncludeOptional conf-enabled/*.conf
    
    # Include the virtual host configurations:
    IncludeOptional sites-enabled/*.conf
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    Include conf.d/
    Listen 127.0.0.1:8080
    IncludeOptional vhosts-default/*.conf
    IncludeOptional vhosts/*/*.conf


    /etc/apache2/000-default.conf
    <VirtualHost *:80>
            # The ServerName directive sets the request scheme, hostname and port that
            # the server uses to identify itself. This is used when creating
            # redirection URLs. In the context of virtual hosts, the ServerName
            # specifies what hostname must appear in the request's Host: header to
            # match this virtual host. For the default virtual host (this file) this
            # value is not decisive as it is used as a last resort host regardless.
            # However, you must set it for any further virtual host explicitly.
            #ServerName www.example.com
    
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html
    
            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
            #LogLevel info ssl:warn
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            # For most configuration files from conf-available/, which are
            # enabled or disabled at a global level, it is possible to
            # include a line for only one particular virtual host. For example the
            # following line enables the CGI configuration for this host only
            # after it has been globally disabled with "a2disconf".
            #Include conf-available/serve-cgi-bin.conf
    </VirtualHost>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet


    crm.conf

    <VirtualHost 127.0.0.1:8080>
        ServerName crm.ru
        ServerAlias www.crm.ru
    
        DocumentRoot /var/www/crm/public_html/public
        DirectoryIndex index.php 
    
        <Directory /var/www/crm/public_html/public>
            AllowOverride None
            Order Allow,Deny
            Allow from All
    
            FallbackResource /index.php
    
        </Directory>
    
         <Directory /var/www/crm/public_html/public/bundles>
            DirectoryIndex disabled
            FallbackResource disabled
        </Directory>
    
        ErrorLog /var/www/crm/error.log
        CustomLog /var/www/crm/access.log combined
    </VirtualHost>