New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assets rerouted Instatlation Issue #873
Comments
You don't need to change the .htaccess. Create a file define('COCKPIT_BASE_URL', '/' . basename(__DIR__));
define('COCKPIT_BASE_ROUTE', '/' . basename(__DIR__));
define('COCKPIT_DOCS_ROOT', dirname(__DIR__)); And I wrote an install script for strato, because it was very annoying to have such a limited console: |
Thank you @raffaelj, that sounds good. Will try it tomorrow. |
Finally got time to do it and it worked. Just added the defines.php and put in my pathnames. Thanks again @raffaelj |
Sorry, but maybe i closed this to early. Should i open a new one? Last time i only checked that the frontend of Cockpit worked on my server. But now i filled in my data and tried to fetch it. but now i get a 404 on the api request. i can access the frontend at: beta.MYDOMAIN/cms I'm really sorry for asking all this questions. |
Sorry, I used cockpit as a library to have a backend for a simple php frontend. I didn't notice, that the api doesn't work. It worked on my localhost and apparently I never checked, if the api works on the server. I tested it again. The backend and frontend work. When trying to call the api through There was some weird config, I had to add to load cockpit as library (found it here): $options['route'] = preg_replace('#'.preg_quote(BASE_URL, '#').'#', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), 1);
$app = new Lime\App($options); Maybe this is helpful. Otherwise - If you don't have to use strato shared hosting (because a client already has a cheap account and wants to stay...), you could consider to choose a better webhoster. |
No reason to be sorry, I'm thankfull you spend the time on my problem. And yes i'm bound to strato. But im not sure i understand your solution. I'm on the 0.8.0 stable relase. I don't seem to have a line: so i tried putting it in the bootstrap.php because the LimeExtra\App there seems to just inherit from Lime\App. but i don't really understand the project yet and have no idea where i could kind of check if anything changes.
|
Your fixme hack might work... Try to replace For debugging create a file <?php
// view the debug info on top of the layout
$app->on('app.layout.contentbefore', function(){
$vars = [
'app_important_routes' => [
'route' => $this['route'],
'base_url' => $this['base_url'],
'base_route' => $this['base_route'],
'base_host' => $this['base_host'],
'base_port' => $this['base_port'],
'docs_root' => $this['docs_root'],
'site_url' => $this['site_url'],
],
'DOCUMENT_ROOT' => $_SERVER['DOCUMENT_ROOT'],
'cockpit_DIR' => dirname(dirname(__DIR__)), // may differ from DOCUMENT_ROOT (symlinks)
'user_constants' => get_defined_constants(true)['user'],
'app_paths' => $this['paths'],
// 'SERVER' => $_SERVER,
// 'app_config' => $this->config, // config.yaml + app defaults
// 'app' => $this, // the whole app, needs a few seconds to load/print
];
echo '<pre>' . print_r($vars, true) . '</pre>';
}); My setup was:
content of frontend index.php: //include cockpit
include_once("cockpit/bootstrap.php");
// start Lime
$app = new Lime\App($options);
// some logic to bind paths and render output as html |
Wait, the route is already set this way: Let me know, if you find a solution. I really thought, I was able to run cockpit on strato and I'm sure, I'll run into this issue again in the future. |
I found the issue, and maybe the solution. The constant Add this debug code here: https://github.com/agentejo/cockpit/blob/next/bootstrap.php#L67 $vars = [
'DOCUMENT_ROOT' => $_SERVER['DOCUMENT_ROOT'],
'cockpit_DIR' => __DIR__, // may differ from DOCUMENT_ROOT (symlinks)
'user_constants' => get_defined_constants(true)['user'],
'SERVER' => $_SERVER,
];
print_r($vars);
die; to return your SERVER vars and constants to the api output. In the defines.php define
and
If it works - Let's start a new thread in the Cockpit Community Forum with best practices for defines.php and supported webhosters. |
I fixed it. Try it with this branch. If it works for you, I'll send a pull request. I moved the COCKPIT_BASE_URL definition above the COCKPIT_API_REQUEST definition and removed one |
I tried your branch and it just works. I tested the Interface, got my data via the api and even tested the email submit via forms. Everything I need. That is just awesome, thank you so much. I would have been lost without you. |
Hello,
i have some trouble installing cockpit. Probablly something i missed, but i would be really thankfull if someone can point me in the right direction. Don't even know how to diagnose it further.
The installation locally worked fine, but now i tried to upload it to my webserver (strato). The install went without error but the login page is brocken. It seems to me some problem with mod rewrite because all the assets (like jquery) get reroutet with a 302 to /api/auth/login.
I have installed it under a subdomain, if that makes a difference.
Thank you for your time and help.
The text was updated successfully, but these errors were encountered: