View Full Version : Web Sharing Does NOT Work!!!
wakerider017
Jan 25, 2008, 03:33 PM
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....
http://img89.imageshack.us/img89/4126/picture3ch9.png
http://img89.imageshack.us/img89/9831/picture1vj9.png
P.S. I am using my main admin account... (Only 1 account on the computer).
TEG
Jan 25, 2008, 03:44 PM
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
cohibadad
Jan 25, 2008, 03:46 PM
do you have an index.html in your sites folder? otherwise it allows you to browse through web which is forbidden by default.
wakerider017
Jan 25, 2008, 04:00 PM
do you have an index.html in your sites folder? otherwise it allows you to browse through web which is forbidden by default.
I have a index.html file in the directory...
http://img221.imageshack.us/img221/4952/picture2fr2.png
wakerider017
Jan 25, 2008, 04:02 PM
Even a direct address to the file does not work...
http://img91.imageshack.us/img91/145/picture4nl6.png
TEG
Jan 25, 2008, 04:05 PM
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
wakerider017
Jan 25, 2008, 04:19 PM
I think I already have it like that...
http://img406.imageshack.us/img406/7875/picture5kn9.png
Animalk
Jan 25, 2008, 04:38 PM
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.
wakerider017
Jan 25, 2008, 04:46 PM
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.
Lixivial
Jan 25, 2008, 10:09 PM
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:
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:
<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.
wakerider017
Jan 26, 2008, 10:07 AM
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
dtyson
Jan 26, 2008, 11:09 AM
http://localhost/~username/restofpath
works quite well for me in 10.5.1 when I need to preview files in development (via BBEdit or what have you).
Lixivial
Jan 26, 2008, 12:44 PM
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.
wakerider017
Jan 26, 2008, 04:19 PM
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. :)
Lixivial
Jan 26, 2008, 05:06 PM
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. ;)
{\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. :)
rhyndu
Jan 26, 2008, 05:36 PM
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.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.