# Error deploying a cakephp application on ubuntu

**URL:** <https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129>\
**Category:** Need Help\
**Created:** [July 26, 2020, 9:45am UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129 "2020-07-26T09:45:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiyser](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@kiyser](https://discourse.cakephp.org/u/kiyser)\
**Post date:** [July 26, 2020, 9:45am UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/1 "2020-07-26T09:45:13Z")

</div>

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](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

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/1/1c630addf2995bf75dbf29564214864b35a7e696.png)  
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](https://stackoverflow.com/questions/52837045/cakephp-ah00124-request-exceeded-the-limit-of-10-internal-redirects-due-to-pr)

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

Need help please!

---

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [July 26, 2020, 3:49pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/2 "2020-07-26T15:49:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kiyser](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@kiyser](https://discourse.cakephp.org/u/kiyser)\
**Post date:** [July 26, 2020, 4:13pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/3 "2020-07-26T16:13:04Z")

</div>

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

Is my configurations ok?

Thanks.

---

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [July 26, 2020, 4:15pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/4 "2020-07-26T16:15:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![raul338](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/raul338/32/69_2.png) [@raul338](https://discourse.cakephp.org/u/raul338)\
**Post date:** [July 26, 2020, 4:18pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/5 "2020-07-26T16:18:35Z")

</div>

Your config seems to match [the config in the manual](https://book.cakephp.org/3/en/installation.html#apache), It is not visible if you enabled `mod_rewrite`. Try enable that with

```auto
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`)

---

<div class="post-metadata">

**Author:** ![kiyser](https://avatars.discourse-cdn.com/v4/letter/k/87869e/32.png) [@kiyser](https://discourse.cakephp.org/u/kiyser)\
**Post date:** [July 26, 2020, 5:14pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/6 "2020-07-26T17:14:00Z")

</div>

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:

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/b/be94d82305efd492f4aebba3993deaebf7ba7497.png)

Thanks for all!

---

<div class="post-metadata">

**Author:** ![raul338](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/raul338/32/69_2.png) [@raul338](https://discourse.cakephp.org/u/raul338)\
**Post date:** [July 26, 2020, 10:00pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/7 "2020-07-26T22:00:48Z")

</div>

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](https://github.com/cakephp/app/blob/master/.htaccess) and [webroot](https://github.com/cakephp/app/blob/master/webroot/.htaccess)

---

<div class="post-metadata">

**Author:** ![bizdev](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/bizdev/32/1951_2.png) [@bizdev](https://discourse.cakephp.org/u/bizdev)\
**Post date:** [July 28, 2020, 5:32am UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/8 "2020-07-28T05:32:09Z")

</div>

Hi @kiyser,

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

```apache
<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>

```

---

<div class="post-metadata">

**Author:** ![khairul](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@khairul](https://discourse.cakephp.org/u/khairul)\
**Post date:** [August 12, 2021, 6:22pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/9 "2021-08-12T18:22:03Z")

</div>

How to check apache error log in ubuntu?

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [August 12, 2021, 8:28pm UTC](https://discourse.cakephp.org/t/error-deploying-a-cakephp-application-on-ubuntu/8129/10 "2021-08-12T20:28:33Z")

</div>

> [@bizdev](#):
>
> `ErrorLog ${APACHE_LOG_DIR}/error.log`

If you defined that in your vhost config then it should be in `/var/log/apache2/error.log`
