1

I have installed Laravel, Voyager, and Voyager Front-end in an instance of Google Cloud Compute Engine (used the latest versions).

Using Ubuntu 18.04 as OS.

Apache as server (even tried Nginx resulting to the same 404 error).

Pushed the files to github with the following files/directories in the .gitignore file:

/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log

Pulled the files to another instance of Google Cloud Compute Engine.

Installed the web application using the following commands/procedures:


// created database
// installed nodejs and npm

$ sudo mkdir voyager                  // name of laravel directory
$ cd voyager
$ sudo git init
$ sudo git remote add origin https://github.com/oropezaqb/voyager.git
$ git remote
$ sudo git config credential.helper store
$ sudo git pull origin master

// configured Apache or Nginx
// setup .env file

$ sudo composer install
$ sudo php artisan key:generate
$ sudo composer dump-autoload
$ sudo php artisan migrate
$ sudo npm install
$ sudo npm run dev
$ sudo * * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1
$ sudo chgrp -R www-data storage bootstrap/cache
$ sudo chmod -R ug+rwx storage bootstrap/cache

Virutal Host config:

I have this in /etc/apache2/sites-enabled/000-default.conf....

<VirtualHost *:80> 
  <Directory /var/www/html/voyager/public> 
    Options 
    Indexes 
    FollowSymLinks 
    MultiViews 
    AllowOverride All 
    Require all 
    granted Order allow,deny 
    allow from all 
  </Directory> 
  ServerAdmin webmaster@localhost 
  DocumentRoot /var/www/html/voyager/public 
  ErrorLog ${APACHE_LOG_DIR}/error.log 
  CustomLog ${APACHE_LOG_DIR}/access.log 
  combined 
</VirtualHost>

But the home page displays a 404 error message.

Petay87
  • 1,700
  • 5
  • 24
  • 39
bien
  • 11
  • 1
  • Can you include you apache virual host config please and when is the URL you are attempting to get to? Also, do you have the apache mod re-rewrite enabled? – Petay87 Jul 18 '19 at 09:11
  • Like @Petay87 said, configuration of your vhost is most likely the problem. Second, I don't see any reason to use 'sudo' for every command here. – dbf Jul 18 '19 at 09:25
  • Also, sudo * * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1 isn't correct. * * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1 should be added to crontab not ran as a command. ALso make sure to change /path-to-your-project to the actual path to your directory – Petay87 Jul 18 '19 at 09:28
  • What is the location of config file @Petay87? Here's the URL http://34.67.240.251/. I have the apache mod re-rewrite enabled. – bien Jul 18 '19 at 09:35
  • Thank you @dbf. I will try to study how to avoid using sudo. – bien Jul 18 '19 at 09:36
  • You haven't configured a virtual host yet? That will be your issue. You need to create a virtual host in /etc/apache2/sites-available then use sudo a2ensite nameofconfig to make it live. These might help https://stackoverflow.com/questions/49184358/setting-document-root-for-laravel-project-on-apache-virtual-host && https://laravel.io/forum/04-27-2014-laravel-virtual-hosts-apache-aaah – Petay87 Jul 18 '19 at 09:37
  • Okay. Will use * * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1 in crontab. Thank you. I indicated DocumentRoot /var/www/html/voyager/public in /etc/apache2/sites-enabled/000-default.conf. – bien Jul 18 '19 at 09:39
  • @Petay87 I have this in /etc/apache2/sites-enabled/000-default.conf.... Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted Order allow,deny allow from all ServerAdmin webmaster@localhost DocumentRoot /var/www/html/voyager/public ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined – bien Jul 18 '19 at 09:44
  • When you did sudo mkdir voyager were you in the /var/www/html folder? If not, the folder was created elsewhere adn /var/www/html/voyager doesn't exist hense the 404. – Petay87 Jul 18 '19 at 09:51
  • @Petay87 Yes. I did sudo mkdir voyager in /var/www/html folder. I checked. I have voyager directory in /var/www/html. – bien Jul 18 '19 at 09:57
  • @Petay87 I have a development environment that is working here http://35.202.179.114. Only when I pushed in another instance, that I get the 404 error. – bien Jul 18 '19 at 09:59

0 Answers0