Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm configuring an Apache server under CentOS 6.3. I want to put my app in

/var/www/html/<myApp>

But that directory is owned by root. How can I properly configure the access so I can publish files to that directory from a FTP client?

Initially I wanted to put my files under /home/myApp/wwwroot but that gives error messages as it seems under CentOS you're supposed to put your files under /var/www/html

What would be the right way of configuring this?

share|improve this question
1  
/home/myApp/wwwroot is perfectly valid. What is the error? –  phil-lavin Mar 25 '13 at 13:30
1  
Probably you have to configure SELinux in order to put your files in /home/myApp/wwwroot. –  jhcaiced Mar 25 '13 at 13:42

1 Answer 1

up vote 1 down vote accepted

My suggestion is:

  • Create the /var/www/html/YOUR_SITE directory, and own to your ftp user
  • Make sure /var/www/html/ have the 755 permission;
  • Create one user(please, dont use the ftp system user already created) and give the "ftpshell" to him. The home directory shall be /var/www/html/YOUR_SITE;
  • Configure your favorite ftp daemon(mine is vsftpd) to chroot by default to the home folder. Read the docs ;)

Done. When you connect through ftp, it will seems to be that you are at /, and your user will not navigate on the entire filesystem hierarchy.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.