Error 404 or Bad Server Response

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    Error 404 or Bad Server Response

    I configured EspoCRM locally and everything is working fine. Then I moved the installation to a shared webhoster in a subdomain and getting Bad Server Response or Error 404. I have already configured the Rewrite Base as followed:

    Code:
    RewriteBase /http://[I]sub.domain.de[/I]/api/v1/
    
    RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
    Gives me the mentioned error.

    In addition I have this in my Espo Error Log:

    Code:
    11-19 07:58:32] Espo.ERROR: Uncaught exception {"exception":"[object] (PDOException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known at /homepages/1/d113866760/htdocs/[I]subdomain/domain.de[/I]/application/Espo/ORM/EntityManager.php:131)"} []
    Last edited by shalmaxb; 11-19-2015, 08:07 AM.
  • tarasm
    Super Moderator
    • Mar 2014
    • 573

    #2
    In the most cases no need to set RewriteBase for subdomain. Please check the following:
    1. If your apache server supports mod_rewrite.
    1. If your subdomain supports .htaccess.
    2. What version of php do you use? Perhaps FastCGI?
    Job Offers and Requests

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1602

      #3
      Thank you for your reply.

      - I disabled the .htaccess file in the directory api/v1 -> no result, still 404
      - PHP 5.6
      - mod_rewrite enabled
      - .htaccess supported
      - CGI/fastCGI enabled

      Still not able to call the CRM, Error 404

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #4
        Hello,

        meanwhile I got it working. The path in the htaccess-file was wrong. In my case it had to be only:

        Code:
        RewriteBase /api/v1/
        But now I have two other issues:

        1. The avatar-image is not shown
        2. When I open new pages e.g. editing the user account, there appears a login dialogue (htaccess-dialogue), but I never configured such thing and so I don`t know what to put there. I am not able to download attached files or images.
        Last edited by shalmaxb; 11-19-2015, 11:13 AM.

        Comment

        • tarasm
          Super Moderator
          • Mar 2014
          • 573

          #5
          It's the problem of FastCGI server configuration. You have to enable HTTP_AUTHORIZATION in your virtual host:
          Code:
          <IfModule mod_fcgid.c>
            FcgidPassHeader Authorization
            FcgidPassHeader Proxy-Authorization
            FcgidPassHeader HTTP_AUTHORIZATION
          </IfModule>
          Job Offers and Requests

          Comment

          • shalmaxb
            Senior Member
            • Mar 2015
            • 1602

            #6
            Thank you, I read this already. Unfortunately the script will be hosted on a shared hoster. Where would I have to put the code?
            Is there a way by htaccess file or user.ini/php.ini? Or any other workaround?
            Hints are really appreciated.

            Comment

            • tarasm
              Super Moderator
              • Mar 2014
              • 573

              #7
              It should be saved in the server configuration file or vhost. You can ask your hosting provider support to enable this possibility.
              Job Offers and Requests

              Comment

              • shalmaxb
                Senior Member
                • Mar 2015
                • 1602

                #8
                This is the problem: The hoster will not do that, so I will have to look for another solution, yet not knowing what....
                Despite of that, thank you for your attention and fast reply.

                Comment

                • shalmaxb
                  Senior Member
                  • Mar 2015
                  • 1602

                  #9
                  Meanwhile I received an answer from my hoster (which is 1&1 in Germany). They told me, that in the server configuration HTTP_AUTHORIZATION at their servers is called REDIRECT_HTTP_AUTHORIZATION.
                  Where can I let EspoCRM know, that this configuration is named different?
                  Thank you in advance.

                  Comment

                  • yuri
                    Member
                    • Mar 2014
                    • 8440

                    #10
                    We use HTTP_ESPO_AUTHORIZATION header for such situations. Maybe your problems is caused by something else.
                    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                    Comment

                    • shalmaxb
                      Senior Member
                      • Mar 2015
                      • 1602

                      #11
                      I apologize, but I do not understand. HTTP_AUTHORIZATION is - as far as I understand - a configuration term of the webserver. This term in my hosting is called REDIRECT_HTTP_AUTHORIZATION. I understand, that EspoCRM is referring to HTTP_AUTHORIZATION, but where is that coded? And where could I change something so that the Server understands HTTP_ESPO_AUTHORIZATION or Espo understands REDIRECT_HTTP_AUTHORIZATION.
                      I am quite confused.

                      Comment

                      • yuri
                        Member
                        • Mar 2014
                        • 8440

                        #12
                        Espo sends both headers: HTTP_AUTHORIZATION and HTTP_ESPO_AUTHORIZATION. If first one is blocked by server it tries the second one.
                        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                        Comment

                        • yuri
                          Member
                          • Mar 2014
                          • 8440

                          #13
                          Coded in javascript minified ('Espo-Authorization' word) and in application/Espo/Core/Utils/Auth.php

                          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                          Comment

                          • shalmaxb
                            Senior Member
                            • Mar 2015
                            • 1602

                            #14
                            No matter what I try, it is not possible to get rid of the Server Login appearing, whenever I want to upload something or call the detail view of e.g. leads. Also uploaded files as avatar images or pdf documents are not accessible. As informed before, in my hosting HTTP_AUTHORIZATION is enabled (although it is named at my hoster depending on the configuration there REDIRECT_HTTP_AUTHORIZATION). I am quite desperate, because I do not understand, why it does not work properly and I beg you, to give me direction in how I can configure my htaccess so it will working. I don`t even know, which htaccess is important for this, the one ion the root or the one in the api folder?

                            Comment

                            • shalmaxb
                              Senior Member
                              • Mar 2015
                              • 1602

                              #15
                              In addition, my error log:
                              Attached Files

                              Comment

                              Working...