1

i implement laravel on vps server that just have a ip address and have no domain.

its work and show the index file but routing is not working and show me 404 not found page.

this is my web.php file:

<?php


Route::get('/', function () {
    return view('welcome');
});

Route::get('/test' , function(){
    return 'this is test route';
});

and in the .env file set the ip:

APP_URL=http://178.63.245.92

and this is the ip address of my vps : http://178.63.245.92/

when i say : http://178.63.245.92/test its say:

Not Found
The requested URL /test was not found on this server.

what is have to do.

thanks.

meti
  • 468
  • 1
  • 5
  • 27

2 Answers2

3

@IlGala Thank You for point the my mod_rewrite module, mymod_rewrite module was Enable but i read here after you Enbale my mod_rewrite you have to allow Apache to read .htaccess files located under the /var/www/html directory. i grant the access as the structures says on that page and its solved.

thanks every body.

meti
  • 468
  • 1
  • 5
  • 27
1

You can set route to desired ip address using this command

php artisan serve --host 178.63.245.92 --port 80
Suvin94
  • 283
  • 9
  • 30
  • i serve it and its say : ErrorException : chdir(): No such file or directory (errno 2) – meti Sep 26 '19 at 08:40
  • this post could help you:) https://stackoverflow.com/questions/30873773/laravel5-chdir-no-such-file-or-directory-errno-2 – Suvin94 Sep 26 '19 at 08:46
  • If the address is already in use, it will be because a child process is still alive. Once that process is found and killed, you will be able to reissue that command. – Jim Grant Sep 26 '19 at 09:02
  • @Suvin94 thank you , i solve the issue and serve it again and its say : "Failed to listen on 178.63.245.92:80 (reason: Address already in use) " – meti Sep 26 '19 at 09:03
  • @Jim Grant if i restart the server is gonna be solved? – meti Sep 26 '19 at 09:04
  • Yes, you have to kill the running service first @meti – Suvin94 Sep 26 '19 at 09:06