Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wakerider017

macrumors 68000
Original poster
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....


picture3ch9.png


picture1vj9.png







P.S. I am using my main admin account... (Only 1 account on the computer).
 
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
 
do you have an index.html in your sites folder? otherwise it allows you to browse through web which is forbidden by default.
 
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
 
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.
 
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.

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.
 
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.
 
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:

Safari can’t connect to the server.

Safari can’t open the page “http://192.168.1.2/~talsma/” because it could not connect to the server “192.168.1.2”.

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
 
Nope didn't work. I didn't have the httpd folder since I did not upgrade from Tiger.

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.

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."

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.

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

"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.
 
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. 🙂
 
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.

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. 🙂
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.