0

I needed to upgrade my Debian OS version on a server, from 7 to 8. So i did :

  • aptitude update
  • aptitude upgrade to have the latest wheezy packages, then
  • change in /etc/apt/source.list (and other source.list.d/ files) the term wheezy to jessie
  • aptitude update
  • aptitude dist-upgrade
  • i rebooted the server

Then i changed my vhost file names with the new config extension :

/etc/apache2/sites-available/mydomain to /etc/apache2/sites-available/mydomain.conf

here's one example :

<VirtualHost *:80>
        ServerName mydomain
        DocumentRoot /var/www/mydomain/web
        <Directory /var/www/mydomain/web>
            Options Indexes Multiviews FollowSymLinks
            AllowOverride all
            Require all granted
        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app.php [QSA,L]
        </IfModule>
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error-mydomain.log
        CustomLog ${APACHE_LOG_DIR}/access-mydomain.log combined
</VirtualHost>

and after that i restarted apache service

In that case, the website was reachable, BUT, it wasn't working properly because the rewrite rules didn't apply !

Though,

  • I checked the apache config had no error
  • the mod_rewrite module was active (it was in the /etc/apache2/mods-enabled/ and in phpinfo())

  • i also tried to remove the <IfModule mod_rewrite.c> statement in the vhost, leaving the rewrite rules and reloading the config : the rules weren't followed.

  • i also tried to put the rewrite rules in a .htaccess at the root of the website : it didn't work as well

This is most disturbing.

What could be the problem ? what log or config file should i check ? Are there other step i should do when upgrading Debian 7 to 8 concerning the rewrite module ?

Thank you

Overdose
  • 101
  • Typically you check the the error log, either the virtual host specific one you defined (error-mydomain.log) or the generic apache error log. – HBruijn Aug 18 '16 at 07:34
  • i forgot to mention i did. And there was no message concerning the rewrite... – Overdose Aug 18 '16 at 08:30
  • Next time, *especially* for such invasive changes as upgrading the entire operating system, I recommend doing it in staging before doing it to production. – user Nov 05 '16 at 15:00

1 Answers1

0

I have same problem but I found the answer.

Go to:

/etc/apache2/sites-available/

and edit your file of vhosts (my file was called 000-default.conf)

And you must add this

AllowOverride All

or

AllowOverride FileInfo

Example:

<VirtualHost *:80>
<Directory />
        AllowOverride All
</Directory>
ServerName tududu.pl
DocumentRoot /var/tududu
</VirtualHost>

after that you must

service apache2 restart
tengopl
  • 101
  • 2