AH01630 error after migration to new server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Moose999
    Junior Member
    • Oct 2019
    • 6

    #1

    AH01630 error after migration to new server

    I migrated an instance to a new server. I am fairly sure most of the server configuration is OK, as I have another instance on the same server that has no problems.

    In the apache error log I can see:

    AH01630: client denied by server configuration: /home/public_html/api

    and I can see similar errors in my browser console.

    there's nothing related in my Espo logs.

    File permissions seem OK.

    What is the best way for me to track down this problem?

    Many thanks!


  • emillod
    Active Community Member
    • Apr 2017
    • 1594

    #2
    Did you tried to set permissions based on documentation to not guess?

    Comment

    • Moose999
      Junior Member
      • Oct 2019
      • 6

      #3
      Hi,

      I have now run:

      find . -type d -exec chmod 755 {} + && find . -type f -exec chmod 644 {} +;
      find data custom client/custom -type d -exec chmod 775 {} + && find data custom client/custom -type f -exec chmod 664 {} +;
      chmod 754 bin/command;


      but I still have the same error.

      Many thanks

      Comment

      • emillod
        Active Community Member
        • Apr 2017
        • 1594

        #4
        Normally api folder is in public folder. Are you sure that you correctly configured everything? Normally it should be everything in public_html, there should be also public folder from Espo, and inside of it there should be api folder.

        Comment

        • Moose999
          Junior Member
          • Oct 2019
          • 6

          #5
          Yes, I can see those folders in my file system.

          Is there a URL I should be able to access? /public/api/v1/index.php gives me 404 Not Found - but it does on my working instance as well, so I'm not sure that's a valid test.

          Comment

          • Moose999
            Junior Member
            • Oct 2019
            • 6

            #6
            I notice that the error is about

            /home/crmwork/public_html/api

            Should this not be

            /home/crmwork/public_html/public/api

            ?

            and if so, does that point to .htaccess or some other rewrite problem, or is that expected?

            Comment

            • emillod
              Active Community Member
              • Apr 2017
              • 1594

              #7
              Did you checked how apache configuration should look?
              Apache - EspoCRM Documentation

              Comment

              • eymen-elkum
                Active Community Member
                • Nov 2014
                • 511

                #8
                The AH01630 message is generated by Apache before the request reaches EspoCRM, so changing the EspoCRM file permissions alone is unlikely to solve it.

                For the current recommended production setup, the virtual host DocumentRoot should point to the EspoCRM public directory, not to the EspoCRM root:

                Code:
                DocumentRoot /home/crmwork/public_html/public/
                
                Alias /client/ /home/crmwork/public_html/client/
                
                <Directory /home/crmwork/public_html/>
                    AllowOverride None
                </Directory>
                
                <Directory /home/crmwork/public_html/public/>
                    AllowOverride All
                    Require all granted
                </Directory>
                Also verify that mod_rewrite is enabled and that the active VirtualHost is the one being edited.

                The public URL should still use /api/v1/...; it should not contain /public/. Apache maps that public URL to public/api/v1 internally. I would compare the active VirtualHost and Directory blocks with the official EspoCRM Apache configuration, then run an Apache configuration test before restarting it.

                If you share the sanitized VirtualHost configuration, we can check which Directory or rewrite rule is sending the request to /public_html/api instead of /public_html/public/api.
                Eblasoft | EspoCRM specialists since 2014
                Consulting · Development · Integrations · Premium Extensions
                .

                Comment

                Working...