-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Custom install directory not working #803
Comments
URL rewrites were introduced in the latest release. @mp03 this should affect your implementation as well. |
I have just tested an install with custom install directory (/var/www/html/raspap) and it seems to work fine. It should be noted that the user needs to make sure their lighttpd config (at /etc/lighttpd/lighttpd.conf) has the correct server.document-root setting which matches the install folder. The installer does not change the document-root, and I don't think that it should because the most obvious use case for a custom install directory is for a shared http server, in which case it is wise to leave the lighttpd config untouched. @billz could you weigh in on whether I am understanding this correctly? |
@mp035 I believe the issue here is that prior to introducing URL rewrites, any subdir of the default /var/www/html webroot was accessible from the browser, eg., http://raspberrypi.local/raspap/ without touching the lighttpd config. @freakbsd can you confirm this? |
When installing raspap, lighttpd is also installed with default settings which means that server.document-root it is always /var/www/html. I think the problem is the fact that 50-raspap-router.conf is not updated with custom install directory, something like: $HTTP["url"] =~ "^/(?!(dist|app|ajax|config))." ==> $HTTP["url"] =~ "^$webroot_dir/(?!(dist|app|ajax|config))." After this change the interface it is accesible, but only the main page. Any item in menu gives 404 error. In lighttpd log (after enabling accesslog) I can see the following:** 2021-02-11 21:01:56: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning: parse_ini_file(/etc/raspap/hostapd.ini): failed to open stream: No such file or directory in /var/www/html/thanos/includes/wifi_functions.php on line 145
|
Modifying 50-raspap-router.conf as @freakbsd suggests loads the main page, but the url-rewrite fails to load other hrefs. |
Fixed in 0cfdfd3. |
I will test today and I will come back with updates. |
Hi guys, Apologies for late answer. I checked https://github.com/RaspAP/raspap-webgui/tree/0cfdfd367529db93bc83fb2d461434f3a2bf28ac and I took only https://github.com/RaspAP/raspap-webgui/blob/0cfdfd367529db93bc83fb2d461434f3a2bf28ac/config/50-raspap-router.conf. (i didn't saw any other change except for installers/common.sh) The new lighttpd configuration works, so the custom directory is fine, but no other menu links work, all links only lead to the dasboard. So in the end it's a rewrite issue? @mp035 can you please test more ? Thank you. |
Also tested and found the following #749 (comment) |
You need both the 50-raspap-router.conf and the changes to the installer. The installer will modify 50-raspap-router.conf as required during the install process. |
@mp035 see my comment. Ok, I wasn't clear, so I took 50-raspap-router.conf directly and, of course, adapted to my needs (REPLACE_ME => custom), so that's why I said that the new lighttpd configuration is ok (no need to take custom.sh) I don't think that was enough, and I see that Billz has discovered other related issues. Anyway, at the moment I am happy with 2.5.2 until you completely fix 2.6.x. |
@freakbsd thank you for reporting this and helping us to resolve it! |
Hey, It seems you resolved the problem, but I didn't understand. What exactly have I to do? |
I am facing exactly the same error. I also have chosen the same path. |
I solved it with the comments here: #866 My 50-raspap-router.conf looked like this:
And i changed it to this:
As you will notice it looks like that the installer is inserting the folder not with a pipe. Instead it inserted a underscore. |
Thanks a lot! First I changed the root directory of lighttpd to |
@mp035 are you able to repo the above? |
I'll take a look at it and try to work out why it's not replacing correctly. |
@billz I am unable to reproduce this.
Accessing the web gui worked after install, and:
Attached is a full transcript of the install process. |
Hello, |
Before submitting an issue
Describe the bug
Normal installation (curl -sL https://install.raspap.com | bash), I changed only the directory where the webgui will be installed.
Your environment
RASPAP_LATEST=2.6.1
root@Galactus:/var/www/html# uname -a
Linux Galactus 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux
root@Galactus:/var/www/html# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
[snip] @billz removed installer output
I think the problem is the fact that 50-raspap-router.conf is not updated with custom install directory, something like:
$HTTP["url"] =~ "^/(?!(dist|app|ajax|config))." ==> $HTTP["url"] =~ "^$webroot_dir/(?!(dist|app|ajax|config))."
After this change the interface it is accesible, but only the main page. Any item in menu gives 404 error. In lighttpd log (after enabling accesslog) I can see the following:
2021-02-11 21:01:56: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning: parse_ini_file(/etc/raspap/hostapd.ini): failed to open stream: No such file or directory in /var/www/html/thanos/includes/wifi_functions.php on line 145
2021-02-11 21:01:56: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning: parse_ini_file(/etc/raspap/hostapd.ini): failed to open stream: No such file or directory in /var/www/html/thanos/includes/dashboard.php on line 182
I remember that in previous versions there was an hostapd.ini, not .conf.
Please accept my sincere apologies in advance if I should open another bug report for the following issue, but i will describe it here because this one is easy.
Another problem observed for a long time (at least 1 year) (i didn't followed the versions and/or diff them) is the fact that session.cookie_httponly it is not changed by installer, see below:
root@Galactus:/var/www/html# sed -i -E 's/^session.cookie_httponly\s*=\s*(0|([O|o]ff)|([F|f]alse)|([N|n]o))\s*$/session.cookie_httponly = 1/' /etc/php/7.3/cgi/php.ini
root@Galactus:/var/www/html# grep session.cookie_httponly /etc/php/7.3/cgi/php.ini
session.cookie_httponly =
root@Galactus:/var/www/html#
I am not a regex expert, but my solution for this one is:
sed -i 's/session.cookie_httponly =/session.cookie_httponly = 1/g' /etc/php/7.3/cgi/php.ini
Simple.
Thank you.
The text was updated successfully, but these errors were encountered: