amazon-ec2


Laravel passport 500 internal server error on EC2


I'm building an app using Angular 2 (no known as 4) as frontend and Laravel 5.4 as API backend. I'm using Laravel's passport password grant feature to authenticate user access to API.
The Frontend is not directly accessing oauth routes. My custom auth controller is talking to oauth/token to get the grant values.
This setup is working perfectly fine in my local environment, but in AWS EC2 it throws 500 internal server error.
I thought it could be related to GuzzleHttp\Client, but it was not. Even if I try to access oauth/token directly from Postman, it still throws 500 internal server error.
private function getPasswordGrant($username, $rawPassword) {
$http = new HttpClient();
$url = url('/') . "/oauth/token";
return $http->post($url, [
"form_params" => [
"grant_type" => "password",
"client_id" => config("auth.oauth_password_grant_client_id"),
"client_secret" => config("auth.oauth_password_grant_client_secret_key"),
"username" => $username,
"password" => $rawPassword,
"scope" => "*",
],
]);
}
This is the function in my custom Auth Controller which requests for password grant after the user being authenticated in another method (login and signup).
Most amazing thing is there's nothing logged in either laravel or apache logs.
Alright, after a lot of struggle and debugging. It turned out to be apache was unable to write into storage/logs/laravel.log and causing this problem. After giving appropriate permissions to storage/ folder everything is working as expected.

Related Links

How to create another AMI on the same EC2 instance
Calculate running/cumulative cost of EC2 spot instance
Integrating IBM RAD with Websphere on Amazon EC2
uploadify what port ? on amazon ec2 issues
Copy files from local linux computer to amazon aws linux instance [closed]
where can I find source rpm for amzn repo?
Are there any Amazon AWS Loadbalancer GUI tools?
Different between Utilizations for Amazon EC2
How can I see which EC2 instances are associated with my Elastic Beanstalk application?
How do I install byobu in ec2 ami
Can't SSH into AWS Permission denied (publickey)
Amazon EC2 PublicDnsName
How to make server image for load balancing?
Integrating Amazon SES with Sendmail to EC2 Server
AWS EC2 High CPU alarms going off
How do I use ELB's HealthyHostCount for monitoring in CloudWatch?

Categories

HOME
compiler-construction
ionic-framework
atom-editor
keras
azure-data-factory
kde
youtube-dl
framework7
sqlite-net-extensions
amazon-ecs
fsm
dacpac
google-translate
windows-10-universal
collectd
messages
dtrace
vaadin7
after-effects
openrefine
tostring
facebook-page
jprofiler
grails3
jasonette
css-animations
info.plist
uninstall
social-media
saas
objectanimator
quote
bluestacks
gtrendsr
protovis
openoffice.org
mozilla
mapbox-gl
mmenu
catalog
space-complexity
streamsets
cookiecutter-django
particles.js
texmaker
fakeiteasy
chain-builder
jquery-nestable
carrot
sybase-asa
knpmenubundle
pillow
account-kit
query-performance
chord-diagram
google-cdn
slicknav
database-optimization
asp.net-4.5
apachebench
associative-array
pyke
teamcity-8.0
sdhc
metaclass
qdialog
wireshark-dissector
spidermonkey
purge
varargs
service-accounts
sailfish-os
processmodel
p2
e10s
jsapi
xc16
gui-test-framework
socketexception
zend-route
mcts
jmapviewer
easy-install
jplaton
pushbackinputstream
first-responder
venn-diagram
hosts-file
osql
gnu-prolog
genshi
gdlib
radcombobox
dbal
vc90
zend-tool
sef
uimenucontroller
zend-decorators
scripting-languages

Resources

Encrypt Message