Giter Site home page Giter Site logo

Comments (8)

ThomasCr avatar ThomasCr commented on September 13, 2024

urg... ok, all generated links suffer from the same problem.
I also found now, that it is possible to set selfurl - but I say, that It should not be need.

It would be better to read SCRIPT_URI or REDIRECT_SCRIPT_URL env vars as default address.

from pimped-apache-status.

axelhahn avatar axelhahn commented on September 13, 2024

Hi Thomas,

thanks for your report. But help me to understand what problem you try to solve.

A) The "normal" constellation is: that the archive is extracted in or below webroot. Then it will find the base directory of the app relative to document root.
B) If you extract it "anywhere" and use an alias - the you need to set selfurl to point to the alias.

What I need to do to reproduce your constellation? Where did you extract it - and where is the webroot?

kind regards,
Axel

from pimped-apache-status.

ThomasCr avatar ThomasCr commented on September 13, 2024

Yes, it was used with an alias in Apache. But as I pointed out, it could be more easy to make use of the vars SCRIPT_URI/REDIRECT_SCRIPT_URI so nobody need to manually set selfurl.

from pimped-apache-status.

axelhahn avatar axelhahn commented on September 13, 2024

The variable $sSelfURL points to the application base url - not the current url of the page.
The pages returning html code in the webui are directly in that approot url and setting pages in subdir /admin. I could set the application root by a hartcoded replacement od the directory name /admin. To prevent hartcoded replacements was the former reason to create a custom config variable. On the other hand: there is just this constellation only to handle ... I will update it in the next version and remove the config var.

$sSelfURL=preg_replace('#\/admin$#', '', dirname($_SERVER['SCRIPT_NAME']));

from pimped-apache-status.

axelhahn avatar axelhahn commented on September 13, 2024

It is done with 883c825#diff-ceefa11783c184687f67cca61c026a1e1eca03cfcb4f02a64627fb9083044690

from pimped-apache-status.

Nuramon avatar Nuramon commented on September 13, 2024

I updated to v2.04.08, but this change broke the webinterface. This new line sets $sSelfURL to "/", whereas the old version just had an empty string...

$sSelfURL=$aCfg['selfurl'] ? $aCfg['selfurl'] : str_replace('\\','/',str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', __DIR__));
// -> $sSelfURL is ""
$sSelfURL=preg_replace('#\/admin$#', '', dirname($_SERVER['SCRIPT_NAME']));
// -> $sSelfURL is "/"

This leads to problems loading the javascript, as it resolves to this:

<script src="//javascript/functions.min.js" type="text/javascript"></script>
<script src="//javascript/counterhistory.class.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="//templates/default/style.min.css" media="screen">

Which effectively tries to load https://javascript/functions.min.js, https://javascript/counterhistory.class.min.js and https://templates/default/style.min.css, which of course don't exist...

I guess you should either rewrite the templates, so that they support a $sSelfURL with "/", or strip the trailing slash in $sSelfURL, to avoid the double-slashes?

from pimped-apache-status.

axelhahn avatar axelhahn commented on September 13, 2024

Hi @Nuramon, thanks for reporting this. A // in an url is not the wanted result - it is nearly a full url keeping the protocol of the current request (you described the result).

I will have a closer look and fix it in the next release.

UPDATE: fast fix follows soon.

from pimped-apache-status.

axelhahn avatar axelhahn commented on September 13, 2024

Hi @Nuramon ,

I created a new branch with the dev version for the next minor version.
The reason for selfurl problem is the handling of different install types: in webroot/ in a subdir / using an alias. You installed into a webroot - there the described problem is fixed. Can you try to update your inc_conig with that content:

https://raw.githubusercontent.com/axelhahn/pimped-apache-status/v2.04.09-dev/inc_config.php

... and tell me if it works?!

The few changed lines start from line 58 - see diff of the commit 4d6c2e4

Axel

from pimped-apache-status.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.