I hosted my laravel page in apache, now what?

I want to host my filament project, but i cannot put /admin at the end cuz it shows 404 error ive double checked my configuration but i cannot find the error
No description
No description
No description
51 Replies
DrByte
DrByte13mo ago
Have you installed Filament to your Laravel project? Have you created your Admin panel ? If yes, please post your panel definition from the AdminPanelProvider that Filament created in your app.
Dry Dood
Dry DoodOP13mo ago
yes! here it is: class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel ->default() ->id('admin') ->path('admin') ->login() ->brandName('Dry Commission Manager') ->colors([ 'primary' => Color::Purple, ]) ->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages') ->pages([ Pages\Dashboard::class, ]) ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\Filament\Widgets') ->widgets([ ]) ->middleware([ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, AuthenticateSession::class, ShareErrorsFromSession::class, VerifyCsrfToken::class, SubstituteBindings::class, DisableBladeIconComponents::class, DispatchServingFilamentEvent::class, ]) ->authMiddleware([ Authenticate::class, ]) ->navigationItems([ NavigationItem::make('Paypal Calculadora') ->icon('heroicon-o-calculator') ->activeIcon('heroicon-s-calculator') ->url('https://www.paypal.com/businesswallet/currencyConverter/USD?flow=cmV0dXJuVXJsPS9teWFjY291bnQvbW9uZXkmY2FuY2VsVXJsPS9teWFjY291bnQvbW9uZXk=}') ->group('Paypal Shit') ]);
}
}
Log in to your PayPal account
Transfer money online in seconds with PayPal money transfer. All you need is an email address.
DrByte
DrByte13mo ago
And you're getting a 404 when going to /admin ? Hmmm ... what's the output of php artisan about? And also php artisan route:list
Dry Dood
Dry DoodOP13mo ago
No description
No description
DrByte
DrByte13mo ago
Your Filament appears to be set strictly at 3.0.0 which is missing a lot of updates. Check your composer.json : what's filament set to exactly?
Dry Dood
Dry DoodOP13mo ago
This is how it looks like when i enter the domain, but as soon as i go to /admin, this happens
No description
No description
Dry Dood
Dry DoodOP13mo ago
lemme check { "name": "laravel/laravel", "type": "project", "description": "The skeleton application for the Laravel framework.", "keywords": [ "laravel", "framework" ], "license": "MIT", "require": { "php": "^8.1", "filament/filament": "3.0-stable", "filament/notifications": "3.0-stable", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.10", "laravel/sanctum": "^3.3", "laravel/tinker": "^2.8" }, "require-dev": { "fakerphp/faker": "^1.9.1", "filament/upgrade": "3.0-stable", "laravel/pint": "^1.0", "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^7.0", "phpunit/phpunit": "^10.1", "spatie/laravel-ignition": "^2.0" }, "autoload": { "psr-4": { "App\": "app/", "Database\Factories\": "database/factories/", "Database\Seeders\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Tests\": "tests/" } }, "scripts": { "post-autoload-dump": [ "Illuminate\Foundation\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi", "@php artisan filament:upgrade" ], "post-update-cmd": [ "@php artisan vendor:publish --tag=laravel-assets --ansi --force" ], "post-root-package-install": [ "@php -r "file_exists('.env') || copy('.env.example', '.env');"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ] }, "extra": { "laravel": { "dont-discover": [] } }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true, "allow-plugins": { "pestphp/pest-plugin": true, "php-http/discovery": true } }, "minimum-stability": "stable", "prefer-stable": true }
DrByte
DrByte13mo ago
I'm guessing that if you're done upgrading, you can remove filament/upgrade from require-dev And you probably should change filament/filament to '^3.1' (note the ^ which means "the latest in this series") And I think you can drop filament/notifications because I'm pretty sure it's included in filament/filament And then run composer update --dry-run to test that there's no syntax errors. And then composer update will pull down all the latest Filament stuff and automatically run filament:upgrade to update and publish all the assets. . I don't think that will have anything to do with your /admin route though.
That's puzzling. Did you just now upgrade from Filament v2?
Dry Dood
Dry DoodOP13mo ago
ikr? its been breaking my mind for hours
DrByte
DrByte13mo ago
I assume you had filament/upgrade in your require-dev because you were upgrading from v2? When did you do that?
Dry Dood
Dry DoodOP13mo ago
nope i created the project with 3.0
DrByte
DrByte13mo ago
oh. Then I'm surprised about the presence of filament/upgrade ... but maybe you saw it in docs somewhere. So ... you just created the project today/recently, and this is the first time trying to run it on apache locally?
Dry Dood
Dry DoodOP13mo ago
ok it has been updated with the notes you gave me, everything updated nicely but still admin error xd i created it like 5 days ago, and yes, its the first time ive tried to put it in apache
DrByte
DrByte13mo ago
k wait ... just re-looking at the last screenshot your URL says /public/admin .... but it should be just /admin
Dry Dood
Dry DoodOP13mo ago
No description
Dry Dood
Dry DoodOP13mo ago
when i enter to the juuust the ddcommmanager.com, it shows this
No description
Dry Dood
Dry DoodOP13mo ago
when clicked, it shows the files, and when i enter the public folder, it shows the laravel dashboard
DrByte
DrByte13mo ago
So, a Laravel app needs to point the DocumentRoot to the public folder Your screenshot should never be showing access to anything "above" public ... so that means the docroot is higher up than public
Dry Dood
Dry DoodOP13mo ago
here?
No description
Dry Dood
Dry DoodOP13mo ago
its already in the public, its has been puzzling me for a while now
DrByte
DrByte13mo ago
At first glance that "seems" right, but my Apache config brain is weak. I left Apache years ago. Lemme go dig ... Why is there a stray "S" at the end of the file?
Dry Dood
Dry DoodOP13mo ago
ah... missimput :u plz dont tell me that would be the problem... just got rid of it and restarted apache, no dice
DrByte
DrByte13mo ago
Do you have other vhosts configured? I wonder if another one is also listening for the same ddcommmanager.com domain? I was also wondering if it would make a difference if the <Directory "C:/Apache24/htdocs/DD_CommManager/public"> dropped the /public off of it as a test. (But leave it on the DocumentRoot)
Dry Dood
Dry DoodOP13mo ago
No description
Dry Dood
Dry DoodOP13mo ago
put it like this:
No description
DrByte
DrByte13mo ago
right
Dry Dood
Dry DoodOP13mo ago
no dice
No description
Dry Dood
Dry DoodOP13mo ago
i restarted apache
DrByte
DrByte13mo ago
Hmmm ... that shouldn't be. okay, add the /public back to it. What are you doing to restart Apache after the config changes?
Dry Dood
Dry DoodOP13mo ago
I have the apache service monitor, it can restart it from there
DrByte
DrByte13mo ago
I'm wondering if it is actually restarting it, or if it's been using an old config all this time?
Dry Dood
Dry DoodOP13mo ago
No description
Dry Dood
Dry DoodOP13mo ago
when i mode that code and add something that shouldnt be there, it shows an error when restarting
DrByte
DrByte13mo ago
k, that's a good indicator When you set this up, you edited your Windows hosts file, right? What's in there?
Dry Dood
Dry DoodOP13mo ago
yup
Dry Dood
Dry DoodOP13mo ago
No description
DrByte
DrByte13mo ago
I'm thinking suggesting that you switch out the ServerName temporarily to filament.test (instead of anything .com), and remove the ServerAlias temporarily. What happens when you do that? (You'll have to add filament.test to your hosts file too) Another layer of the test is to (even if just temporary) rename the DD_CommManager directory to something else, maybe ddcm and update the 2 spots for that in the vhost as well.
Dry Dood
Dry DoodOP13mo ago
*screeching
No description
DrByte
DrByte13mo ago
Hmmm ... it's like Apache is only serving the htdocs directory directly, not honoring the vhost subdir config So, I wonder if Apache's "use vhosts" feature is enabled, or if it's configured only to serve everything from /htdocs (its default)
Dry Dood
Dry DoodOP13mo ago
No description
DrByte
DrByte13mo ago
okay, good, that confirms it's just serving /htdocs, and not aware of subdirs Try visiting filament.test:8080 ... does that respond? or error with a not found? It should fail ... it should definitely not show the Directory Listing. Then update your vhost from *:80 to *:8080 and visit filament.test:8080 again This is just to rule out a generic listener on port 80, by forcing our desired vhost onto 8080 If it responds correctly to :8080 on the :8080 vhost (and not with a directory listing) then at least we know where the problem is.
Dry Dood
Dry DoodOP13mo ago
i uhhhhh i found the prob
Dry Dood
Dry DoodOP13mo ago
No description
Dry Dood
Dry DoodOP13mo ago
when i reinstalled the apache yesterday at night, my sleep deprived me uhhhh
Dry Dood
Dry DoodOP13mo ago
forgot this
No description
Dry Dood
Dry DoodOP13mo ago
I reinstall it ccuz it hought it was a configuration error
Dry Dood
Dry DoodOP13mo ago
thank you verymuch for ur time
DrByte
DrByte13mo ago
woot woot! 🙌🙌🙌 That makes sense: It wasn't listening to your vhost becuase it wasn't loading the vhosts.conf file!
Want results from more Discord servers?
Add your server