Laravel 5, Plesk 12, PHP 5.6, Ubuntu 14 and Forbidden 403

Hello all,

I really wast a lot of time to resolve this issue. I want to install laravel on my dedicated server to be able to learn it, so always I get a forbidden page :

http://demo.beginfromhere.com/

I have Plesk 12, PHP 5.6, Ubuntu 14 and this is my .conf file :

<VirtualHost *:80>
    ServerName 85.25.139.98
    DocumentRoot /var/www/vhosts/beginfromhere.com/demo/public/
    # Alias / "/var/www/vhosts/beginfromhere.com/demo/public"
    <Directory /var/www/vhosts/beginfromhere.com/demo/public/>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/myproject-error.log

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

    CustomLog ${APACHE_LOG_DIR}/myproject-access.log combined

</VirtualHost>

Can you please help me to resolve this issue ?

Best regards

Try omitting the trailing slash:

 DocumentRoot /var/www/vhosts/beginfromhere.com/demo/public

Edit:
Your server will have to be restarted:
service apache2 restart

Try also to view the error log file:
${APACHE_LOG_DIR}/myproject-access.log

// maybe this directory and filename
/var/log/apache2/myproject-access.log

Also:
If you are using FileZilla, check the “File Permissions”, Ownership, Group and Public Permissions. Try setting permissions as 0755 and ensure to include the preceding 0 to make it Octal;

Hello John,

Thank you for your interest.

I removed the slash after public as you mentioned, and restert Apache, but without success.

I check this file by typing nano myproject-access.log and find it empty

and I have also FileZilla, and everything is OK concerning the chmod;

This problem made me CRAZY :confounded:

Assuming you have command line access, what does ls -la show the permissions as being? The should show the same as FileZilla, but there’s more info at the command line than that will show - could you get a screenshot of the result?

Hello chrisofarabia

Thank you for your interest

Sure, this is the result :

total 196
drwxr-x--- 11 www-data      www-data   4096 Oct 29 06:59 .
drwx--x---  7 beginfromhere psaserv    4096 Oct 29 06:15 ..
drwxr-xr-x 10 www-data      www-data   4096 Aug 30 13:31 app
-rwxr-xr-x  1 www-data      www-data   1646 Aug 30 13:31 artisan
drwxr-xr-x  3 www-data      www-data   4096 Aug 30 13:31 bootstrap
-rw-r--r--  1 www-data      www-data   1201 Aug 30 13:31 composer.json
-rw-r--r--  1 www-data      www-data 105855 Oct 29 06:15 composer.lock
drwxr-xr-x  2 www-data      www-data   4096 Aug 30 13:31 config
drwxr-xr-x  5 www-data      www-data   4096 Aug 30 13:31 database
-rw-r--r--  1 www-data      www-data    323 Oct 29 06:15 .env
-rw-r--r--  1 www-data      www-data    307 Aug 30 13:31 .env.example
-rw-r--r--  1 www-data      www-data     61 Aug 30 13:31 .gitattributes
-rw-r--r--  1 www-data      www-data     57 Aug 30 13:31 .gitignore
-rw-r--r--  1 www-data      www-data    503 Aug 30 13:31 gulpfile.js
-rw-r--r--  1 www-data      www-data    159 Aug 30 13:31 package.json
-rw-r--r--  1 www-data      www-data     87 Aug 30 13:31 phpspec.yml
-rw-r--r--  1 www-data      www-data    899 Aug 30 13:31 phpunit.xml
drwxr-xr-x  2 www-data      www-data   4096 Aug 30 13:31 public
-rw-r--r--  1 www-data      www-data   1928 Aug 30 13:31 readme.md
drwxr-xr-x  5 www-data      www-data   4096 Aug 30 13:31 resources
-rw-r--r--  1 www-data      www-data    567 Aug 30 13:31 server.php
drwxr-xr-x  5 www-data      www-data   4096 Aug 30 13:31 storage
drwxr-xr-x  2 www-data      www-data   4096 Aug 30 13:31 tests
drwxr-xr-x 29 www-data      www-data   4096 Oct 29 06:15 vendor

and this the result from outside the folder of the subdomain ( demo.beginfrfomhere.com)

total 28
drwx--x---  7 beginfromhere psaserv     4096 Oct 29 06:15 .
drwxr-xr-x 17 root                root          4096 Oct 28 00:43 ..
drwxr-x--- 11 www-data      www-data 4096 Oct 29 06:59 demo
drwxr-xr-x  2 beginfromhere psacln       4096 Sep 28 17:38 error_docs
drwxr-x---  9 beginfromhere psaserv     4096 Oct 29 05:24 go
drwxr-x---  6 beginfromhere psaserv     4096 Sep 28 17:38 httpdocs
drwx------  4 beginfromhere root           4096 Oct 29 06:25 logs

@bbparis

Try Googling for “Linux create sub-domain”

Looks like Dns and A-records require setting.

I’m very sure that the whole problem comes from the virtual host, when I put any file inside the folder like “Hello World” it works, and when I install laravel projet, it doesn’t work.

I know that this kind of problem is not easy to be resolved easily

Any help ?

Hello,

I just resolved this issue. I want to say very important point if you are PLESK.

Apache comes inside Plesk, for that, you can’t do anything concerning the configuration of Virtual Host inside :

/etc/apache2/sites-available

If you want to configure a website, you should go to here :

/var/www/vhosts/system/yourwebsite.com/conf/vhost.conf

or if you want to configure a subdomain, go to here :

/var/www/vhosts/system/subdomain.yourwebsite.com/conf/vhost.conf

VoilĂ 

1 Like

I am glad you managed to solve your problem, also to return and let us know the good news.

I am not using PLESK just Apache2 and Linux Ubuntutu 14.04. I also had strange sub-domain problems with my site which I eventually solved.

I setup one sub-domain which worked and did everything that I wanted it to do. Foolishly I copied the Virtual Host file, renamed, changed paths and enabled using a2ensite sub-002 and service apache2 restart.

The sub-domain refused to render and eventually traced the problem to a .htaccess file with every declaration #remmed.
`
123.456.789.876 - - [sub-002.mysite.com/sid#7f02093c5f20]
[rid#7f02093b1028/initial/redir#5]
[perdir /var/www/mysite.com/public_html/]
internal redirect with /var/www/mysite.com/public_html/index.php
[INTERNAL REDIRECT]

Removing the htaccess file and the index.php file rendered as expected. 

VoilĂ 

Now onto the next problem :grinning:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.