#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,688
    Rep Power
    171

    Zend framework 2 "Forbidden"! You don't have permission to access / on this server.


    Hi;

    Why can't I open this website? Zend seems to be installed and there appears to be a permission problem I can't find! Right directories are 755.

    Can you please have a look and see what I missed? Thanks



    http://flatmatescentre.com/
    Forbidden

    You don't have permission to access / on this server.
    Apache/2.2.22 (Ubuntu) Server at flatmatescentre.com Port 80
    Code:
    root@behnam:/etc/apache2# cat sites-enabled/flatmatescentre.com 
    <VirtualHost 119.9.42.203:80>
            ServerName flatmatescentre.com
            ServerAlias www.flatmatescentre.com
            #### This is where you put your files for that domain: /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication/public
            DocumentRoot /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication/public
    
    	#RewriteEngine On
    	#RewriteCond %{HTTP_HOST} ^flatmatescentre.com
    	#RewriteRule ^(.*)$ http://www.flatmatescentre.com [R=301,L]
    
            <Directory /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication/public>
                    Options -Indexes FollowSymLinks -MultiViews
                    AllowOverride All
    		Order deny,allow
    		Allow from all
           		 Require all granted 
     </Directory>
            CustomLog /var/log/apache2/flatmatescentre.com-access.log combined
            ErrorLog /var/log/apache2/flatmatescentre.com-error.log
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
    </VirtualHost>
    root@behnam:/etc/apache2# cd /var/www/vhosts/flatmatescentre.com/
    root@behnam:/var/www/vhosts/flatmatescentre.com# ls -la
    total 12
    drwxr-xr-x 3 root root 4096 Oct 24 04:22 .
    drwxr-xr-x 6 root root 4096 Oct 24 04:22 ..
    drwxr-xr-x 8 root root 4096 Oct 24 04:21 ZendSkeletonApplication
    root@behnam:/var/www/vhosts/flatmatescentre.com# cd ZendSkeletonApplication/
    root@behnam:/var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication# ls -la
    total 940
    drwxr-xr-x 8 root root 4096 Oct 24 04:21 .
    drwxr-xr-x 3 root root 4096 Oct 24 04:22 ..
    -rw-r--r-- 1 root root 338 Oct 10 06:38 composer.json
    -rw-r--r-- 1 root root 6228 Oct 24 04:19 composer.lock
    -rw-r--r-- 1 root root 891620 Oct 10 06:38 composer.phar
    drwxr-xr-x 3 root root 4096 Oct 10 06:38 config
    drwxr-xr-x 3 root root 4096 Oct 10 06:38 data
    drwxr-xr-x 8 root root 4096 Oct 24 04:14 .git
    -rw-r--r-- 1 root root 94 Oct 10 06:38 .gitignore
    -rw-r--r-- 1 root root 92 Oct 10 06:38 .gitmodules
    -rw-r--r-- 1 root root 1807 Oct 10 06:38 init_autoloader.php
    -rw-r--r-- 1 root root 1548 Oct 10 06:38 LICENSE.txt
    drwxr-xr-x 3 root root 4096 Oct 10 06:38 module
    drwxr-xr-x 6 root root 4096 Oct 10 06:38 public
    -rw-r--r-- 1 root root 2018 Oct 10 06:38 README.md
    drwxr-xr-x 6 root root 4096 Oct 10 06:38 vendor
    root@behnam:/var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication#
    Code:
    root@behnam:/var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication# zf
                              An Error Has Occurred                         
     An action and provider is required.                                    
    
    Zend Framework Command Line Console Tool v1.11.11
    Usage:
        zf [--global-opts] action-name [--action-opts] provider-name [--provider-opts] [provider parameters ...]
        Note: You may use "?" in any place of the above usage string to ask for more specific help information.
        Example: "zf ? version" will list all available actions for the version provider.
    
    Providers and their actions:
      Version
        zf show version mode[=mini] name-included[=1]
        Note: There are specialties, use zf show version.? to get specific help on them.
    
      Config
        zf create config
        zf show config
        zf enable config
        Note: There are specialties, use zf enable config.? to get specific help on them.
        zf disable config
        Note: There are specialties, use zf disable config.? to get specific help on them.
    
      Phpinfo
        zf show phpinfo
    
      Manifest
        zf show manifest
    
      Profile
        zf show profile
    
      Project
        zf create project path name-of-profile file-of-profile
        zf show project
        Note: There are specialties, use zf show project.? to get specific help on them.
    
      Application
        zf change application.class-name-prefix class-name-prefix
    
      Model
        zf create model name module
    
      View
        zf create view controller-name action-name-or-simple-name module
    
      Controller
        zf create controller name index-action-included[=1] module
    
      Action
        zf create action name controller-name[=Index] view-included[=1] module
    
      Module
        zf create module name
    
      Form
        zf enable form module
        zf create form name module
    
      Layout
        zf enable layout
        zf disable layout
    
      DbAdapter
        zf configure db-adapter dsn section-name[=production]
    
      DbTable
        zf create db-table name actual-table-name module force-overwrite
        Note: There are specialties, use zf create db-table.? to get specific help on them.
    
      ProjectProvider
        zf create project-provider name actions
  2. #2
  3. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,661
    Rep Power
    4124
    Probably not a PHP issue, guessing apache or linux

    My first guess is that because the folder is owned by user "root" and is also part of the "roor" usergroup it means that apache (the software also sets up a user called 'apache') (or any group the apache user is in) is not allowed to even look at the folder.

    try

    Code:
    chown apache:apache -R public/
    whin inside this folder

    Code:
    /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication
    Last edited by Northie; October 24th, 2013 at 03:40 AM.
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]
  4. #3
  5. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,295
    Rep Power
    9400
    That Forbidden message is one given by Apache. As such, check its error logs.
  6. #4
  7. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,688
    Rep Power
    171
    Hi;

    Originally Posted by requinix
    That Forbidden message is one given by Apache. As such, check its error logs.
    Error log file is empty:

    Code:
    root@behnam:/etc/apache2# tail  /var/log/apache2/flatmatescentre.com-error.log
    This means it is not logging the errors based on what I have selected in sites-enables/flatmatescentre.com

    Code:
    root@behnam:/etc/apache2# cat sites-enabled/flatmatescentre.com 
    <VirtualHost 119.9.42.203:80>
            ServerName flatmatescentre.com
            ServerAlias www.flatmatescentre.com
            #### This is where you put your files for that domain: /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication/public
            DocumentRoot /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication/public
    
    	#RewriteEngine On
    	#RewriteCond %{HTTP_HOST} ^flatmatescentre.com
    	#RewriteRule ^(.*)$ http://www.flatmatescentre.com [R=301,L]
    
            <Directory /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication/public>
                    Options -Indexes FollowSymLinks -MultiViews
                    AllowOverride All
    		Order deny,allow
    		Allow from all
           		 Require all granted 
     </Directory>
            CustomLog /var/log/apache2/flatmatescentre.com-access.log combined
            ErrorLog /var/log/apache2/flatmatescentre.com-error.log
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
    </VirtualHost>

    What's the go?
    Thank you






    Edit:

    tail -f /var/log/apache2/access.log

    does not store any errors either, it stores only requests
    Code:
    ==> ben.flatmatescentre.com-access.log <==
    203.122.223.123 - - [25/Oct/2013:00:01:36 +0000] "GET / HTTP/1.1" 403 501 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Firefox/24.0"
    Access.log is also empty:
    Code:
    root@behnam:/var/log/apache2# tail -f flatmatescentre.com-access.log
    Last edited by English Breakfast Tea; October 24th, 2013 at 08:03 PM.
  8. #5
  9. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,688
    Rep Power
    171
    Originally Posted by Northie
    try

    Code:
    chown apache:apache -R public/
    whin inside this folder

    Code:
    /var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication
    root@behnam:/var/www/vhosts/flatmatescentre.com/ZendSkeletonApplication# chown apache:apache -R public/
    chown: invalid user: `apache:apache'
  10. #6
  11. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,688
    Rep Power
    171
    Got it working:

    Apache was not looking for the file on the document root I set!

    In conf.d/virtual.conf

    NameVirtualHost *

    [Fri Oct 25 00:20:39 2013] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
    Because of the directive NameVirtualHost *

    Looks like mixing NameVirtualHost * with NameVirtualHost *:80 is not supported. So just removed it.

IMN logo majestic logo threadwatch logo seochat tools logo