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

tonio

macrumors newbie
Original poster
Feb 4, 2003
7
0
403 error when trying to access Jaguar box from Win XP pro box OR my own mac's browser (any...explorer, safari)...

I recently added a PC running Win XP Pro to my home network; I'm using a Linksys router with a cable modem-there's 2 imacs (running os x 10.2.3) and the above=mentioned PC-it's a hard-wired network, each computer has internet access...After enabling Windows filesharing and Personal Web sharing on my mac, I can "see" the PC on the mac and mount the designated shared folders on my mac desktop...great...

Now. I want to be able to get files from my mac using the PC, and i didn't want to use ftp, so i read that files put in the Users/my name/sites folder could be accessed through the web browser on my PC-even if they were not index.html documents...I read that if any files named index.html were removed, then any file i put in there would be listed in a directory and available for download...now, the default index.html document, the one that welcomes you to Apache, I CAN read from the PC browser (explorer) after putting http://192.168.1.101/~my name/etc, etc ...However, when I remove the index.html file, I get a 403 error (you do not have permission to access ... on this server) message on the PC Browser...

How to I enable permissions to allow the PC access to an index directory? Is that something I have to do in Terminal? If so, how can I do that? I'm not too comfortable with UNIX at all...I just want the files I put in the "sites" folder to be listed, without them being html documents, so i can occasionally just pull a file from my mac on to my PC...

thank you for any help anyone may be able to give me...
 
Your problem stems from the fact that you can't view the contents of a web server's root directory.

Put index.html back. Next create a folder inside of your 'sites' folder. Put all your files into it. That should be all (considering you have permissions set properly). Point XPs browser to http://192.168.1.101/~my name/directory name and that should be it.

Let me know if this helps.


-jeff
 
hmmmm....

thanks Jeff...I REALLY appreciate your reply...

i still couldn't get a directory listed...when you said put the index.html document back, i assume you meant the default sample document that comes in that folder (along with the sample "images" folder)...i created a folder in my "sites" folder named "misc" and put 3 jpegs in it...i couldn't view anything, again, but the sample html document welcoming you to Apache...i restarted Apache (via personal web sharing button in "sharing") after each change...it seems that if it can't find an html document i get that 403 error...and idf that sample document is in there, that's all i can view...

could you perhaps provide a little more info on settings permissions, as you mentioned above? do you mean set them by clicking the "get info" option for a folder or document? once there, how and what exactly should i set that to? do i have to use that "indexing" option there? i logged in as root and tried to index the folder, but that didn't help either...

i know i really don't understand Apache, and i apologize if i'm asking illogical questions...again dude...thnx for the help, i really appreciate it..

tony
 
HTML Indexes in Apache

Look in /etc/httpd/httpd.conf and find this region:

----
#<Directory /home/*/Sites>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>
----

This section defines the options for users' personal pages (~/Sites directories). The key line here is "Options Indexes". It should already be there so all you need to do is uncomment (remove the # from the beginning of each line) this entire region.

If you don't know enough about UNIX to get to this (hidden to the finder) file here is a quick summary:

* launch terminal
* type "sudo pico /etc/httpd/httpd.conf" [enter]
* enter your password
* use the arrow keys and delete to navigate and modify the file
* press "ctrl-x"
* press "y" for yes I want to save
* press [enter] for the filename
 
Doh... one more thing. You must restart apache after changing it's configuration file! All you need to do is go to sharing in the "System Preferences" and press stop and start on personal web sharing.
 
help!

i followed the instructions in the above post...but now, in the "sharing" pane under system preferences, whe i try to turn on "personal web sharing"...it doesn't start...it says "persoanl web sharing starting up...." but it never completes the process, it just hangs there...i can start and stop other sharing options though...do you think i screwed up in Terminal? do you think i have to reinstall Jaguar to repair the file now?

Wow...aren't computers great?

:)

thanks!
 
Reinstall? Nah, of course not. You probably just made a typo in the config file (which can be re-commented out). If you are really at a loss to fix it you can just copy someone else's config file. For the exact error in the config file open the terminal and type:

sudo httpd

Apache is a text mode UNIX program so its error messages are outputted through the console. I made a mistake in my config file for demonstration purposes and this is what it said:

Syntax error on line 1 of /etc/httpd/httpd.conf:
Invalid command 'this', perhaps mis-spelled or defined by a module not included in the server configuration

For more information on configuring Apache, check out the Apache manual:

http://httpd.apache.org/docs/
 
wow...am i annoying you guys yet?

ok...i found the lines with syntax errors...i removed a few too many #'s ...so i, in fact, MAY BE as dumb as i look.... ;)

However...the only page i can view in my browser is still the sample html document...any other document or folder in the user/sites folder gives me the 403 error...

i looked at your sample conf file, and mine matches yours...in that whole region there are no #'s at the start of any line....

any other ideas? or have i exhausted your goodwill?

thank you again...

tony
 
Did you ever get your personal web sharing working?

