Wordpress wp-content Permissions settings behaviour on different servers - wordpress

I built a WP site on a particular server. I did not set or change any folder permissions and everything worked perfectly. Mainly, I could upload files and images.
I then moved the install to a different server and domain. Suddenly I could not upload to the media library.
On checking the permissions of the wp-content folder and its sub-folders the permissions were set to 755. I only assume this is what they were set to on the previous server.
By setting them to 777 I could then upload files but understand this is a big security risk. I then set it back to 755 and cannot upload again.
Can anyone explain why 755 is ok on one server but not on another please? and what I could do on the new server to make 755 acceptable?

The file permissions are correct 755, you'll have to check the file owner also.
Do not assume the file permision and owner on the development server will be correct on other servers (different os's can give issues as the one you have, different webservers from different os's can give again issues as above).
It also depends on the way you upload your files:
-you can do it throw ftp then you'll have to check the ftp settings (how it saves the files, under which user).
-if you use ssh to upload then it depends on the user that you used to connect to the server
and so on... (I saw the ftp tag but wanted to describe this also )
At this point you'll have to make sure that the website files have as owner the webserver (different server setups require different websrevers - www-data vs apache vs ... )
In the end it depends on the control (options you can change) on the server, do you have ssh access? Do you have to contact your host for this corrections?
If you are not administrating this new domain server then contact it's administrator it is a setting issue(of the ftp ) or a bug/error that he should handle.

Related

Account missing from WHM

I cannot locate a account from WHM (list accounts). I can access cpanel for that domain (mysite.com/cpanel).It just disappeared from whm. So now I cant directly go to mysite.com. I don't have a backup but all the files and db exist for that domain. Any solution to this problem because I cant find such a thing.
How do i find the option via WHM Control Panel?
If you have root SSH access of our server then check /etc/trueuserdomains and /etc/userdomains file because you without root access you can not check these files. if you have only cPanel access then you need to contact your hosting provider to check your mission domain logs.
Was there any cPanel upgrade performed on server recently?
If you have root access then login to your server via SSH and run the following command:
$ /scripts/rebuildcpusers
It should rebuild files for each domain under /var/cpanel/users from source databases.
If you has a root acces to server
Access SSH to server
Check /etc/userdomains – this file should contain the the domain and username that’s missing.
Check /etc/trueuserdomains domain.com: username
Check /var/cpanel/users/USERNAME
/var/cpanel/users/USERNAME
DNS=domain.com
IP=ipaddress
USER=username
OWNER=root (This will be set to ‘root’ unless the account was created under a reseller).
Check the Apache configuration file /etc/httpd/conf/httpd.conf and make sure that a virtual host exists for your domain. Try to rebuild apache /scripts/rebuildhttpdconf
Finally run /scripts/updateuserdomains

How do I fix an "Unable to create directory" error when I try to upload themes in WordPress?

I installed WordPress but now I can not install themes. I get this error:
Unable to create directory wp-content/uploads/2015/08. Is its parent directory writable by the server?
I have tried changing permissions to wp-content to 755 but did not fix it.
Read Changing File Permissions « WordPress Codex
If you can't or don't know how to check or change folder and FTP owners and groups, ask your web host.
Typically, all files should be owned by your user (ftp) account on
your web server, and should be writable by that account. On shared
hosts, files should never be owned by the webserver process itself
(sometimes this is www, or apache, or nobody user).
Any file that needs write access from WordPress should be owned or
group-owned by the user account used by the WordPress (which may be
different than the server account). For example, you may have a user
account that lets you FTP files back and forth to your server, but
your server itself may run using a separate user, in a separate
usergroup, such as dhapache or nobody. If WordPress is running as the
FTP account, that account needs to have write access, i.e., be the
owner of the files, or belong to a group that has write access. In the
latter case, that would mean permissions are set more permissively
than default (for example, 775 rather than 755 for folders, and 664
instead of 644).
Try do add this options to your wp-config.php file
define('FS_CHMOD_DIR', (0755 & ~ umask()));
define('FS_CHMOD_FILE', (0644 & ~ umask()));

