1

I'm sorry if this is a repeated question, but i have tried all the possible solutions from the other answers...

I just installed apache, php5, ..., the works

I can access http://localhost and get the apache index.html located at /var/www

I did the following:
in sites-available: sudo cp default mydefault
opened it and got this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

So i changed DocumentRoot /var/www to my folder and <Directory /var/www> to my folder. Inside this Directory tag, i changed Allow Override to All and inserted DirectoryIndex index.html index.php

I saved, and ran

sudo chmod 755 /myDirectory  
sudo a2dissite default && sudo a2ensite mydefault 
sudo service apache2 restart 

And still get 403 forbidden when accessing http://localhost

Any help wil be appreciated, thanks

5
  • I am unsure why but in my system the file is named 00-default in both /etc/apache2/sites-available and /etc/apache2/sites-enabled. The contents of both files should be the same in order to avoid that error. Additionally I suggest you to "sudo apache2ctl stop" and "sudo apache2ctl start" in order to the changes to take effect. Sometimes a reboot fixes this issue. Please let me know if this helps you in order to add it as an answer. Mar 4, 2012 at 21:29
  • appart from the "00-" there is no difference at all, they are the same because the one in sites-enabled is a symlink to the one in sites-available. I did apache2ctl stop and start, no change Mar 4, 2012 at 21:36
  • Post the configuration file you are actually using, not the one you used as a template. check the permissions on the directory and what is in the logs ?
    – Panther
    Mar 4, 2012 at 21:59
  • 1
    Use 'tail -f /var/log/apache2/error.log' as you load the site to glean the problem.
    – user8290
    Mar 4, 2012 at 23:46
  • 1
    the problem was that i had SELinux installed, i think. I reinstalled linux, didn't "encrypt my home folder" and now it works. Mar 5, 2012 at 13:52

1 Answer 1

2

OP posted

the problem was that i had SELinux installed, i think. I reinstalled linux, didn't "encrypt my home folder" and now it works. – André Alçada Padez Mar 5 '12 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .