Use USB Drive files in html using Apache2 - raspberry-pi

So i have a Raspberry Pi 3 with the latest OS (10-04-2021) and i have apache2 running. I created a website which is in the directory /var/www/html/ with a few folders (e.g css, img, etc.) and i used the image tag with src="" to the usb drive path, but the video doesn´t load. I tried, if i made any mistakes while coding the website. So i also placed the website folder on the desktop with also the video path to my usb drive and i could play it on the website. I can´t place the .mp4 files in the /var/www/html/ path just because my SD card only has a few GB and my video folder is about 100 GB. How can i use my .mp4 files from my USB drive on the server/localhost?
What i tried and didn´t work was:
chmod -R a+r /media/pi/KINGSTON/*
I am just a beginner with raspberry pi and its OS.

That's a totally correct behavior. For security reasons Apache won't let you access files outside the document root, which in your case should be /var/www/html/. There are multiple approaches to do this, the first is to create symlinks in the document root and instruct apache2 to follow symlinks in the configuration file. Another approach is to use aliases. You can read here

Related

can't connect local site to Iphone with XAMPP

Ive build my site on wordpress and using xampp
i want to test my new dev site on my remotely on my iphone and ipad via wifi
They're both connected to wifi
When i search iphone http://000.000.0.00 or http://000.000.0.00:80, :8080
it comes up with a link to a folder , which is my true path
when i click on this next sub folder , i loop back round to 127.0.0.1
As i guess iphone doesn't know where to find my site contents
I've tried renaming my wordpress site the with the http://ipaddress, :80, :80;80
ad it comes up with an error
ive found in my XAMPP index.php file
The footer seems to send me to 127.0.0.1/dashboard/
i can view this from my iphone
i've tried changing that footer on index.php to my site path
As well as deleting the file all together
Deleting the file allowed me to access more folders but not into the subfolder where my site remains
I've read through questions and tutorials but can't seem to find a solution
i was wondering if i've missed something or if i need to configure files in such a way , maybe to this index.php for XAMPP itself to get it to point at my site as a default
Thank you in advance
Check if your files are in htdocs or you have given correct path to your working directory in your httpd.conf file.
If the directory is correct and you have run your php pages already, I suggest you use ngrok for remote connection to your localhost.
https://ngrok.com/download
it is simple to use.
to run it go to the directory of ngrok in cmd and type ngrok http 80 while your XAMPP servers are running. It will provide a link that could be accessed through internet by any device.

Wget - Overwrite files that are different

So, I'm making an updater for my game using wget. The latest version of the game (with all it's files), is on my server. The thing is that I want wget to download only the files that are different from a directory on the server into the www folder in the root of the game files (This has to be recursive, since not all of the game's files are stored directly in that folder). So, when the command is being ran it should check to see if the file's hashsum (if possible, otherwise it should check the size) on the server matches the one in the game's files. If it doesn't, it should download the file from the server and replace the one in the game's directory. This way, the player won't have to re-download all of the game's files.
Here's the command I used for testing:
wget.exe -N -r ftp://10.42.0.1/gamupd/arpg -O ./www
The server is running on my local network, so I use that IP address.
The thing is that it doesn't save the contents of /gamupd/arpg to the www folder, instead it seems to copy the directory tree of arpg.
Maybe the timestamping flag will satisfy you. From wget -help:
-N, --timestamping don't re-retrieve files unless newer than
local

move files within a directory to another directory

I am currently working on a Raspberry Pi that is capturing images 24/7. I am wanting to delete the files in a directory A (where the images are stored) without deleting the directory itself. I know that shutil.rmtree will remove the directory(A) but I have other programs sending files to that directory(A) all the time. So the instant a file is trying to come into a directory A and it does not exist it crashes my Raspberry Pi.
I know that I can move the files within a directory(A) to another directory(B). However using the shutil.copytree or shutilmove only copies the files to my directory B. It does not "cut" the files just copy them.
The only reason I want to do this is because file space is limited and the Raspberry Pi is running 24/7.
Any ideas would be helpful.

Netbeans Remote Synchronize doesn't list files when a subdirectory is used as upload directory

I've setup several sites previously to use Netbeans Remote Synchronization so I can edit files on the server from my machine and it has worked perfectly.
The problem I'm having right now is that when my FTP configuration in Netbeans uses the root folder it lists everything correctly but when I use a sub directory for example website.com/subdir as the upload directory or as the FTP initial directory the sync results come up blank - doesn't list anything at all on the remote side except directories in that sub directory.
My PC is a windows 7 64 bit machine, and the server is a standard shared hosting account running CPanel.
Also, I have been able to run the subdir synchronization on a different pc, could it be the firewall on this one? If so, why does it list the root folder properly?
Has anyone else had this issue? Any suggestions on how to fix it?
Thanks.
found the problem. The FTP path on this PC required the /public_html before the subfolder paths. i.e. essentially ftp://mydomain.com/public_html/path/to/subfolder
This wasn't the case on my laptop as I used the subfolder path right after the domain i.e. ftp://mydomain.com/path/to/subfolder and it worked fine, different versions of netbeans perhaps.

How to extract sms.db from non-jailbroken iphone on linux

Objective: Extract the sms.db sms text message database from an Iphone 4S.
I have installed ifuse on ubuntu 12.04 and am able to browse certain folders. None seem to contain the 'sms.db' file.
It is possible to extract the sms.db using freely available tools on linux?
I don't know yet how to access the SMS.DB file directly from the phone. But if you backup an iPhone using for example iTunes, you can then read the SMS.DB file from within the backup. It will be SHA-1 hashed (the file name will be gibberish), but it should still be a .DB file. You'll need iPhone Analyzer to unhash the file names, or something similar. Then you can load it into SQLite.
Please post here if you find a solution.
I've figured out a way on how to access it with Jailbroken devices... It miiiiiight be the same if you aren't jailbroken based on what the Github says (https://github.com/libimobiledevice/ifuse)
Anyways, open a terminal
Sudo su
now make a folder in your home and direct ifuse to that folder
ifuse --root /home/<INSERT NAME>/<INSERT NAME OF FOLDER>
Now you gotta open that folder as root
nautilus
Browse through your /home/ and find the folder.
It should be in
/var/mobile/Library/SMS/sms.db
Then you just copy it to your desktop and your good to go!