PDA

View Full Version : web sharing question


narcissus
Dec 13, 2001, 08:20 PM
I have recently setup PHP & MySql locally and everything I have tested in the terminal has gone off without a hitch...

I am unable to view the "sites" folder in the browser that I am using.
when I use my shared IP and directory I am told that I do not have permission.

What are the basic steps to make sure that the folder that is there will allow access to others (and me) through a browser?

I don't know if it makes a difference but I am using a Cable router.

Thanks

Oink
Dec 13, 2001, 08:37 PM
Shared IP? Can you be more exact? What did you type in the browser's address field? I am curious. What did you do in the terminal to set up your PHP/SQL?[/LIST]

narcissus
Dec 13, 2001, 08:45 PM
I ran the PHP install as per here :X (http://www.entropy.ch/software/macosx/php/)

then I typed in my shared IP as defined in the prefs in file and web sharing followed by ~user name. Looking like:
111.111.111.111/~username/

Does that answer your questions..?

[ 12-13-2001: Message edited by: narcissus ]

kidtexas
Dec 13, 2001, 09:05 PM
Is it possible that your home directory has its permissions set to drwx------? Cause if they are, I don't think apache has the rights to navigate down to /Users/name/Sites even if Sites is shared. You need to give others at least execute rights on your Home folder for them to be able to navigate through it to your Sites folder. so get your home folders rights to look like drwx--x--x... of course, your problem might be something different.

Oink
Dec 13, 2001, 09:41 PM
Unless you specifically changed the permissions, the default should work, where are your web files kept? ~/Sites or /Library/WebServer/Documents? Do you get anything when you do http://127.0.0.1 and http://127.0.0.1/~username/ from the machine?

Simon Mundy
Dec 13, 2001, 09:58 PM
Originally posted by kidtexas:
<STRONG>Is it possible that your home directory has its permissions set to drwx------? Cause if they are, I don't think apache has the rights to navigate down to /Users/name/Sites even if Sites is shared. You need to give others at least execute rights on your Home folder for them to be able to navigate through it to your Sites folder. so get your home folders rights to look like drwx--x--x... of course, your problem might be something different.</STRONG>

I had something similar happen to me yesterday, although the directory in question was the /Library/WebServer/Documents folder. I kept getting a 403 error.

I changed the permissions with SUDO CHMOD 775 /Library/Webserver/Documents but this hasn't fixed anything. Doing a get info on that folder showed that the user was 'system' and the group 'admin'.

Is this what you're getting Narcissus?

narcissus
Dec 14, 2001, 02:18 PM
Unless you specifically changed the permissions, the default should work, where are your web files kept? ~/Sites or /Library/WebServer/Documents? Do you get anything when you do http://127.0.0.1 and http://127.0.0.1/~username/ from the machine?

What is the correct directory to use....?
I did place the test PHP in the Library/WebServer/Documents/ and it worked fine. I have found that the PHP is installed correctly.

I was using the ~sites/ folder and that is where I kept getting the error. I think that I read some instructions somewhere that said that this was the one to use. Is that not the case?

I did some tests and I am able to hit the page using the IP that my router provides. As well as hitting it locally with the above IP.

Thanks for the help...

Oink
Dec 14, 2001, 02:34 PM
Sounds like your configuration file,
open /etc/httpd/httpd.conf with bbedit or any text editor

Do you see:
this line:
LoadModule userdir_module libexec/httpd/mod_userdir.so
make sure it is not commented out.

and these lines?
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
&lt;IfModule mod_userdir.c&gt;
UserDir "Sites"
&lt;/IfModule&gt;

Both locations would work if using the correct URLs. I keep a mirror of my hosted site in the Documents folder and keep some experimental stuff at ~/Sites.

Have you by any chance installed server software like iTool from tenon. If you have. Your httpd.conf file is modified.

Good luck

kidtexas
Dec 14, 2001, 02:45 PM
Would just like to remind you of my previous post. If it is only affecting user directories (especially only one), it could be that you changed your permissions on parent directory of your Sites folder. Some guy the other day had exactly this problem...

narcissus
Dec 14, 2001, 03:40 PM
Do you see:
this line:
LoadModule userdir_module libexec/httpd/mod_userdir.so
make sure it is not commented out.

and these lines?
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
&lt;IfModule mod_userdir.c&gt;
UserDir "Sites"
&lt;/IfModule&gt;

I know that this is dumb of me but... Where the hell is that? What directory?
I managed to open it in the command line and all of the mentioned above is there accept the quotes ( " ) around the word sites.

I am not sure that that makes a difference.

Would just like to remind you of my previous post. If it is only affecting user directories (especially only one), it could be that you changed your permissions on parent directory of your Sites folder. Some guy the other day had exactly this problem...

I checked and things are good on that end..... Thanks.