Espo 3.6.0 Installation - sieURL / Apache default path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chiak
    Junior Member
    • May 2015
    • 7

    Espo 3.6.0 Installation - sieURL / Apache default path

    Dear Forum,

    i installed 3.6.0, stable and running smothtly.
    at last, i want to shorten the url from
    Code:
    http://yyyy.xxx/espo/
    to
    Code:
    http://yyyy.xxx/
    i am using ubuntu 14.01, apache.

    in my site enabled config i changed
    Code:
    DocumentRoot /var/www/html/
    to
    Code:
    DocumentRoot /var/www/html/espo/


    and changed in /var/www/html/espo/data/config.php
    Code:
    http://yyyy.xxx/espo/
    to
    Code:
    http://yyyy.xxx/
    ####

    but i receive a 404 from from espo crm (blank white page, with the a footer loaded)

    this is the content of my /var/www/html/espo/.htaccess
    Code:
    <ifModule mod_headers.c>
      Header always set Access-Control-Allow-Methods "POST, GET, PUT, PATCH, DELETE"
    </ifModule>
    
    DirectoryIndex index.php index.html
    
    <IfModule mod_rewrite.c>
      RewriteEngine On
    
      # PROTECTED DIRECTORIES
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^/?(data|api)/ - [F]
    
      RewriteRule ^/?data/config\.php$ - [F]
      RewriteRule ^/?data/logs/ - [F]
      RewriteRule ^/?data/cache/ - [F]
      RewriteRule ^/?data/upload/ - [F]
      RewriteRule ^/?data/\.backup/ - [F]
      RewriteRule ^/?application/ - [F]
      RewriteRule ^/?custom/ - [F]
      RewriteRule ^/?vendor/ - [F]
      #END PROTECTED DIRECTORIES
    
      RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]
    
      RewriteRule reset/?$ reset.html [QSA,L]
    </IfModule>
    please help me to figure out the right configuration, to get it set up correctly.

    thanks,
    Marc
    Last edited by chiak; 09-25-2015, 10:40 AM.
  • tarasm
    Super Moderator
    • Mar 2014
    • 573

    #2
    Your code should looks like:
    Code:
    <VirtualHost *:80>
        ServerName YOUR_URL
        DocumentRoot /var/www/html/espo/ 
    
        <Directory /var/www/html/espo/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>
    Please check if you correct define ServerName and Directory
    Job Offers and Requests

    Comment

    • chiak
      Junior Member
      • May 2015
      • 7

      #3
      Hi tarasm,

      thanks for your advice, but i could not get it to work.
      the error did not change, 404 stays.

      the servername and directory is set correctly.

      hereby i post my server config files:

      Apache Site-Enabled Config
      Code:
      <VirtualHost *:80>
              ServerName crm.***.com
              ServerAlias crm
              ServerAdmin admin@***.com
              DocumentRoot /var/www/html/espo/
              <Directory /var/www/html/espo/>
                      Options Indexes FollowSymLinks
                      AllowOverride All
                      Require all granted
              </Directory>
              ErrorLog ${APACHE_LOG_DIR}/error.log
              CustomLog ${APACHE_LOG_DIR}/access.log combined
      </VirtualHost>
      Apache Config
      Code:
      ...
      <Directory />
              Options FollowSymLinks
              AllowOverride All
              Require all granted
      </Directory>
      
      <Directory /var/www/html/espo/>
              Options Indexes FollowSymLinks
              AllowOverride All
              Require all granted
      </Directory>
      ...
      /var/www/html/espo/.htaccess
      Code:
      <ifModule mod_headers.c>
        Header always set Access-Control-Allow-Methods "POST, GET, PUT, PATCH, DELETE"
      </ifModule>
      
      DirectoryIndex index.php index.html
      
      <IfModule mod_rewrite.c>
        RewriteEngine On
      
        # PROTECTED DIRECTORIES
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^/?(data|api)/ - [F]
      
        RewriteRule ^/?data/config\.php$ - [F]
        RewriteRule ^/?data/logs/ - [F]
        RewriteRule ^/?data/cache/ - [F]
        RewriteRule ^/?data/upload/ - [F]
        RewriteRule ^/?data/\.backup/ - [F]
        RewriteRule ^/?application/ - [F]
        RewriteRule ^/?custom/ - [F]
        RewriteRule ^/?vendor/ - [F]
        #END PROTECTED DIRECTORIES
      
        RewriteRule .* - [E=HTTP_ESPO_CGI_AUTH:%{HTTP:Authorization}]
      
        RewriteRule reset/?$ reset.html [QSA,L]
      </IfModule>
      /var/www/html/espo/data/config.php
      Code:
      ...
      'siteUrl' => 'http://crm.***.com/',
      ...
      /etc/hosts
      Code:
      127.0.0.1       crm.***.com localhost.localdomain localhost
      127.0.1.1       crm.***.com
      192.168.0.29    crm.***.com crm
      ...
      edit:
      /var/www/html/espo/data/logs/espo-2015-09-23.log
      Code:
      [2015-09-23 13:41:25] Espo.WARNING: E_WARNING: Missing argument 4 for Espo\Services\User::changePassword(), called i$lled in /var/www/html/espo/application/Espo/Controllers/User.php on line 85 and defined {"file":"/var/www/html/espo/application/Espo/Services/User.php","line":85} []
      please have a look,
      any clue or hint is helpful to me.
      thanks!
      Last edited by chiak; 09-25-2015, 07:49 PM.

      Comment

      • tarasm
        Super Moderator
        • Mar 2014
        • 573

        #4
        Did you run these commands after adding VirtualHost file:
        Code:
        sudo a2ensite YOUR_CONF_NAME.conf
        service apache2 reload
        Job Offers and Requests

        Comment

        • chiak
          Junior Member
          • May 2015
          • 7

          #5
          Hi Tarasm,
          i rechecked the sites - even disabling and re-enabling the site makes no difference. everything is fine.
          i just can add, that the current version 3.6.2, not 3.6.0 as mentioned in the title.

          i don't know where the error comes from.
          is the an internal espo error log where i can check the 404 ?

          Comment

          • tarasm
            Super Moderator
            • Mar 2014
            • 573

            #6
            The logs are located in data/logs/.
            Please send me an URL of your EspoCRM instance via PM, I will check the problem.
            Job Offers and Requests

            Comment

            • chiak
              Junior Member
              • May 2015
              • 7

              #7
              PM send. thanks!

              Comment

              • tarasm
                Super Moderator
                • Mar 2014
                • 573

                #8
                Checked. You have the issue with the /api/v1/.htaccess. Try to change the RewriteBase option. You can check the result by opening this URL http://YOUR_DOMAIN/api/v1/Settings
                Job Offers and Requests

                Comment

                • chiak
                  Junior Member
                  • May 2015
                  • 7

                  #9
                  hey tarasm, you made my day!

                  i changed the rewriteBase option as you
                  mentioned to the correct folder, and it works!

                  thank you so much for your help!

                  Comment

                  Working...