Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > serving nested pages with personal web sharing

serving nested pages with personal web sharing
Thread Tools
asidrane
Junior Member
Join Date: Jun 2001
Status: Offline
Reply With Quote
Mar 19, 2004, 01:26 AM
 
I have personal web sharing running some complex php pages intereacting with a MySQL db. The other day I tried to put a folder in my sites folder, but this wont serve pages to computers not on my private lan. Any file that is directly in ~/sites will serve to the internet, but files in folders in ~/Sites will not. How do I get this to work?
     
tRr
Dedicated MacNNer
Join Date: Aug 2002
Location: Toronto
Status: Offline
Reply With Quote
Mar 19, 2004, 04:02 AM
 
It seems to work fine here. (I know so much help )

Are you saying that computers on your LAN can access the folder in the Sites directory fine?

Have you made any drastic changes to httpd.conf? Does the folder have some sort weird permissions that Apache can't get around?

Just some guesses
     
Big Mac
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Mar 19, 2004, 06:21 AM
 
This has to be an issue with permissions. I'm not too sure why it would serve to those in your LAN but not outside it, however. Maybe if you Get Info on /~Sites and then click "Apply to Enclosed Items" you'll have success.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
asidrane  (op)
Junior Member
Join Date: Jun 2001
Status: Offline
Reply With Quote
Mar 19, 2004, 02:37 PM
 
well, I figured it out. Apparently, you need to include the trailing slash in the url. For example:

http://65.96.177.73/~asidrane
- returns an error "cannot be displayed"

yet
http://65.96.177.73/~asidrane/
-this works fine

accordingly,
http://65.96.177.73/~asidrane/a5
- is an error, but
http://65.96.177.73/~asidrane/a5/
-this works as expected.

Anyone know why this is? Can I change this default behavior? I know on linux, the trailing slash is not necessary
     
Laurence
Mac Enthusiast
Join Date: Mar 1999
Location: Portland, Oregon, United States
Status: Offline
Reply With Quote
Mar 19, 2004, 03:20 PM
 
This has been a bug that has annoyed me for quite some time. I've asked before, but no one ever had an answer. There has to be a way to correct this strange behavior, but I haven't found it!

Have you reported this BUG to Apple?
--Laurence
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Mar 19, 2004, 04:21 PM
 
I don't know if this will solve it, but reading similar issues, it could be related to UseCanonicalName. Try setting that option to "Off" (where by default it is "On") in /etc/httpd/httpd.conf.

If you aren't sure how to edit that file, you can use this one-liner:

sudo perl -pi -e 's/UseCanonicalName\ On/UseCanonicalName\ Off/' /etc/httpd/httpd.conf

Be sure to turn websharing off and back on again once you make this change.
     
theolein
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Mar 19, 2004, 04:53 PM
 
Originally posted by Xeo:
I don't know if this will solve it, but reading similar issues, it could be related to UseCanonicalName. Try setting that option to "Off" (where by default it is "On") in /etc/httpd/httpd.conf.

If you aren't sure how to edit that file, you can use this one-liner:

sudo perl -pi -e 's/UseCanonicalName\ On/UseCanonicalName\ Off/' /etc/httpd/httpd.conf

Be sure to turn websharing off and back on again once you make this change.
That will solve it. It's not a bug, but a feature of Apache that you can either enforce canonical names i.e. they trailing slash has to be included, or not.
weird wabbit
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Mar 19, 2004, 05:50 PM
 
Originally posted by theolein:
That will solve it. It's not a bug, but a feature of Apache that you can either enforce canonical names i.e. they trailing slash has to be included, or not.
I don't think UseCanonicalName is supposed to affect the trailing slash (or lack there of). It's only supposed to redirect the browser to the ServerName and Port settings that are set in httpd.conf. Apache normally redirects filenames to include the trailing slash if the user omits it. I think it is a bug that it fails to redirect properly when UseCanonicalName is set to On. I could be wrong, of course. I'm just piecing this together after having read more about it.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:41 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,