boisterouslobster
boisterouslobster

Reputation: 1293

Digital Ocean Deployment Laravel

I'm having a bit of trouble deploying a new laravel app to my digital ocean account. I followed the steps outline in this tutorial: http://davidmyers.name/post/laravel-on-digital-ocean

Yet I find that upon trying to access the index page, I get:

Forbidden

You don't have permission to access / on this server.

Apache/2.4.7 (Ubuntu) Server at www.scheduleify.com Port 80

However, I am able to access PHPMyAdmin just fine by going to www.scheduleify.com/phpmyadmin

I have a feeling this has something to do with setting the default directory to the public folder.

In the article linked above, the author mentions that upon opening the file: /etc/apache2/sites-enabled/000-default.conf

One should see the following two lines:

DocumentRoot /var/www
<Directory /var/www>

This is my entire file, which seems to lack one of them (I've already modified the one that was there accordingly):

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /root/scheduleify/public

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host 

only   
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Another thing I noticed: If I ssh into my root directory, and go into the cloned repository/project folder, and try to run php artisan, I get the error:

Mcrypt PHP extension required.

However, if I run the command mcrypt from the same directory, I get:

mcrypt: Encrypted data will not be written to a terminal.
Redirect the output instead.
Use the --help parameter for more help.

Which suggests mcrypt is working. Any input/help is greatly appreciated. I'm very close to giving up, I've been going at this for hours and getting nowhere.


Update: The first error was resolved.

The 403 error remains; Checking the apache2 logs, I found this error:

[Fri Jan 16 09:38:31.855624 2015] [core:error] [pid 5641]   
(13)Permission denied: [client [removed]] AH00035: access to / denied 
(filesystem path '/root/scheduleify') because search permissions are 
missing on a component of the path

Upvotes: 1

Views: 3044

Answers (2)

boisterouslobster
boisterouslobster

Reputation: 1293

The issue was that I was placing the app inside of the root directory... This is a bad idea and would require additional apache configuration.

By moving the project out of the root folder (root/project) into the var/www/html/project directory, and going through the same process outlined in the article, I was able to get the app to work!

Upvotes: 0

akuseru
akuseru

Reputation: 61

For the first problem:

You don't have permission to access / on this server.

This is generally an issue with permissions. eg root owns /root/scheduleify and the web server (generally www-data on ubuntu & debian) can't read that directory.

chown -R www-data: /root/scheduleify

If this does fix the problem you will need to re-run this command every time you upload new files as root.

For the second problem:

Mcrypt PHP extension required.

can be fixed with:

apt-get install php5-mcrypt

finally restart apache.

sudo service apache2 restart

Upvotes: 2

Related Questions