Error deploying a cakephp application on ubuntu

Good morning all,
I’m currently using Cakephp 3 version to develop an application. It should be online on an Ubuntu server and through the subdomain: http://etraining.minmap.cm
To do this, I configured a virtualHost, with the content : /etc/apache2/sites-available/etraining.minmap.cm.conf
<VirtualHost *:80>
ServerName etraining.minmap.cm
ServerAlias www.etraining.minmap.cm
ServerAdmin webmaster@localhost
DocumentRoot /var/www/etraining.minmap.cm/public_html/webroot

<Directory /var/www/etraining.minmap.cm/public_html/webroot>
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
The content of the .htaccess located at the application folder is: RewriteEngine on RewriteRule ^(\.well-known/.*)$ $1 [L] RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] The content of the .htaccess located at webroot is: RewriteEngine On RewriteBase /var/www/etraining.minmap.cm/public_html RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

With this configuration, I have an “Internal Server Error” type error


I have also check the log server and i have the code error : AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error

I don’t know if I misconfigured apache, my .htaccess files, and the config/app.php

Need help please!

What is the default controller action you should get to when entering the site? Is it possible that action is falling into an endless redirect loop? It’s not impossible that some conditional is evaluating differently on the new server.

Hi @dreamingmind
The default controller is pages and the action is display. The complete default url is : http://etraining.minmap.cm/pages/display

Is my configurations ok?

Thanks.

I’m not an expert on setting up servers, but I’m not seeing anything wrong…

Your config seems to match the config in the manual, It is not visible if you enabled mod_rewrite. Try enable that with

sudo a2enmod rewrite

(restart apache after that)

If it still fails, could you check apache error.log for errors in php loading? (maybe extensions missing, like intl)

Hi @raul338,
I have followed all the configuration steps outlined in the official documentation.
mod_rewrite is enabled, mbstring and intl extensions are also enable

Finally, i have check apache error.log:

Thanks for all!

Based on the error.log, you are having a redirect to the same url.

Please try to use/adapt from the default .htaccess from project root and webroot

Hi @kiyser,

Try changing your apache conf with below content and let us know if it works:

<VirtualHost *:80>
    ServerName etraining.minmap.cm
    ServerAlias www.etraining.minmap.cm
    #ServerAdmin webmaster@localhost
    DocumentRoot /var/www/etraining.minmap.cm/public_html

    <Directory /var/www/etraining.minmap.cm/public_html>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
1 Like