Search code examples
linuxapacheubuntuvhostslinux-mint

Error setting up multiple vhosts with Apache2 on Mint 15


I just installed Apache2 on mint 15. I am able to see the localhost and so decided to add virtual hosts for my projects.

  1. I have added the hostnames at /etc/hosts

    127.0.0.1 eclipse

  2. I also added vhost details at /etc/apache2/site-avaliable:

    <VirtualHost *:80>
    ServerAdmin webmaster@eclipse
    ServerName eclipse
    ServerAlias www.eclipse
    
    # Indexes+Document Root
    DirectoryIndex index.html index.php
    DocumentRoot /home/cygnus/Dropbox/Workspace_Eclipse
    
    #logfiles
    ErrorLog /var/log/apache2/eclipse-error.log
    CustomLog /var/log/apache2/eclipse-access.log combined
    
    <Directory /home/cygnus/Dropbox/Workspace_Eclipse>
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1
    </Directory>
    <IfModule dir_module>
        DirectoryIndex index.php index.html
    </IfModule>
    
    </VirtualHost>
    
  3. I activated the vhost using:

    sudo a2ensite example.com 
    
  4. Also added following to /etc/apache2/httpd.conf

    ServerName localhost
    ServerName eclipse
    

After all the work I checked:

    http://localhost - works OK.
    http://eclipse - gives 403 error.

Do I need to do anything more to add vhost in linux? Did I miss or mess up some step? Any help is appreciated - Thanks in advance :)

Update: I tried changing the DocumentRoot to "/var/www/test/" - this works but I need it to work at home level.

I used chown and chgrp to set owner and group to both www-data and root - neither worked.


Solution

  • Found my answer here

    All I was missing was: chmod -R 755 /home/cygnus/Dropbox/*