mod_rewrite and the .htaccess

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cube
    Member
    • Jun 2014
    • 30

    mod_rewrite and the .htaccess

    I am now trying to install EspoCRM to my SMEserver ibay (directory). Previously I has successfully installed to the Primary ibay.
    The settings in a regular ibay (directory) for .htaccess are slightly different. It looks as though I may have to create a 'custom template fragment' for my htttpd.conf.

    Can you tell me please, what are the normal contents of the .htaccess file?

    Also, I have checked my install, and having now gotten the error message in the post below, when I then check :
    /api/v1/.htaccess ... not present
    /api/v1/index.php

    My understanding is that I have to put the normal contents of the .htaccess file into the 'custom template fragment' for my htttpd.conf.
    In your opinion, will this work?
    Suggestions?
    Last edited by cube; 06-27-2014, 02:30 PM.
  • cube
    Member
    • Jun 2014
    • 30

    #2
    API Error: EspoCRM API unavailable.
    Possible problems: disabled "mod_rewrite" in Apache server or .htaccess support.

    To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
    <Directory /PATH_TO_ESPO/> AllowOverride All </Directory> Afterwards run this command in a Terminal:
    service apache2 restart
    To enable "mod_rewrite" run those commands in a Terminal:
    a2enmod rewrite service apache2 restart

    Comment

    • cube
      Member
      • Jun 2014
      • 30

      #3
      this URL: http://<YOUR-ESPO-URL>/api/v1/Settings.
      gives
      Not Found - The requested URL /crm/api/v1/Settings was not found on this server.

      Comment

      • tarasm
        Super Moderator
        • Mar 2014
        • 573

        #4
        Please check the file /api/v1/.htaccess with the content inside:
        Code:
        RewriteEngine On
        
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [QSA,L]
        Job Offers and Requests

        Comment

        • cube
          Member
          • Jun 2014
          • 30

          #5
          @tarasm
          Are you suggesting that I manually create the
          /api/v1/.htaccess
          file?

          Will I then also need to modify the htttpd.conf.

          Comment

          • tarasm
            Super Moderator
            • Mar 2014
            • 573

            #6
            This file exists in EspoCRM package. But, if you don't have this file, you can create manually. By default, no need to modify the httpd.conf, but in your case it can be some peculiarity of your server.
            Job Offers and Requests

            Comment

            • crbatchelor
              Junior Member
              • Jul 2014
              • 14

              #7
              I am also having the "API Error: EspoCRM API unavailable.
              Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support."

              Anyone?

              Comment

              • tarasm
                Super Moderator
                • Mar 2014
                • 573

                #8
                Do you have enabled mod_rewrite and .htaccess support?
                Job Offers and Requests

                Comment


                • crbatchelor
                  crbatchelor commented
                  Editing a comment
                  Yes and I believe it is all configured correctly per my cmd line checks...
              • socratec
                Junior Member
                • Jul 2014
                • 1

                #9
                I am having the same problems with my environment, using centos 6 (2.6.32-71) and apache 2.2.15. Installed on the same environment vtiger, zurmo, openERP etc and only with the installation of espoCRM I am getting the API Error message.
                My setting in httpd.conf is correct,


                LoadModule rewrite_module modules/mod_rewrite.so --> enables .htaccess support

                Alias /espoCRM "/var/www/espoCRM/"

                <Directory "/var/www/espoCRM/">

                RewriteEngine ON
                RewriteOptions Inherit

                AllowOverride All
                Options Indexes FollowSymLinks MultiViews
                Order allow,deny
                Allow from all
                </Directory>


                RewriteBase is not set in httpd.conf

                Any changes in the httpd.conf and restarting apache does not change the error message in the installation. I have tried the installation file EspoCRM-2.0.0 and EspoCRM-2.0.1.

                Comment

                • tarasm
                  Super Moderator
                  • Mar 2014
                  • 573

                  #10
                  It seems like you have some configuration issue. It can be for example a parent .htaccess which rewrite some rules, etc.
                  If you want I can try to help you. Please send me access via PM to EspoCRM and FTP.
                  Job Offers and Requests

                  Comment

                  • crbatchelor
                    Junior Member
                    • Jul 2014
                    • 14

                    #11
                    Anyone else qualified to take a look at my EspoCRM install issue? tarasm was going to take a look but must be on a vacation or something as I have not heard back from him in a week.

                    Comment

                    • crbatchelor
                      Junior Member
                      • Jul 2014
                      • 14

                      #12
                      I got a response back from a cPanel engineer:

                      cPanel builds the 'rewrite' Apache module as a static module and not a dynamic one. It looks like the software you are using is attempting to look for it's dynamic module and not static one:

                      [17:59:20 ip-50-63-128-124 root@5286069 /usr/local/apache/bin]cPs# ./httpd -M | grep rewrite
                      rewrite_module (static)

                      As you can see, your server has the rewrite module installed and operating correctly.

                      Any idea on this from the EspoCRM side?

                      Comment

                      • Philipp
                        Junior Member
                        • Aug 2014
                        • 20

                        #13
                        I also faced the "API Error: EspoCRM API unavailable.
                        Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support."
                        EspoCRM Version 2.4.0

                        Of course everything was activated on the server.
                        But in the .htaccess-file in folder \api\v1 the following line:
                        Code:
                        # RewriteBase /
                        had to be change in:
                        Code:
                        RewriteBase /api/v1/
                        Make sure, you delete the comment symbol.
                        Afterwards the installatin process continued as expected.

                        Comment

                        • ptancredi
                          Junior Member
                          • Nov 2017
                          • 1

                          #14
                          I had the same problem. I fixed it with some slight differences:

                          In the .htaccess-file in folder \api\v1 I had to include the full web path:
                          Code:
                          [FONT=courier new]RewriteBase /[espo_root]/api/v1/[/FONT]
                          and in httpd.conf the file path:
                          Code:
                          [FONT=courier new]<Directory /Library/WebServer/Documents/[espo_root]/>
                              AllowOverride All 
                          </Directory>[/FONT]
                          Where in my case [espo_root] is espo

                          Comment

                          Working...