Server directory permissions needed for AppGini

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Server directory permissions needed for AppGini

Post by KSan » 2014-07-03 20:48

Ahmad,

I was going over my setup and wanted to ensure I have just the right permissions on my server directories. I could not find any specific instructions on your support docs. What I'm seeing in the following doc :

http://bigprof.com/appgini/help/working ... pplication

if very limited in this regard. Can you kindly give us a quick overview on which directories need which permissions?

Thanks much!!! Regards,
Kerem

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Server directory permissions needed for AppGini

Post by KSan » 2014-07-03 21:14

For example, after uploading (FTP) my project and going through the setup I always get the following error :

"Error: Unable to write to config file"

I then have to manually create my config.php and upload this to my project directory on the server. This is fine and I would rather err on the safety side and keep permissions tighter rather than loose but it would be great to have a guide post from Ahmad on the needs and best practices.

Thanks

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Server directory permissions needed for AppGini

Post by a.gneady » 2014-07-05 12:04

Well .. the exact permissions actually depend on how your environment is set up ... Please check this discussion: http://stackoverflow.com/questions/2096 ... irectories
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Server directory permissions needed for AppGini

Post by KSan » 2014-07-05 17:00

Hi Ahmad,

Thanks for the link. It is very useful. However, my question is not on how to setup permissions but rather what the required permissions are for each directory under AppGini and in some cases for some specific files. Let me try to explain further.

I usually set my applications in a folder with 775. This gives the owner RWX (Read / Write / Execute) rights, the group the same and public gets RE (Read / Execute) with no write. Is this what you would go for? The only caveat is that during setup time you get an alert telling you that config.php can't be written to. The obvious solution is to change permission to perhaps 777 at least just for the install time and then revert. On this note, I'm not sure if Execute is needed at directory level. My files inside the AppGini directory have 664 (owner & group RW, public R ie readonly) and the app seems to be working well. Does this mean I can take away execute at directory level?

Then there are some folders like the Images. I go with a 777 to allow public write. If I don't give this one 777 then my AppGini application can't upload the images into this directory.

How about others?

So this is the kind of discussion and guidance I am looking forward to receiving from you. A simple guide that covers the minimum security allocations needed for various AppGini directories on the server. The goal here is to provide the least permission to each folder or even in some cases a file in order to result in the tightest configuration.

Your help will be most appreciated.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Server directory permissions needed for AppGini

Post by a.gneady » 2014-07-05 21:34

Well .. on several servers that I test on, 775 is enough to allow PHP to write to the directory (works for creating config.php and file uploads) .. in others, 777 is necessary. That's why I said that the exact permissions depend on how your environment is set up. You might set permissions of the application folder to 777 during setup then revert to 775 and leave the uploads folder set to 777 (or 666 for read, write and no execution)
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Server directory permissions needed for AppGini

Post by KSan » 2014-07-08 06:58

Just got this when sending email to a member using the Admin area :

Couldn't save mail queue. Please make sure the directory '/var/www/myserver.com/public_html/appname/admin' is writeable (chmod 755 or chmod 777).

Can you kindly elaborate more on why on some servers 775 is sufficient and why some require 777? Is AppGIni running as Public or as a member of a local group on the server? How can we control this so we can get away with 775 and not require 777? Thanks much!

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Server directory permissions needed for AppGini

Post by a.gneady » 2014-07-09 01:20

Is AppGIni running as Public or as a member of a local group on the server?
It's not exactly AppGini, but rather the PHP process that runs the AppGini-generated files. Please check this thread, it' a little long but probably answers your questions: http://unix.stackexchange.com/questions ... ld-var-www

Please note that PHP can be installed in several methods .. each requiring different permissions. That's why there is no single answer for that ..
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Server directory permissions needed for AppGini

Post by KSan » 2014-07-09 03:02

Got it. Thanks much for the link. Will read and learn.

MI000001
Posts: 6
Joined: 2015-08-16 13:13

Re: Server directory permissions needed for AppGini

Post by MI000001 » 2015-08-18 18:55

hello, what is the best permissions needed (example 640 etc) for the file config.php on a Linux server? I ask because obviously the database access info is in that file... any ideas to how to secure it please to the max and not cripple the application from running? thank you

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Server directory permissions needed for AppGini

Post by a.gneady » 2015-08-30 15:56

Did you try 640 and find it working? If it didn't work, try 644.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply