Login Action is unauthorized
Posted: 10 Mar 2017, 00:01
I'm really stuck. I'm trying to get Aimeos working on a subdirectory of my website (all just for development).
I'm in windows 10, but using shared hosting, using putty as my command line interface, Laravel version 5.4.15, mysql version 10.1.18-MariaDB-cll-lve. I use Netbeans for the development environment.
I managed to get it to work on March 3rd, but haven't managed to duplicate my success since.
My most recent try included:
1. Creating a new subdomain
2. Create a new instance of Laravel using the cPanel softaculous 1-click apps installer into the new subdomain
3. Create my project in Netbeans
4. Rename index.php to index-old.php, rename server.php to index.php and copy the .htaccess file from the public folder into the root folder
5. Create a new mysql database
6. get app key from config/app
7. put database and app key into .env.example and saveas .env
8. update the composer.json file to be like:
9. remove the mb4 from config/database.php mysql entries (even though I would have thought my mysql version should have been able to handle the longer entries), it never works when I don't do this.
10. composer dump-autoload
11. composer update
12. add the following to config/app.php
13. php artisan config:cache
14. php artisan vendor:publish
15. php artisan migrate (always says "nothing to migrate")
16. I tried to not have to do this step, but I always get database errors when I don't
Just uncomment all the commented-out entries in my shop.php (after syncronizing my config folder in Netbeans) and replace the host, port, database, user and password values like:
17. php artisan aimeos:setup --option=setup/default/demo:1 1>setup.log
18. php artisan aimeos:cache
19. php artisan aimeos:account --admin adminuser[at]gm.com 2>setup.err
After getting my app.blade.php file into my views folder I was hoping to see my list page work, but it had the issue that the Login view wasn't available (I can't recall exactly what this was saying, I can reproduce if I have to)
I read that we are supposed to do the php artisan make:auth command, so I did that and now, list brings up a blank page, admin makes me login and just takes me back to home and when I put the "jqadm/search/dashboard?site=default&lang=en" URL in I get the following error:
I'm in windows 10, but using shared hosting, using putty as my command line interface, Laravel version 5.4.15, mysql version 10.1.18-MariaDB-cll-lve. I use Netbeans for the development environment.
I managed to get it to work on March 3rd, but haven't managed to duplicate my success since.
My most recent try included:
1. Creating a new subdomain
2. Create a new instance of Laravel using the cPanel softaculous 1-click apps installer into the new subdomain
3. Create my project in Netbeans
4. Rename index.php to index-old.php, rename server.php to index.php and copy the .htaccess file from the public folder into the root folder
Code: Select all
Copy over the following below "RewriteEngine On"
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
#<Files ~ "\.env$"> Order allow,deny Deny from all </Files>
RewriteRule ^.env - [F,L,NC]
RewriteRule ^(public/) - [F,L,NC]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
6. get app key from config/app
7. put database and app key into .env.example and saveas .env
8. update the composer.json file to be like:
Code: Select all
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"prefer-stable": true,
"minimum-stability": "dev",
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"aimeos/aimeos-laravel": "~2017.01",
"laravelcollective/html": "^5.3.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"/usr/local/bin/php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"/usr/local/bin/php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"/usr/local/bin/php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"/usr/local/bin/php artisan optimize",
"php artisan vendor:publish --tag=public --force",
"php artisan vendor:publish",
"php artisan migrate"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"cache-dir": "/home/earthhis/ts5.earthhistory.ca/cache"
}
}
10. composer dump-autoload
11. composer update
12. add the following to config/app.php
Code: Select all
return array(
'providers' => array(
...
Aimeos\Shop\ShopServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
),
);
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
14. php artisan vendor:publish
15. php artisan migrate (always says "nothing to migrate")
16. I tried to not have to do this step, but I always get database errors when I don't
Just uncomment all the commented-out entries in my shop.php (after syncronizing my config folder in Netbeans) and replace the host, port, database, user and password values like:
Code: Select all
'adapter' => env('DB_CONNECTION', 'mysql'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'socket' => '',
'database' => env('DB_DATABASE', 'dbname'),
'username' => env('DB_USERNAME', 'user'),
'password' => env('DB_PASSWORD', 'secret'),
18. php artisan aimeos:cache
19. php artisan aimeos:account --admin adminuser[at]gm.com 2>setup.err
After getting my app.blade.php file into my views folder I was hoping to see my list page work, but it had the issue that the Login view wasn't available (I can't recall exactly what this was saying, I can reproduce if I have to)
I read that we are supposed to do the php artisan make:auth command, so I did that and now, list brings up a blank page, admin makes me login and just takes me back to home and when I put the "jqadm/search/dashboard?site=default&lang=en" URL in I get the following error:
Please let me know where I went wrong.HttpException in Handler.php line 133: This action is unauthorized.