Comments (8)
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.
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.
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.
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.
It is done with 883c825#diff-ceefa11783c184687f67cca61c026a1e1eca03cfcb4f02a64627fb9083044690
from pimped-apache-status.
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.
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.
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)
- Error when creating and updating 'checkupdate_*.tmp' file HOT 4
- Downloaded vendor requests get 404 if running in root directory / subdomain HOT 5
- Exclude request from collection server. HOT 5
- user_config file not working HOT 8
- Record history HOT 4
- After Upgrade unable to migrate configuration HOT 2
- Vulnerabilities, how to proceed HOT 1
- bad slot stats with apache 2.4 (event) HOT 7
- PHP error DivisionByZeroError HOT 5
- Problem with routes HOT 4
- Installation wizard creates wrongly formatted auth file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pimped-apache-status.