Web Sharing Does NOT Work!!!

Discussion in 'macOS' started by wakerider017, Jan 25, 2008.

  1. wakerider017 macrumors 68000

    wakerider017

    Joined:
    Sep 20, 2006
    Location:
    US of A
    #1
    Well it worked fine for me in Tiger.. Just tried to use it on 10.5.1 and it does not work...

    What is going on? I think I have all the settings right.. I mean it is pretty simple stuff....


    [​IMG]

    [​IMG]






    P.S. I am using my main admin account... (Only 1 account on the computer).
     
  2. TEG macrumors 604

    TEG

    Joined:
    Jan 21, 2002
    Location:
    Langley, Washington
    #2
    I believe you need an index file in the URL. More than likely, Apple changed the permissions to not allow directory listings. You change that by making the permissions for you sites folder 555.

    TEG
     
  3. cohibadad macrumors 6502a

    cohibadad

    Joined:
    Jul 21, 2007
    #3
    do you have an index.html in your sites folder? otherwise it allows you to browse through web which is forbidden by default.
     
  4. wakerider017 thread starter macrumors 68000

    wakerider017

    Joined:
    Sep 20, 2006
    Location:
    US of A
    #4
    I have a index.html file in the directory...


    [​IMG]
     
  5. wakerider017 thread starter macrumors 68000

    wakerider017

    Joined:
    Sep 20, 2006
    Location:
    US of A
    #5
    Even a direct address to the file does not work...

    [​IMG]
     
  6. TEG macrumors 604

    TEG

    Joined:
    Jan 21, 2002
    Location:
    Langley, Washington
    #6
    SO in other words, you need to change the permissions for the folder and files. The world needs to be able to read and execute.

    TEG
     
  7. wakerider017 thread starter macrumors 68000

    wakerider017

    Joined:
    Sep 20, 2006
    Location:
    US of A
  8. Animalk macrumors 6502

    Joined:
    May 27, 2007
    Location:
    Montreal Canada
    #8
    Isn't 192.168.x.x internal IP addresses for your home/office network? how many routers are you going through? I suspect that is not your true outer IP address.
     
  9. wakerider017 thread starter macrumors 68000

    wakerider017

    Joined:
    Sep 20, 2006
    Location:
    US of A
    #9
    It is NOT a hardware issue as I said it worked fine in tiger.

    The 192 ip address is internal.


    Just 1 router. My "outer ip" has no relevance in this situation. The 192 ip should be able to direct me to those files just fine.
     
  10. Lixivial macrumors 6502a

    Lixivial

    Joined:
    Jan 13, 2005
    Location:
    Between cats, dogs and wanderlust.
    #10
    It looks like it's a consequence and oversight of the Tiger -> Leopard upgrade. Probably should file a bug about this.

    So here's what's going on (and how to fix it). When you create a new user in the "Accounts" section of Leopard it properly adds the appropriate user configuration file to /private/etc/apache2/users/.

    However, on upgraded Tiger accounts, where Tiger was running an older version of Apache, these are not carried over from Tiger's apache configuration area: /private/etc/httpd/users

    You can do two things -- if this is a upgraded Tiger account as I suspect it is -- it should be as simple as doing something like this:

    Code:
    sudo cp /private/etc/httpd/users/*.* /private/etc/apache2/users/
    Restart Apache by unchecking the "Web Sharing" and rechecking it. If that doesn't work, it's just a Directory specification that goes like this:

    Code:
    <Directory "/Users/talsma/Sites/">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    And is named talsma.conf. Save that in /private/etc/apache2/users/. I used the username you specified above, if that's not correct please correct it.
     
  11. wakerider017 thread starter macrumors 68000

    wakerider017

    Joined:
    Sep 20, 2006
    Location:
    US of A
    #11
    Nope didn't work.

    I didn't have the httpd folder since I did not upgrade from Tiger.

    Tried the talsma.conf file and put it in the correct location. restarted the apache server and got this:

    Deleted talsma.conf and I was immediately back to "forbidden."



    I may just wait til 10.5.2 and do a fresh install. The OS I am using now was a time machine restore, maybe some of the files are corrupted or something.


    Anyway is there an easier way to view hidden files? The only way I know is to type the address in safari.

    ex. file:///private/etc/httpd
     
  12. dtyson macrumors member

    Joined:
    Jan 20, 2008
    #12
  13. Lixivial macrumors 6502a

    Lixivial

    Joined:
    Jan 13, 2005
    Location:
    Between cats, dogs and wanderlust.
    #13
    Then I guess by looking into it, I stumbled upon a related bug, because that's what I saw from an upgraded Tiger machine and I received the same error as you.

    Then something was lost in translation. What did you use to save the .conf file? TextEdit? What did you use to copy it in? As a litmus test do this:

    1. Open Finder and Go -> Go to Folder (command-shift-G)
    2. Type in /private/etc/apache2/users/
    3. Take a gander at all the files here.
    4. Create a new user in "System Preferences", and then compare the list of files here with what was there before. You should note a new .conf file with whatever username you gave.
    5. Delete that new user from the "Account" panel in "System Preferences"

    Part of the user creation process is creating these supporting files. If you want to debug it, you should consult /var/log/apache2/error_log -- this will clue you into why Apache refused to start back up with that new config file in place.

    "Hidden" files aren't really necessary in this case. But you have a multitude of options: if you know the path, you can use the Go to Folder portion of Finder to go to it. You can enable hidden files and folder viewing in Finder with an unexposed preference. You can use Terminal. You can use an actual file browser.

    Either way, you shouldn't really be using Safari for this.
     
  14. wakerider017 thread starter macrumors 68000

    wakerider017

    Joined:
    Sep 20, 2006
    Location:
    US of A
    #14
    Weird...

    /private/etc/apache2/users/

    is empty. nothing in it.


    When I made the .conf file I used text edit. Saved it to desktop as a .rtf then changed the extension to .conf. Then just dragged it to the folder.



    I will create another user later tonight, about to go grab some dinner. :)
     
  15. Lixivial macrumors 6502a

    Lixivial

    Joined:
    Jan 13, 2005
    Location:
    Between cats, dogs and wanderlust.
    #15
    That's probably your issue. Watch what happens when I save that same file as RTF. ;)

    Code:
    {\rtf1\ansi\ansicpg1252\cocoartf949
    {\fonttbl\f0\fmodern\fcharset0 Courier;}
    {\colortbl;\red255\green255\blue255;\red238\green238\blue238;}
    \margl1440\margr1440\vieww9000\viewh8400\viewkind0
    \deftab720
    \pard\pardeftab720\ql\qnatural
    
    \f0\fs26 \cf0 \cb2 <Directory "/Users/talsma/Sites/">\
        Options Indexes MultiViews\
        AllowOverride None\
        Order allow,deny\
        Allow from all\
    </Directory>}
    If you're going to use TextEdit, I'd suggest doing this:

    1. Open TextEdit and do File -> New
    2. Format -> Make Plain Text (command-shift-T)
    3. Paste in the stuff I previously gave you a few posts ago.
    4. File -> Save As... -> Change "Save As" file name from Untitled.txt to talsma.conf and save to wherever you want. Be sure to say "Use .conf" in the proceeding pop-up.
    5. Then drag that one in and restart Web Sharing.

    Making it plain text is crucial here. :)
     
  16. rhyndu macrumors regular

    Joined:
    Dec 17, 2007
    Location:
    A Planet Orbiting Sol!
    #16
    To see if it is just an account issue, try creating a new account and see if that works. If it does, the easiest solution I can see is copying all of that account's info into this new account.
     

Share This Page