Find the answer to your Linux question:
Results 1 to 2 of 2
first question: I've installed mandrakelinux 10.1 with apache. Now I want to put files in the document directory (/var/www/html), but its permissions are 755 with owner apache. This means I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Location
    NL, Amsterdam
    Posts
    2

    publishing pages on web


    first question:
    I've installed mandrakelinux 10.1 with apache. Now I want to put files in the document directory (/var/www/html), but its permissions are 755 with owner apache. This means I can't put there files as normal user. Do I have to put files there as root or could I change the ownership to myself with chown?

    second question:
    How could I set up a ftp-server for uploading files to this directory from my winxp pc?

    Thanx in advance (and sorry for my bad english)

    Peter Smit

  2. #2
    Linux Newbie
    Join Date
    Mar 2005
    Posts
    230
    They can be any owner you want provided that apache can read the files. This is how I have my web stuff setup.

    mkdir -p /var/www/html/user/vhost
    chown -R user:client /var/www/html/user/vhost
    chmod -R 750 /var/www/html/user/vhost

    Since all users are under the "client" group, I merely add apache to the client group. Here's my client group in /etc/group:

    client:500:apache

    Then I want my system user 'user' to have access to their webroot within their home directory. So I do this command that only works on linux kernels 2.4.0 and above:

    mount --bind /var/www/html/user /home/user/html

    That way /home/user/www/vhost is also their webroot. Always be careful about binding directories to one another, cause it may wipe out the contents.

    Personally I recommend vsftpd as your ftp server. I configure it with a umask of 027 so that it is impossible for users to create group-writeable or anyone-accessible files in their home directory and webroot(s).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •