PHPfileNavigator - Web based file mangment

User avatar
jfrenc14
Expert
Posts: 55
Joined: Wed Dec 03, 2008 8:13 pm

PHPfileNavigator - Web based file mangment

Postby jfrenc14 » Sat Dec 06, 2008 9:06 pm

After not having much luck with ajaxplorer I found PHPfileNavigator also here is a demo

The following are instructions on install:

Download the newest version from http://pfn.sourceforge.net/

Unzip it and move it to /var/hda/web-apps/

Create a new web app in your hda setup and call it PHPfileNavigator

Now in a terminal go to /var/hda/web-apps/PHPfileNavigator

First we are going to have to take care of .htaccess

Open up the file with your favorite text editor, I use pico since it if very easy to use

Chanage the .htaccess file to

Code: Select all

#Options -Indexes
If you dont you will get a internal server error when trying to access the web page.

Next run

Code: Select all

chown -R apache *
and

Code: Select all

chgrp -R apache *
Now in a web browser go to http://PHPfileNavigator/ when you first load the page it will be in Spanish go about halfway down the page and their is a drop down box that says "Castellano" change it to "ingles"

Follow the instructions it should be easy to do until you get to Step 4. I had a red X for

Code: Select all

GD >= 1.0.0 This installation of PHP does not include support for graphical libraries GD. You must install the modules necessary or recompile the PHP to add the support.
So check the box at the bottom to ignore the verification

Now it gets a little harder. When I say 'Password' put in a password, run the following commands in a termnial (when it prompts for a password it will be "hda"):

Code: Select all

mysqladmin -uroot create files -p

Code: Select all

mysql files -uroot -e"GRANT ALL ON files.* TO files@localhost IDENTIFIED BY 'Password'" -p
Now back to the PHPfileNavigator setup. Fill in the following information

Code: Select all

Carset: United States Database Server: localhost Database Name: files User: files Password: Password Next in the Admin users fill that out In the Main root Name: (what ever you want) I called it 'files' Absolute path: /var/hda/files/
Finnish the Install by following their directions

Before you go any further test to make sure every thing works go to http://PHPfileNavigator/

Now it is time to host it on your site and make it encypted

You will need to make sure that your router will port foward port 443 and 80 to you linux box

Now in a terminal type the following

Code: Select all

cd /etc/httpd/conf/

Code: Select all

openssl genrsa -out filename.key 1024

Code: Select all

openssl req -new -key filename.key -x509 -days 1000 -out filename.crt
Next open up httpd.conf with you favorite editor and add NameVirtualHost *:443 somewhere in the conf file

Now go to cd /etc/httpd/conf.d/ and find the file that has PHPfileNavigator in its name. You can type ls to list the files. And open it up with a text editor
edit it to make it look like this

Code: Select all

<VirtualHost *:443> ServerName ajaxplorer ServerAlias username.yourhda.com SSLEngine On SSLCertificateFile /etc/httpd/conf/filename.crt SSLCertificateKeyFile /etc/httpd/conf/filename.key DocumentRoot /var/hda/web-apps/ajaxplorer <Directory "/var/hda/web-apps/Ajaxplorer"> Options Indexes FollowSymLinks +ExecCGI AddHandler fcgid-script .fcg AllowOverride AuthConfig Order allow,deny Allow from all </Directory> </VirtualHost>
Finnally crate a new file called 100-redirect.conf and put this in it

Code: Select all

<VirtualHost *:80> ServerName username.yourhda.com RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] ExpiresDefault "access plus 10 years" AddOutputFilterByType DEFLATE text/html text/plain text/xml </VirtualHost>
And thats it, now in a browser you can type "username.yourhda.com" and it will redirect you to "https://username.yourhda.com" and you are all up and running. If you have any problems let me kwow

User avatar
jfrenc14
Expert
Posts: 55
Joined: Wed Dec 03, 2008 8:13 pm

Re: PHPfileNavigator - Web based file mangment

Postby jfrenc14 » Sun Dec 07, 2008 12:35 pm

Also to enable downloading of your files (which I dont know why you wouldnt want to)
Open this file

Code: Select all

/var/hda/webapps/PHPfileNavigator/data/conf/default.ini.php
Then find this line

Code: Select all

'descargar' => false, // Download
and change it to

Code: Select all

'descargar' => true, // Download
also make sure both of these are set to true as well

Code: Select all

'editar' => true, // Edit text files 'multiple_descargar' => true, // Download multiple files at once

wvdlee
Posts: 61
Joined: Wed Feb 25, 2009 9:19 am

Re: PHPfileNavigator - Web based file mangment

Postby wvdlee » Wed Feb 25, 2009 9:25 am

I followed all instructions. But I run into the same problem as with ajaxplorer.
I cannot write in the hda shares. probably because user apache has no write privileges?
I tried to create user apache but that is not allowed because it is an existing user.
Is there a workaround to get write access to my shares without giving the whole world access?
I am a newbie and i do not understand too much of samba and user rights etc.
Can someone give me some directions please

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: PHPfileNavigator - Web based file mangment

