XF 1.4 Permissions for JS and Library directories

HeadHodge

Active member
Just migrated to a new server that has a different server user.

Does anyone know what the directory permissions should be for the JS and Library directories?

Can anyone tell me what you have yours set to?

The new OS is a GNU using Apache server and the server user is "apache"
 
In general files and directories should be 0644 and 0755 respectively.

The /data and /internal_data directories should be:
0666/0777 if PHP runs as "nobody" (the web server user)
0644/0755 if it runs as "your" user (suPHP for example)

Note that 0644/0755 only works if PHP is running as the user that owns the file (generally with cpanel setups).
 
Thanks for the reply. This is probably an incredibly dumb question, but if my php files are set to 644 or 666 (the execute bit turned off) how are my php files able to run ? I know they do but don't understand why.
 
Thanks for the reply. This is probably an incredibly dumb question, but if my php files are set to 644 or 666 (the execute bit turned off) how are my php files able to run ? I know they do but don't understand why.

PHP files are not executed directly. The file is read and the execution handled by the PHP processor.
 
Hopefully last question. I'm migrating an existing system to a new server, not reinstalling it. When you do run a new install is the server user used to install the needed directories and files? If so does that mean all directories and files created during the install would be owned by the server user (i.e. www-data, apache, etc.) ??

Thanks
 
Ok I read the install instructions and peeked into the install zip file. It states to copy the files in the upload directory to your site.

In that directory are the directories data, internal_data, js, library, style, and a few others.

So if I uploaded those directories using the root user the owner for them would be root (not the server user).

Then change the permissions on the data and internal_data so the server user can execute the install program.

So the unknown to me is whether during the install process the owners of the js, library directories get changed or whether the owner remains the root user.

Our old server provider went out of business so unfortunately I can't go back there and just plain ole look at the way it was installed there.

So I guess I'm wondering if I should set the owner on the JS and Library and other directories that were copied from the install zip file to the root user or the server user (i.e. www-data).
 
Normally your web root and everything under it should be owned by a different user account (not root). If you uploaded the files as root then you should chown them to change the owner:

Rich (BB code):
chown -R user:group /home/yoursite/xenforo/

The install script doesn't do this for you.
 
Normally your web root and everything under it should be owned by a different user account (not root). If you uploaded the files as root then you should chown them to change the owner:

Rich (BB code):
chown -R user:group /home/yoursite/xenforo/

The install script doesn't do this for you.
Thanks. Should it be the server user? (i.e. www-data) If not does the server user need more than read access to the directories?
 
Top Bottom