How to access local WordPress installs from other machines on my network

I have XAMPP running fine on one machine and I have 2 WordPress installs running fine on that machine. I would like to be able to access and work on those WordPress installs on other machines on my network.
Right now, I have it set so that if I try to access those directories from another computer on the network, all I get is either the XAMPP splash screen, or a 404 error if I try to access specific folders.
I've researched this and researched this and I have found numerous posts about how to do this.... but only in bits and pieces.
Does anyone know of a step by step, start to finish, guide of how to do this? In layman's terms?
Remote (from another network) would be great too. But I'll cross that bridge once I figure this out.
Any help would be appreciated.
Thanks!
I would suggest rather than shared folders you use an FTP client / server - I use Filezilla server and client for my local sandbox testing server. This will give you additional info like file and folder groups and permissions.
Got to ask the question what OS? have you opened port 80 on the server machine?
Things like this can also occur on Linux if the folders and files do not have the correct groups for access and or permissions.
chown -R apache:apache /var/www/html
the above if on linux will assign all the folders and files to be accessed by the apache process. not having the correct groups assigned can give you 404 when you know the files are actually there.
also check the file and folder permissions,
different files and directories have permissions that specify who and what can read, write, modify and access them - this wordpress page gives a good overview of permissions
http://codex.wordpress.org/Changing_File_Permissions
edit p.s. to access then from other networks all you will have to do is forward ports from your router to your internal server then your ftp and www services will be accessable from the outside world. I would suggest using a .htpass htaccess password to protect your services at this point.

NETWORK SERVICE user and joomla, file/folders not writable, Windows 2008 IIS7

I'm trying to give the correct permissions to the user that Joomla (v1.6) runs as to enable uploading on a windows 2008 IIS7 box. I'm finding lots of conflicting responses on ye-ole internets.
When I go to the System Information -> Directory Permissions page in Joomla admin I can see that all directories are not writable. And, I've attempted the following.
I checked to make sure that -
My www service runs as: NETWORK SERVICE
My php-cgi.exe runs as: NETWORK SERVICE
I added the NETWORK SERVICE user to the root of the site (as a simple test) with full control and then went to advanced and had it propagate all permissions to sub-directories. None of the folders became writable from Joomla's point of view.
The only way to get the folders (and there are many) writable by Joomla, so far, has been to give the everyone user write access.
This is completely baffling me. I would really appreciate any help anyone can give!
As I commented, you have to setup proper rights for access.
The NETWORK SERVICE is the user for your application pool.
You can setup a user entity that access your local files.
As you can see in the screenshot (sorry, german only) you can choose your site, then check default settings and edit "connect as" and choose a user (you create a yoomla user before and grant rights to your local directories).
With this you can make it run imho.

Folder permission ASP.NET site online

I'm uploading files into a folder. It works as it should when I run the solution locally, but when I've uploaded the site to the web server using "copy website", - I can no longer upload files to the folder.
Can I change the permissions somehow?
It depends is the user that is trying to upload the file(s) into that directory on the server have permissions to that folder on the server, eg: read/write, ect... Also is the user that will be using that program on the server is running the application as themselves or as the IIS User account, or some other dedicated account?
Update:
Since you are doing it through the VPN, try terminal serving to that server and if you have personally permissions to make this change as in give permissions then do it yourself or ask the admins to do it for you.
Depending on the folder you are uploading your files into and the account you have configured the web server to execute your application under, there might be different ways to achieve that. But basically you should rant write access to this account to the given folder you are saving the uploaded files into. But if you use some of the special ASP.NET folders such as App_Data for example to store the uploaded files, the account should already have write permission to that folder. And if you have uploaded your site to some hosting company that don't provide you the possibility to change permissions on the different folders that are part of your website you might need to contact the support so that they perform he necessary modifications that you need.

Resources