Website not working

Posted by leolegocraft04 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Website not working
August 19, 2017 10:58AM
After I changed the /opt/piratebox/www/content/index.html file and rebooted, the piratebox site isn’t working. But putty can connect to the piratebox’s terminal trough the Wi-Fi connection that the piratebox still creates.
Please help me.
Some notes:
I don’t want to delete my custom index.html file.
It could be a problem of the permissions.
The site doesn’t work also if I trigger the redirection trough an http:// ( without s) site.
Re: Website not working
August 20, 2017 07:34AM
Hi,
maybe you made a mistake in an given URL or you try to load something from the internet.

The easiest way to debug this is to disable the redirection temporarily:

sudo sed -i -e 's|^server.error-handler-404|#server.error-handler-404|' \
     /opt/piratebox/conf/lighttpd/lighttpd.conf
sudo systemctl restart piratebox

Try to use the browser features like "Inspect element" and find out which request gives you a HTTP-404.

To re-enable it again, after you are finished with debugging:
sudo sed -i -e 's|^#server.error-handler-404|server.error-handler-404|' \
     /opt/piratebox/conf/lighttpd/lighttpd.conf
sudo systemctl restart piratebox

best regards Matthias
Re: Website not working
August 20, 2017 01:58PM
When I try to enter the first command it gives me this error on the terminal:

[alarm@alarmpi ~]$ sudo sed -i -e 's|^server.error-handler-404|#server.error-handler-404|' /opt/piratebox/conf/lighttpd/lighttpd.conf
sed: couldn't flush /opt/piratebox/conf/lighttpd/sediEIKXz: No space left on device



Edited 1 time(s). Last edit at 08/20/2017 01:59PM by leolegocraft04.
Re: Website not working
August 20, 2017 05:17PM
It seems you exhausted your root disk space... that might be another reason for your issues.

Did you move the Shared folder to the USB stick or extended the SDCard space?

You may want to cleanup /opt/piratebox/share/Shared
Re: Website not working
August 21, 2017 01:32PM
After cleaning up the /opt/piratebox/www/Shared/ folder from the files that I uploaded before the crash and running your debug commands, it ACTIONALLY worked. But only if I connected myself to the [piratebox.lan] site: the redirection from other http:// sites was missing. Then I installed chrome on my mac and used the inspect function. After various attempts I managed to fix some things in the index.html file. Then I ran your final commands but I made mistake:
I thought that the only difference between the first and the third command was the # that seemed to be completely missing in the third command. So I ran:

sudo sed -i -e 's|^server.error-handler-404|server.error-handler-404|' \
/opt/piratebox/conf/lighttpd/lighttpd.conf
sudo systemctl restart piratebox

Then I noticed that after connecting to the ssid it still redirected me to a 404 - Not Found page, so I went again to this post and realized that I made this big mistake. But after running the right command it outputted this:

sed: can't read : No such file or directory

Please send me a fix.
Sorry for wasting your time...


I rebooted and now it seems to work smiling smiley But please tell me if I did some damage to the folders with the wrong command...



Edited 1 time(s). Last edit at 08/21/2017 02:27PM by leolegocraft04.
Re: Website not working
August 21, 2017 05:41PM
The redirect from other sides is disabled as well, yes.


@sed error
Nope, no issue. I guess on the try with the sed error message, you had a typo in the config path.

I created the commands in a way, that you won't do any damage after running it twice accidentally.


Best regards Matthias