I'm trying to make my php filemanager to be able to manage files outside the web-root. I'm using a router with OpenWRT. I have PHP5 and uhttpd (default Luci webserver) installed. The files are stored on a USB drive that's not always plugged in. The index.php is located in /www and the files are stored (when mounted) in /mnt/sda1.
I've been playing around with the permissions and user/groups with nog success.
Is there a way to do this? I don't want the filemanager itself running from the USB drive.
It seemingly isn't possible without a second webserver (different port) so I'm going to use a samba server that directs to a symlink to the /mnt/sda1 and use php to access the samba server.
Related
I have access to server of our company's website. I access it using Putty.
I want to download all files(index.php, any jpg files for favicons, etc.) used for deployment of the web project. When I told to programmer of website to share the full script(HTML,CSS,PHP, jquery plugins), he said that I can access the entire code from server.
When I enter the server via Putty(private key+ssh), and then I type "ls" I see that there are "index.php" and "mysql" files, the full contents of which I cannot download.
What are the useful resources for list of commands?
Which command should I use to download the project folder containing all files with code and without code?
P.S. I do not know if this information is necessary, but the website was deployed using DigitalOcean.
As you are using Putty, I'll assume you are working on Windows. There is a GUI tool called WinSCP that works similar to Putty (i.e. over SSH and uses private keys and stuff) and can be used to access the remote server's filesystem. It has a pretty simple to understand UI which will be divided into you local filesystem and the server filesystem. Once you're connected and have reached the files you need you can just drag and drop the files into your local filesystem side.
If you would like to explore some command line options, its basically any tool that does scp. I think Putty comes with scp or pscp installed already. You can check by just typing in the command in your cmd/powershell.
You can download pscp.exe from PuTTY website and then:
Open cmd.exe and type:
pscp your_username_here#yourcompany.com:/path/to/file C:\Path\To\The\New File
I have a shared directory using samba on my ubuntu server at this path:
/home/user/share/
I use it to share some installation software on the intranet, mainly files: msi and exe (for windows end user)...
on the same server I have a web server in the root path like:
/var/www/html/
but I want to create a link in the OS that can provide an access for php to the shared folder (if I want to distribute the programs as a download on the intranet, since not everyone knows how to access a network disk) and create a web download of the installer (s):
ln -s /home/user/share/installer /var/www/html/sl-soft
I tried to use a soft link but I get a blank page when I try to navigate.
Does anyone have a canonical answer that by using php / apache / linux can fix this problem?
I'm in the process of getting a Laravel 5 app working on Azure Web Apps and am encountering an issue via Laravel's temporary storage.
Any time a template renders, Laravel attempts to cache it to the local filesystem. Unfortunately, for some reason Laravel doesn't have permission to write to its storage directory.
I am deploying my application from my build server via FTP
I am running on the free-tier shared infrastructure (just while I'm getting set up)
My deployment server is running Linux
In this circumstance, it's obvious what the problem is. Unfortunately, what I don't understand is why my web server doesn't have access to write to the directories my FTP user uploads.
Ideally any solution offered will be one that I can automate as part of my deploy process.
According to http://clivern.com/working-with-laravel-caching/, you can change the directory of the cache files using the cache.php configuration file. I'd like to suggest you to use $_SERVER['DOCUMENT_ROOT'] to obtain the root folder of your web app, and then construct a path for the cache files.
I have installed a window executable software in my linux machine(local not in the web server). I need to share that .exe file to other system using IP address. Can it be done with PHP?
Assuming you got LAMP installed.
You can just put your file in a folder inside apache root folder (usually /www).
/www/sharedfiles/yourfile.exe
You can then access your file in other computer using your IP address in a browser:
yourip/sharedfiles/yourfile.exe
I have developed a python desktop application and application itself having setup page to change some configurations in the application and it is saved as a configuration file.
Now I need do to give web interface to change those configurations by using web browser remotely. But I need to change the same configuration file.
I can’t access any file outside the web root, So My first question is how can I edit that file which is located outside the web root.
more info : for web application I use LAMP stack and desktop application is python based.
someone suggest me to use CGI, Second question : Is that possible, if it is possible how I can I do it?
Probably by bind mounts (assuming Linux), so that the file is in it's original location as well as in the web root.
Or by priviledge separation. The web root sends a query to some worker job, that has access to all the needed files.