skip to Main Content

Good morning,

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 :

<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
</VirtualHost>

The content of the .htaccess located at the application folder is:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^(.well-known/.*)$ $1 [L]
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

The content of the .htaccess located at webroot directory is:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

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

But, I have 500 Internal Server Error:

500 Internal Server Error

This is the error reported in my Apache error.log:

Apache error

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

2

Answers


  1. You should enable apache re-write module. It will work

    1. "sudo a2enmod rewrite"
    2. "sudo service apache2 restart"
    Login or Signup to reply.
  2. Update .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
    </IfModule>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search