Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Dec 2004
    Posts
    1,164

    Default Getting Apache to link to FTP directory

    OK, I know I had gotten this working before, but that was possibly 4 years ago so I partially remember the exact steps I took.

    I'm running Fedora core 3, /etc/httpd/conf/ is where the httpd.conf files are, /var/www/html/ is the root of where the pages are served, /var/ftp/ is the ftp directory I want to show up when http://ip_address/ftp/ is used.

    What I tried, editted httpd.conf and added the lines:

    Alias /ftp/ "/var/ftp/"

    Thought maybe Apache didn't allow access out of /var/www/ so I created an link to that directory, /var/www/ftp/ then changed the Alias /ftp/ "/var/www/ftp/"

    Error is a 403 Forbidden, Don't have permission to access /ftp/ on this server, or something along the lines of that. (is the only error I get trying to access /ftp/)

    So I thought it might be permissions, and why not, Apache runs as apache I believe, and I doubt if the user apache has access to /var/ftp/ but to be honest, it should still have read/execute access having 755 permission.

    I may have configured vsftpd directory path to reside actually inside the /var/www directory when I got it working, but I would really prefer to leave it where it is and hopefully figure out how to get apache to access that directory.

    I also added

    <Directory /var/www/ftp/>
    Order allow,deny
    Allow from all
    </Directory>

    Still no go. So any ideas, my last resort is editing vsftpd.conf and making it reside inside /var/www/ but if I can eliminate this way, It would be better.

    Also added the link of /var/ftp/pub/ inside /var/www/html/ftp/ where ftp was just a new directory and not a link. This still resulted in a 403.

    Thanks in advance,


    KK

  2. #2
    Where is Metla these days Chilling_Silence's Avatar
    Join Date
    Dec 2004
    Location
    Auckland
    Posts
    17,146

    Default Re: Getting Apache to link to FTP directory

    A couple of things come to mind.

    mount --bind /var/www/html /home/username
    ^^ will re-mount the filesystem...
    You might also like to try re-creating a user, but specifying the /home/user folder as something else (man useradd).

    IIRC its: useradd kame -m -G users,audio,wheel,games -s /bin/bash -k /var/www/html

    Cheers


    Chill.
    I mostly do Bitcoin & DigiByte things these days, feel free to say hi on Twitter: https://twitter.com/dgb_chilling

    Before you ask a question here, or before you get upset by a response, see here:
    http://www.catb.org/~esr/faqs/smart-...ons.html#intro

  3. #3
    Senior Member
    Join Date
    Dec 2004
    Posts
    1,164

    Default Re: Getting Apache to link to FTP directory

    Cheers Chill,

    I remembered that command, now, I've done so many things to folders etc, that I can't give the correct method to do it, so I'll put down everything I've done, and maybe if I can resort to an earlier back up and perform individual tests on the subject to clear this up.

    So here goes everything I did, but without all the trial and errors:
    su -
    mkdir /var/www/ftp
    rmdir /var/ftp/pub
    chcon -R -h -t httpd_sys_content_t -u system_u /var/www/ftp
    mkdir /var/www/ftp/pub
    chmod 755 /var/www/ftp
    mount --bind /var/www/ftp /var/ftp

    then edit httpd.conf and add:

    Alias /ftp/ "/var/www/ftp"
    <Directory /var/www/ftp/>
    Options Indexes
    Order allow,deny
    Allow from all
    </Directory>

    back to console:

    service httpd restart

    then try it out.


    KK

  4. #4
    Pedant and proud of it
    Join Date
    Dec 2004
    Location
    Christchurch
    Posts
    6,047

    Default Re: Getting Apache to link to FTP directory

    Hasn't your mount command got the directory names in the wrong order? (mount A B mounts A on B, not B on A)

    Doesn't apache use chroot to limit what's accessible to it? Do soft links survive that? Mounting should.

    I'm sure the apache docs talk about this, but it's been a long time since I've looked at it.

Similar Threads

  1. IIS and Apache?
    By tony_young480 in forum PressF1
    Replies: 2
    Last Post: 11-08-2006, 04:19 PM
  2. Copy Active Directory users to Open Directory
    By technicianxp in forum PressF1
    Replies: 2
    Last Post: 13-04-2006, 05:27 PM
  3. Modify Apache Directory on Mac OS X
    By technicianxp in forum PressF1
    Replies: 1
    Last Post: 25-03-2006, 09:21 PM
  4. Apache help
    By 45South in forum PressF1
    Replies: 8
    Last Post: 26-10-2003, 03:58 PM
  5. PHP and Apache and ASP and IIS
    By NathanTheKind in forum PressF1
    Replies: 1
    Last Post: 04-06-2003, 09:30 PM

Posting Permissions

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