I am currently in the same boat as you. As far as I know my personal web sharing was working in 10.2.4 (could have been 10.2.3) in any case it doesn't work now. All I had was the file in the my sites folder and it worked.
 
hmmm...

my problem was that i screwed up when i edited a UNIX file in Terminal, as referred to in emlyn's post above...yours seems to be related to an upgrade or a change in your OS, right? You said it did work, and now it doesn't...once i correctly re-edited the UNIX file, personal web sharing worked again...

what modifications have you made?
 
Re: hmmm...

Originally posted by tonio
my problem was that i screwed up when i edited a UNIX file in Terminal, as referred to in emlyn's post above...yours seems to be related to an upgrade or a change in your OS, right? You said it did work, and now it doesn't...once i correctly re-edited the UNIX file, personal web sharing worked again...

what modifications have you made?

No mods. I don't even run any haxies or system mods of any sort. The only thing I may have done is change the system permissions. I guess I need to know what my home folder and sites folders permissions should be.

I delved into the terminal the other night and found the error log file and this is what is giving me when I try to access my Personal Web Sharing.

[Wed Apr 30 00:19:40 2003] [error] [client 12.225.135.132] Directory index forbidden by rule: /Users/louis/Sites/

The funny thing is if I have the default html file in the folder I can access that but if I remove it I can not access the files. It could still be a permissions thing though.
 
It's all about permissions.

They need to be read AND execute for the "all users" category. So do this:

chmod 755 Sites/

Works like a charm. :)
 
Originally posted by Rower_CPU
It's all about permissions.

They need to be read AND execute for the "all users" category. So do this:

chmod 755 Sites/

Works like a charm. :)

I ran put that in the terminal and it appears to do something but it doesn't print a result it just comes back with a prompt.

It didn't change anything though. I even tried ~user/sites/.
 
in any case....

if you go into your library/webserver folder, RATHER than the users/"your name" or "home"/sites location, abd remove the existing default documents in there (and then put whatever you want in there), it WILL be accessible from your web browser (removing those documents that are there will allow a directory listing), and therefore over a network, etc....see if that works, then you'll know if your personal sharing option is screwed or if it's just a permissions thing, which gets real involved when one is not too comfortable with UNIX and your modifying them in Terminal (like me)...

maybe not exactly answering all your questions, but i wanted you to be aware of an alternative to getting a simple directory listing for use on the internet....


tony
 
Re: in any case....

Originally posted by tonio
if you go into your library/webserver folder, RATHER than the users/"your name" or "home"/sites location, abd remove the existing default documents in there (and then put whatever you want in there), it WILL be accessible from your web browser (removing those documents that are there will allow a directory listing), and therefore over a network, etc....see if that works, then you'll know if your personal sharing option is screwed or if it's just a permissions thing, which gets real involved when one is not too comfortable with UNIX and your modifying them in Terminal (like me)...

maybe not exactly answering all your questions, but i wanted you to be aware of an alternative to getting a simple directory listing for use on the internet....


tony

Thanks that helped some. I had been looking for the folder where the system kept the Apache files.

So here's what I have found if I put some files in the ~/library/webserver/documents folder then I can see them by accessing the system Apache webserver instead of the users webserver.

I tried correcting the permissions (in the finder not the terminal) so they matched that of the system folders but that didn't fix it. I have a feeling that I need to change this in the terminal. If someone could explain to me what to do I will do it.
 
OK, a couple things to clear up:

1) http://localhost/~user/ = Your personal site when accessed via a browser

2) The general webserver is located at /Library/WebServer/Documents NOT ~/Library/WebServer/Documents. There's a big difference. ~ refers to your home directory.

OK, MacBandit, follow these directions:

To enable directory listings in your personal web folder -
-Open Terminal
-Type "pwd" to see what directory you're in. It should say /Users/username
-Type "chmod 755 Sites/"
-Type "ls -la" to see the directories and their properties. The line with the Sites folder should look something this
drwxr-xr-x 5 username staff 170 Dec 6 11:40 Sites

The important part is the drwxr-xr-x part, which shows that all user and can read and execute within the folder.

To enable directory listing in the main web folder-
-Open Terminal
-Type "cd /Library/WebServer/"
-Type "chmod 755 Documents/"
-Type "ls -la" to see the directories and their properties. The line with the Documents folder should look something this
drwxrwxr-x 9 root admin 306 Apr 30 10:57 Documents

The important part is the drwxr-xr-x part, which shows that all user and can read and execute within the folder.



That should do the trick. :)
 
Originally posted by Rower_CPU
OK, a couple things to clear up:

1) http://localhost/~user/ = Your personal site when accessed via a browser

2) The general webserver is located at /Library/WebServer/Documents NOT ~/Library/WebServer/Documents. There's a big difference. ~ refers to your home directory.

OK, MacBandit, follow these directions:

To enable directory listings in your personal web folder -
-Open Terminal
-Type "pwd" to see what directory you're in. It should say /Users/username
-Type "chmod 755 Sites/"
-Type "ls -la" to see the directories and their properties. The line with the Sites folder should look something this
drwxr-xr-x 5 username staff 170 Dec 6 11:40 Sites

