Can't Upload to /var/www
This is at least my 10th attempt to get a linode up and running (I have learnt quite a lot).
I have followed the instructions exactly as per the guide -
But when I log in via filezilla the var folder (and child folders) is not shown leaving me with nowhere to upload my files to.
Apologies in advance for noobness.
Help!!
Sam
9 Replies
Then login to your FTP account and try again. I made the assumption you are using the Apache web server but what I said holds true for any server. To see what user/group has permissions go to /var/www and type ls -lsa
Use SFTP (which FileZilla supports) or SCP (which WinSCP supports) to xfer files to and from your server.
FTP is completely un-secure (sends passwords in clear text).
What should the correct permissions setting be for the directory /var/www/exampleSite.com?
I have tried adding my user to the www-data group and set the /exampleSite.com directory permissions via root (plus subdirectories and files) to drwxrwxr-x
It's still throwing an error when I try to upload/modify/delete from the directory
"Error: /var/www/exampleSite.com/public_html/index.html: open for write: permission denied
Error: File transfer failed"
Any other ideas??
Thanks heaps for your help so far!
@barkersam:
Any other ideas?
Just to test, use root to SFTP in and xfer those files.
If it works, then you know you have your user/folder/file premissions messed up, if it doesn't, it's not a permissions problem.
755 should be good - but it depends on what web engine (if any) you're using.
Here's Wordpress's file permission page (as an example):
I fixed it through the command line.
To see the permissions on the directory you are trying to access use the code
ls -l
make sure you add the path to the directory you are trying to look at or be in the correct directory where the directory you are trying to look at is stored.
to change ownership of the directory used
sudo chown username siteexample.com
to change the group I used
sudo chgrp username siteexample.com
you can then check to see if the changes took place by using the
ls -l
command on the directory again.
This page has more info file permissions.
but yeah after I changed the permissions to my user name I was able to access the directory via my SFTP program no problem. I'm using Cyberduck. For whatever reason I didn't have to do this with the other 4 virtual hosts but I did have to do it with this most recent one.
Another thing to check would be if your admin user account is set up correctly. this guide lists the instructions that I followed to set up my user as an admin but so that I can do what I need to do but not have to log in as root.
For anyone reading on. My issue was permissions related, changing the owner and group to my own user (from the root user) fixed the problem. I also had to change not just the /var/www/examplesite.com directory but also the subdirectories below it.
Any files which had been placed in by root were still not able to be removed/overwritten by my own user, so I had to log back in as root to remove them.
Cheers again!