Apache Permissions

Posted:
in Genius Bar edited January 2014
OK, I have a weird, but simple Apache problem.



I want to run an OS X (client) box as an Apache (1.3.27) server for my family. I want them to upload pics and html files to my server via FTP. I do this all the time.



Here's my problem, in detail:



I just did a clean install of OS X 10.2.4 on a beige G3/333 with 512 MB RAM. It's on my T1 with a static IP.



I installed OS X, and created one user account called "Dan" (which is an "Admin" account, but not Root). Simple as pie.



I turned on FTP services. Lukemftpd. No tweaks. No ftpchrooting.



I turned on Web services (Apache) also. I am using the default Apache httpd.conf files. No custom settings or mods.



Then I FTP'd into the Web/FTPserver from my other Mac using Transmit and Fetch. I logged in fine. Since I am an "Admin" status user, I can "wander" all over the server, all the way to "/". Power. :0)



I uploaded a directory of html files (and JPGs, etc) into my /Users/Dan/Library/WebServer folder.



Then, from the same remote Mac I launched IE and tried to look at the files I just uploaded. The server tells me "Permission Denied." OK. Fine...



Then I decided to NOT put my web files in the "/~Dan" account, but instead I put them in the "root" /Library/WebServer/Documents/ folder and tried to view them with IE. Again I was denied. Same error.



From the server (physically), as an Admin, I changed the permissions of all my web files and folders to 777 (as a test). I restarted Apache. I went back to the remote Mac and then I COULD see the pages in IE with no problem. BUT: As another test I added more new files and pictures via FTP to existing directories and subdirectories, and sure enough, I couldnt view the new pages/folders. I didn't have the proper permissions.



So, everytime I, or my family adds files and folders via FTP, I have to go to the Mac and Physically (or via SSH) change all the permissions. Its not hard to do, but it's a big pain!



I don't think this is a Mac OS/Finder problem. I think it's an Apache problem. Any ideas?

Comments

  • Reply 1 of 3
    torifiletorifile Posts: 4,024member
    I think it's actually an FTP "problem" (not really a problem because that's how it's supposed to work.) There maybe some config file in the ftp configuration that you can tweak to change the default permissions. Neither apache nor the finder/ftp program are doing anything wrong (AFAICT).
  • Reply 2 of 3
    Whenever I ftp a file to my box, the permissions are 0640. Apache on my OSX box runs as user www, which falls under the other category. You can use umask during the ftp session to change the default permissions.
  • Reply 3 of 3
    The weird thing is that I have another G3 configured the same way exactly, except it is running 10.1.5 and its PERFECT. No permission problems. It rocks. What happened?
Sign In or Register to comment.