The important part is the drwxr-xr-x part, which shows that all user and can read and execute within the folder.

To enable directory listing in the main web folder-
-Open Terminal
-Type "cd /Library/WebServer/"
-Type "chmod 755 Documents/"
-Type "ls -la" to see the directories and their properties. The line with the Documents folder should look something this
drwxrwxr-x 9 root admin 306 Apr 30 10:57 Documents

The important part is the drwxr-xr-x part, which shows that all user and can read and execute within the folder.



That should do the trick. :)

Okay quickly the main web folder I can already access file in if I put them in there.

My ~/Sites folder has the correct permissions already.

drwxr-xr-x 23 louis admin 782 May 2 09:49 Sites.

I didn't change anything. It already had the correct settings.

I don't know if this makes a difference but here is the settings for everything within the folder.

[12-225-135-132:~] louis% ls -la ~/sites
total 2936
drwxr-xr-x 23 louis admin 782 May 2 09:49 .
drwxrwxr-x 24 root admin 816 May 2 09:49 ..
-rwxrwxr-x 1 louis admin 21508 May 2 09:49 .DS_Store
-rw-rw-r-- 1 louis admin 0 Feb 1 17:43 .localized
drwxrwxr-x 18 louis admin 612 Feb 11 23:36 Annie's Going away party for the Army 11:29:02
drwxrwxr-x 5 louis admin 170 Dec 31 22:06 Ashley
drwxrwxr-x 23 louis admin 782 Feb 11 23:37 Brew Fest 12:27:02 at Troy's
drwxrwxr-x 5 louis admin 170 May 2 09:49 CGI-Executables
drwxrwxr-x 21 louis admin 714 Feb 11 23:40 Cadburry
drwxrwxr-x 61 louis admin 2074 Feb 12 00:15 Camping 02:08-09:03
drwxrwxr-x 90 louis admin 3060 Feb 11 23:37 Camping 1:18-19:03
drwxrwxr-x 5 louis admin 170 Mar 12 08:28 Camping Mt. June 11-02-02
drwxrwxr-x 16 louis admin 544 Feb 11 23:39 Christmas 2002 Bridget's Family
drwxrwxr-x 15 louis admin 510 Feb 11 23:39 Christmas 2002 at Bridget's Parents
drwxrwxr-x 78 louis admin 2652 Feb 11 23:40 Las Vegas, NV 11:15-17:02
-rwxrwxr-x 1 louis admin 179698 Dec 1 11:49 Me, Bridget having breakfast at the Corner Cafe the last day they were open.JPG
-rwxrwxr-x 1 root admin 1263544 Dec 7 17:43 My Computer Setup.JPG
-rw-rw-r-- 1 louis admin 28532 Apr 3 17:39 Resume.cwk
drwxrwxr-x 8 louis admin 272 Mar 31 19:00 San Francisco Trip 03:18-22:03
drwxrwxr-x 40 louis admin 1360 Feb 11 23:40 Seattle International Motorcycle Show 12:02
drwxrwxr-x 12 louis admin 408 Feb 11 23:40 Sunday Drive 01:05:03
drwxrwxr-x 45 louis admin 1530 Mar 5 09:30 Sunday Drive 02:16:03
drwxrwxr-x 13 louis admin 442 Feb 11 23:40 Target Practice 12:29:02 Gravel Pit near Eagle's Rest

Here's the settings for the /library/webserver/documents folder. If I put files here I can access them currently.

drwxrwxr-x 37 root admin 1258 May 2 10:29 Documents
 
Originally posted by MacBandit
No, I can acess the system Apache server and can put files in there and see them. I can access the ~/user Apacher server and see the index.html but if I replace that with files I can not see them.

That's weird. Mine works fine with those permissions, and I didn't mess with httpd.conf either...weirdness.

At least the system one works fine.
 
Originally posted by Rower_CPU
That's weird. Mine works fine with those permissions, and I didn't mess with httpd.conf either...weirdness.

At least the system one works fine.

Hey thanks for all the help. I'll keep working on this and if I figure it out I'll let you know. Meanwhile I have another problem within the terminal. If you would take a look at this for me.

https://forums.macrumors.com/showthread.php?s=&threadid=25948
 
A quick rundown on file permissions:

You can use the numbers or letters to add/remove permissions to files/folders with the chmod command.

For numbers-
7=rwx
6=rw-
5=r-x
4=r--
3=-wx
2=-w-
1=--x

Numbering uses a mathematical scale, where execute access is 1, write access is 2 and read access is 4. Combinations of these amounts give you the different permission combinations. 7=4+2+1, thus rwx. The first position is the owner, the second the group and the third is everyone. Thus, rwxrwxrwx mean the user, the group and everyone all have read, write and execute privileges.


For letters-
Simply use the +/- signs to add/remove permissions for all users. With your directory with permissions rwxr-xr-x, simply type chmod +w and then the file/directory name. The permissions will then be rwxrwxrwx. Likewise, to remove permissions, use chmod -(letter) to take them away.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.