0

I've seen all the help that I could find and since I cannot get it to work I thought I asked. I want to start developing html+php. I have a Apache web server with all the bells and whistles working for several servers like a bugtracker and a project manager. Also I'm running debian GNU Linux. The problem is testing my webpages. As far as I know I can only make them work by copying them to a folder in the /var/www/ folder of my machine as that is the default location from where Apache reads them. The info I've read on the web has suggested that the solution is to change the default file in the sites-available folder. The path to the file is: /etc/apache2/sites-available/000-default.conf. where I have modified it to look like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

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

    Alias /pruebas/ "/home/ariela/ownCloud/Tutoriales/PHP/"
    <Directory "/home/ariela/ownCloud/Tutoriales/PHP/">
            AllowOverride All
            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
</VirtualHost>

The Alias pruebas and the directory below are the lines I've added everything else is the same. I have a very simple file called myfile.php in the directory and when I write in the browser :

http://localhost/pruebas/myfile.php  

I get the 403 forbidden error message.

What am I doing wrong? Because otherwise the only way to test my php page is to be root, or what am I missing?

Thank you for any answer.

aarelovich
  • 5,140
  • 11
  • 55
  • 106

1 Answers1

0

Check permissions of the directory and its contents, maybe Apache can't read them. If you don't want to set them readable for all, you can consider adding the user ariela to the Apache group (usually apache or www-data) so she can change the group by herself.

Edit: Also check the Listen directive does allows clients from interfaces other than loopback.

Edit2: If you are working with Apache 2.4, it looks like access control configuration has changed a bit and you are getting an AH01630 error. Take a look at the documentation.

Community
  • 1
  • 1
CijcoSistems
  • 266
  • 1
  • 5
  • Well I've checked the PHP folder and got this drwxr-xr-x+ 2 ariela ariela 4096 Dec 3 06:59 PHP. I've also made the myfile.php executable. And I've tried to use the line usermod -a -G www-data ariela, it worked and I still get the same 403 error.... – aarelovich Dec 03 '13 at 11:19
  • Maybe /var/log/apache2/error.log (depending on your configuration) gives some hints. – CijcoSistems Dec 03 '13 at 11:29
  • This is line is repeated multiple times. I assume of all the failed attempts: [Tue Dec 03 08:30:14.257278 2013] [authz_core:error] [pid 7752] [client 192.168.2.100:59697] AH01630: client denied by server configuration: /home/ariela/ownCloud/Tutoriales/PHP/myfile.php – aarelovich Dec 03 '13 at 11:42
  • Answer edited: does it work if you explicitly type http:// **127.0.0.1** /pruebas/myfile.php ? – CijcoSistems Dec 03 '13 at 11:59