3

I'm trying to set up a development environment on a virtual machine running Ubuntu 14.04 LTS using Nginx and HHVM. To do this, I followed the tutorial here.

This goes well with a new installation of Laravel. But when I import an existing Laravel 4 project and try to open that on my actual machine (which will serve as the client running Windows 7), I'm getting a 404 File Not Found error on the screen while connecting to http://sav.savrichard.dev. I did add this to the hosts file with the correct IP Address.

The virtual machine is receiving the request and responds with a 404 error.

How do I solve this error? I'm pretty new to Ubuntu so I'm not exactly sure what's wrong.

The project is located at

/var/www/sav.savrichard.net

The server configuration is as follow:

server {
    listen 80 default_server;

    root /var/www/sav.savrichard.net/public;
    index index.html index.htm index.php;

    server_name sav.savrichard.dev;

    access_log /var/log/nginx/localhost.sav.savrichard.dev-access.log;
    error_log  /var/log/nginx/localhost.sav.savrichard.dev-error.log error;

    charset utf-8;

    location / {
        try_files \$uri \$uri/ /index.php?\$query_string;
    }

    location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt  { log_not_found off; access_log off; }

    error_page 404 /index.php;      

    include hhvm.conf;

    # Deny .htaccess file access
    location ~ /\.ht {
        deny all;
    }
}

And the hhvm.conf file is:

location ~ \.(hh|php)$ {
    fastcgi_keep_conn on;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

Edit 1 (13-06-2014)
I tried to do a fresh install using a different Ubuntu 14.04 VM, but I'm getting the same error when trying to access the root directory through localhost in the browser. The error is, like last time, 404 File Not Found.

Edit 2 (13-06-2014)
As by request of roadmr, here are the entries in the access and error logs.

Access log

Access log

The entries read like this:
192.168.174.1 - - [13/Jun/2014:10:16:45 -0700] "GET / HTTP/1.1" 404 49 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)

Error log

Error log

Yes, the error log is actually blank.

Edit 3 (13-06-2014)
Added the same entry to the Ubuntu host file as I have in the Windows machine. Same result.

Edit 4 (13-06-2014)
Maybe it's useful to note that the local IP Address of the Ubuntu VM is 192.168.174.130 and the local machine running Windows 7 is 192.168.2.105

karel
  • 122,292
  • 133
  • 301
  • 332
MisterBla
  • 81
  • 1
  • 7

2 Answers2

0

I would like to try a possible solution with you today. Edit your configuration file. At the try_files line replace the whole line with try_files $uri $uri/ /index.php?$query_string;

0

found a solution yet? it happens because copied files from other computer gives permission 600 for files and folders. you need to change the permission for files 644 and 755 for folders, except for app/storage folder (Laravel 4) and storage folder (for laravel 5) need to have 775 permission.. this line below helps me.. I'm pretty sure it will help you too..I'm using Laravel 4.2, so if you are using Laravel 5, change your path for storage folder

sudo find /var/www/project_name \( -type d -exec chmod 755 -- {} + \) -o \( -type f -exec chmod 644 -- {} + \)
sudo chgrp -R www-data /var/www/project_name
sudo chmod -R 775 /var/www/project_name/app/storage
David Foerster
  • 36,890
  • 56
  • 97
  • 151