I managed to setup a virtual host, by using the following configuration:

<VirtualHost *:80>
    ServerName entwicklung.hausfux
    ServerAdmin black@live.de
    DocumentRoot /srv/www/vhosts/hausfux/
    ErrorLog /var/log/apache2/hausfux_error.log
    CustomLog /var/log/apache2/hausfux_access.log common

    <Directory "/srv/www/vhosts/hausfux/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

But now all urls include the path to the virtual host directory /srv/www/vhosts/hausfux/ e.g.:

http://entwicklung.hausfux/srv/www/vhosts/hausfux/skin/frontend/venedor/default/css/styles-venedor.css net::ERR_ABORTED 404 (Not Found)

instead of:


This is my .htaccess file:

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

What am I doing wrong?

  • Your web application decides what its URLs look like. This has nothing to do with Apache. Oct 19 '18 at 16:13
  • I am using magento 1.9. You only have to enter the base url. I entered the vhost name http://entwicklung.hausfux/ as base url as usual, which was always all I needed on WAMP when doing it with windows.
    – Black
    Oct 20 '18 at 7:17

I was able to solve it. The /media folder had not enough permission. I have set it to 777 now it works.

Solution found here.

  • 1
    The post you linked to has a serious error, which you have copied: It doesn't just make the folder writable by the apache user, it makes the folder writable by everyone. DO NOT DO THIS. It opens a massive security hole. Oct 22 '18 at 13:10
  • @MichaelHampton, Thats incorrect, I tried other permissions too, it only works with 777. I also tried 774 without success. The owner is set to my ftp user and the group to wwwrun
    – Black
    Oct 23 '18 at 8:05
  • Then you can fix either the owner or group, or use ACLs to make the permissions correct without having the security hole. I recommend ACLs. Oct 23 '18 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.