Postby cpg » Wed Feb 25, 2009 11:18 am

I followed all instructions. But I run into the same problem as with ajaxplorer.
I cannot write in the hda shares. probably because user apache has no write privileges?
correct!
I tried to ceate user apache but that is not allowed because it is an existing user.
Is there a workaround to get write access to my shares without giving the whole world acces?
I am a newbie and i do not understand too much of samba and user rights etc.
Can someone give me some directions please
one fairly clean solution is to add user apache to the group "users" and giving the shares group write permissions!
unfortunately, amahi does not support doing this from the web UI. you have to do it in fedora.

i am sure there is a command line way to do this, i just can't think of it at the moment.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

wvdlee
Posts: 61
Joined: Wed Feb 25, 2009 9:19 am

Re: PHPfileNavigator - Web based file mangment

Postby wvdlee » Wed Feb 25, 2009 3:12 pm

one fairly clean solution is to add user apache to the group "users" and giving the shares group write permissions!
unfortunately, amahi does not support doing this from the web UI. you have to do it in fedora.
With VNC I tried to add a user apache in fedora, but that user already existed. So In "preferences" I think (it's "voorkeuren" in my Dutch Fedora) I unchecked the box "hide system users etc." and added the group users to the user apache. I was hoping that I could write in folders with all users and writable checked. Unfortunately that did not work. I think the user apache must be added to the samba users. Anyone directions how to do that? or a link to a good tutorial?

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: PHPfileNavigator - Web based file mangment

Postby cpg » Wed Feb 25, 2009 3:20 pm

make sure the folder you want to write with phpfile navigator are group writeable.

maybe that's it?
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

wvdlee
Posts: 61
Joined: Wed Feb 25, 2009 9:19 am

Re: PHPfileNavigator - Web based file mangment

Postby wvdlee » Thu Feb 26, 2009 3:25 am

make sure the folder you want to write with phpfile navigator are group writeable.

maybe that's it?
The folder /var/hda/files/books is group writable by users. I added apache to the group users and even made users the primary group of user apache. (apache was then a member of group users and group apache).
But still no write acces to the folder in phpfilenavigator.

Then I changed the rights of the folder books to writable by all users. Then I can write with phpfilenavigator. I created a file and in Fedora this file was owned by apache. So I do not understand why apache still has no write rights although it is member of the group users.

If I change the user rights of var/hda/files/* to writable by all users and forward ports (80 and 443) in my router to the hda, what does this mean for the security of my files ?

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: PHPfileNavigator - Web based file mangment

Postby cpg » Thu Feb 26, 2009 3:33 am

The folder /var/hda/files/books is group writable by users. I added apache to the group users and even made users the primary group of user apache. (apache was then a member of group users and group apache).
But still no write acces to the folder in phpfilenavigator.

Then I changed the rights of the folder books to writable by all users. Then I can write with phpfilenavigator. I created a file and in Fedora this file was owned by apache. So I do not understand why apache still has no write rights although it is member of the group users.
there is one last thing. user/groups changes do not take place until the user gets reloaded. did you reboot or at a minimum service httpd restart since you added apache to the users group?
If I change the user rights of var/hda/files/* to writable by all users and forward ports (80 and 443) in my router to the hda, what does this mean for the security of my files ?
well, unless you protect things, your files will be accessible externally. i am not familiar with phpfilenavigator yet, as we have not taken the time to make it work in the new online installer. ajaxplorer provides some login, which is something. if it's used with https it's then all relative to the security of the app itself.

same thing for phpfilenavigator.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

wvdlee
Posts: 61
Joined: Wed Feb 25, 2009 9:19 am

Re: PHPfileNavigator - Web based file mangment

Postby wvdlee » Thu Feb 26, 2009 6:50 am

there is one last thing. user/groups changes do not take place until the user gets reloaded. did you reboot or at a minimum service httpd restart since you added apache to the users group?
I didn't know I had to reboot. :o So I tried again after a reboot and now everything is working! :D
Thank you very much. I really appreciate the quick response to my messages and your help.
Ajaxplorer also works now :!:

Maybe it is a good idea to make apache a regular user in the HDA dashboard, with the explanation added "acces rights for web-apps" or something like that?

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: PHPfileNavigator - Web based file mangment

Postby cpg » Thu Feb 26, 2009 11:59 am

technically, you did not have to reboot. all that was needed was to "log out" the user and log it back in. since apache runs for a long time, you would have to have completely restarted httpd at a minimum.

i filed bug 46 to track this. i think it's a good idea that may simplify things, even if introducing potential issues. add yourself as a watcher to the bug report to track when we implement it.

please note: we are working on a new platform that should make installing all these apps as simple as a one-click install. we made a small change to the way webapps work which is not backward compatible and we may or may not be able to transition existing webapps nicely. we'll ask for your patience if this time comes. the transition in webapps can be done easily with a couple of command line commands.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

Who is online

Users browsing this forum: No registered users and 6 guests