Off Topic
22 replies to this thread. Most Recent
hugh
22 Jul 2008, 9:23 am
local server address
Having difficulty using my local apache server on Powerbook G4 OSX10.4.11 - and hence any web stuff put in the ‘sites’ folder.
If I type http://198.165.1.66 it shows the ‘apache is installed page’ which looks like a good start. But if I then add my computer name and the sites folder to the address , ie. http://198.165.1.66/~anon/sites I just get a ‘Not Found’ error.
Similarly, if I replace the computer address with my computer name, the same thing happens: http://anonanons-computer.local/~anon/sites …..’Not Found’
Web sharing and file sharing both turned on in preferences.
Where is my web space?..!!!
Hugh
pandion
22 Jul 2008, 1:18 pmon 22/07/2008 10:23, hugh at email@hidden wrote:
Having difficulty using my local apache server on Powerbook G4 OSX10.4.11 - and hence any web stuff put in the ‘sites’ folder.
If I type http://198.165.1.66 it shows the ‘apache is installed page’ which looks like a good start. But if I then add my computer name and the sites folder to the address , ie. http://198.165.1.66/~anon/sites I just get a ‘Not Found’ error.
Similarly, if I replace the computer address with my computer name, the same thing happens: http://anonanons-computer.local/~anon/sites …..’Not Found’
Web sharing and file sharing both turned on in preferences.
Where is my web space?..!!!
I put my sites in [their own logically named folders**] here:
MacDriveName/Library/Webserver/Documents
Which is the default location for Apache when you do a 127.0.0.1, or http://localhost/ or the computer IP on it’s own.
** That way when I give Safari http://localhost/?C=M;O=D Apache just returns a list of folders sorted by most recent at the top, one for each website I manage, that way I can easily get what I need.
You’ll also need move or delete the index.html file, in:
MacDriveName/Library/Webserver/Documents
otherwise it just returns the Apache welcome page.
Best wishes Peter
================================ Peter Tucker, Oxford UK email@hidden
David Ledger
22 Jul 2008, 9:51 pmAt 05:23 -0400 22/7/08, hugh wrote:
Having difficulty using my local apache server on Powerbook G4 OSX10.4.11 - and hence any web stuff put in the ‘sites’ folder.
If I type http://198.165.1.66 it shows the ‘apache is installed page’ which looks like a good start. But if I then add my computer name and the sites folder to the address , ie. http://198.165.1.66/~anon/sites I just get a ‘Not Found’ error.
Similarly, if I replace the computer address with my computer name, the same thing happens: http://anonanons-computer.local/~anon/sites …..’Not Found’
Web sharing and file sharing both turned on in preferences.
Where is my web space?..!!!
If you were to enter http://198.165.1.66/~anon it will show any index.html that’s in ~anon/Sites ie ~anon/Sites/index.html
I keep each site in a sub-folder of ~/Sites and FW put the html in ‘site’ under that, so to see my sites I must point the browser at http://198.165.0.2/~david/MySite1/site
David
David Ledger - Freelance Unix Sysadmin in the UK. HP-UX specialist of hpUG technical user group (www.hpug.org.uk) email@hidden www.ivdcs.co.uk
hugh
23 Jul 2008, 10:40 amHi guys, thanks for replies.
I’m pretty sure I’m going to the right place…just can’t get any web sites. I have several folders under sites, but neither sites nor the sub-folders can be ‘found’.
e.g. for this address: http://198.165.1.66/~anon/sites/dallam
I get: “Safari can’t connect to the server - Safari can’t open the page http://anonanons-computer.local/~anon/sites/dallam because it could not connect to the server “anonanons-computer.local”
So maybe I phrased it wrong - I KNOW where my sites are, I just CAN’T CONNECT to them!
??
Mike B
23 Jul 2008, 10:57 amJust a couple of possible things:
The sites folder is with a capital S so it should it be Sites and not sites? how about http://127.0.1.2/~anon/Sites/dallam or http://127.0.0.1/~anon/Sites/dallam
HTH
On Jul 23, 2008, at 12:40 PM, hugh wrote:
Hi guys, thanks for replies.
I’m pretty sure I’m going to the right place…just can’t get any web sites. I have several folders under sites, but neither sites nor the sub-folders can be ‘found’.
e.g. for this address: http://198.165.1.66/~anon/sites/dallam
I get: “Safari can’t connect to the server - Safari can’t open the page http://anonanons-computer.local/~anon/sites/dallam because it could not connect to the server “anonanons-computer.local”
So maybe I phrased it wrong - I KNOW where my sites are, I just CAN’T CONNECT to them!
Freeway, PHP and MySQL examples
hugh
23 Jul 2008, 11:12 amHi Mike,
Good point…;)
Still getting a ‘Not Found’ though.
Interestingly, if I just put in http://198.165.1.66/~anon I get a Safari message with the Safari icon/logo on the browser page.
If I put in a more specific address like http://198.165/1/66/~anon/Sites….or /Sites/dallam I get an Apache ‘not found’ message plus the rider “Apache 1.3.41 server at anonanons-computer.local Port 80”
Entering just the computer address http://198.165.1.66 get’s the ‘apache successfully installed’ page.
H
hugh
24 Jul 2008, 12:56 pmI’m a bit stuck then, it seems……!
How does anyone else go about calling web pages which they have in their Sites folder?
The daft thing is….I’ve accessed them before and all was well. But I have a suspicion that was under 10.3.9 and before the day I upgraded to tiger (10.4.11).
Would that upgrade have fouled things up?
waltd
24 Jul 2008, 1:08 pmNo, there was a huge change between Tiger and Leopard which caught a lot of people off-guard (moving from Apache 1.3 to Apache 2.2 in one swell foop) but Panther to Tiger was seamless for me on all my many Macs.
If you go to http://localhost/ you will be looking at the contents of /Library/WebServer/Documents/ by default.
If you go to http://localhost/~yourshortname/ you will be looking at the contents of /Users/yourshortname/Sites/ by default.
If you have your files at either of those locations, then they will be visible in a browser running on the same machine as long as Web Sharing is checked On in the Sharing pane of System Preferences.
If you don’t see them, then the first thing to check is if your Web server is misconfigured somehow. Open /Applications/Utilities/Terminal and type the following:
sudo apachectl configtest
You will be challenged for an owner password. When you enter it and press return, you will see the results of a test of the configuration files. You should see several lines of result, none of which should include the word error.
Just to be sure, you can try
sudo apachectl start
which should complain that Apache is already running.
Walter
Freeway user since 1997
hugh
24 Jul 2008, 2:55 pmHi Walter,
If i go http://localhost ……I see the default apache ‘installed successfully page’
If I go to http://localhost/~anon ……the browser address changes to http://anonanons-computer.local/~anon and there is a Safari branded message saying: << Safari can’t connect to the server.Safari can’t open the page “http://anonanons-computer.local/~anon/” because it could not connect to the server “anonanons-computer.local”. >>
Both the terminal tests appear to run fine according to your instructions:
<< Password:[AnonAnons-Computer:~] anon% sudo apachectl configtestProcessing config directory: /private/etc/httpd/users/*.conf Processing config file: /private/etc/httpd/users/anon.confSyntax OK[Anonanons-Computer:~] anon% sudo apachectl start/usr/sbin/apachectl start: httpd (pid 174) already running[AnonAnons-Computer:~] anon% >>
Hugh
pandion
24 Jul 2008, 3:02 pmon 24/07/2008 15:55, hugh at email@hidden wrote:
Hi Walter,
If i go http://localhost ……I see the default apache ‘installed
successfully page’
If I go to http://localhost/~anon ……the browser
address changes to http://anonanons-computer.local/~anon and there is a Safari branded message saying: << Safari can¹t connect to the server.Safari can¹t> open the page ³http://anonanons-computer.local/~anon/² because it could not connect to the server ³anonanons-computer.local². >>
You need to replace the “anon” with whatever your “Home” folder name is in Users on your hard drive.
Best wishes Peter
================================ Peter Tucker, Oxford UK email@hidden
waltd
24 Jul 2008, 3:04 pmBe sure to add a / after the address. You are seeing the normal redirect in Apache where the server can’t figure out its own name. Check the Sharing pane of the System Preferences. At the very top is the computer name. Try changing that to something shorter and then restart the computer to be sure it “takes” all the way through. If that doesn’t fix it, then un-check and re-check Personal Web Sharing and try again.
So if you changed the computer name to anon, you would browse here:
http://anon.local/~anon/ and then if there is an index.html in your
Sites folder, you should see it.
Walter
On Jul 24, 2008, at 10:55 AM, hugh wrote:
Hi Walter,
If i go http://localhost ……I see the default apache ‘installed successfully page’
If I go to http://localhost/~anon ……the browser address changes to http://anonanons-computer.local/~anon and there is a Safari branded message saying: << Safari cant connect to the server.> Safari cant open the page http://anonanons-computer.local/~anon/ because it could not connect to the server anonanons- computer.local. >>
Both the terminal tests appear to run fine according to your instructions:
<< Password:> [AnonAnons-Computer:~] anon% sudo apachectl configtest Processing config directory: /private/etc/httpd/users/*.conf Processing config file: /private/etc/httpd/users/anon.conf Syntax OK [Anonanons-Computer:~] anon% sudo apachectl start /usr/sbin/apachectl start: httpd (pid 174) already running [AnonAnons-Computer:~] anon% >>
Hugh
Freeway user since 1997
David Ledger
24 Jul 2008, 4:36 pmAt 12:57 +0200 23/7/08, Mike B wrote:
Just a couple of possible things:
The sites folder is with a capital S so it should it be Sites and not sites? how about http://127.0.1.2/~anon/Sites/dallam or http://127.0.0.1/~anon/Sites/dallam
Again - you don’t need the ‘Sites’ at all. The place published by ~anon is ~anon/Sites. You will need the name of your FW ‘site’ folder where the html is though (or whatever you called it in the site configuration).
David
On Jul 23, 2008, at 12:40 PM, hugh wrote:
Hi guys, thanks for replies.
I’m pretty sure I’m going to the right place…just can’t get any web sites. I have several folders under sites, but neither sites nor the sub-folders can be ‘found’.
e.g. for this address: http://198.165.1.66/~anon/sites/dallam
I get: “Safari can’t connect to the server - Safari can’t open the page http://anonanons-computer.local/~anon/sites/dallam because it could not connect to the server “anonanons-computer.local”
So maybe I phrased it wrong - I KNOW where my sites are, I just CAN’T CONNECT to them!
David Ledger - Freelance Unix Sysadmin in the UK. HP-UX specialist of hpUG technical user group (www.hpug.org.uk) email@hidden www.ivdcs.co.uk
Mike B
24 Jul 2008, 4:48 pmHumm… I think your right actually, maybe I was thinking of using: /Users/anon/Sites
On Jul 24, 2008, at 6:34 PM, David Ledger wrote:
At 12:57 +0200 23/7/08, Mike B wrote:
Just a couple of possible things:
The sites folder is with a capital S so it should it be Sites and not sites? how about http://127.0.1.2/~anon/Sites/dallam or http://127.0.0.1/~anon/Sites/dallam
Again - you don’t need the ‘Sites’ at all. The place published by ~anon is ~anon/Sites. You will need the name of your FW ‘site’ folder where the html is though (or whatever you called it in the site configuration).
Freeway, PHP and MySQL examples
waltd
24 Jul 2008, 5:00 pm/Users/yourshortname/Sites is where you put it on your disk. [protocol]servername/~yourshortname/ is where the browser will “see” it.
Walter
On Jul 24, 2008, at 12:48 PM, Mike B wrote:
Humm… I think your right actually, maybe I was thinking of using: /Users/anon/Sites
On Jul 24, 2008, at 6:34 PM, David Ledger wrote:
At 12:57 +0200 23/7/08, Mike B wrote:
Just a couple of possible things:
The sites folder is with a capital S so it should it be Sites and not sites? how about http://127.0.1.2/~anon/Sites/dallam or http://127.0.0.1/~anon/Sites/dallam
Again - you don’t need the ‘Sites’ at all. The place published by ~anon is ~anon/Sites. You will need the name of your FW ‘site’ folder where the html is though (or whatever you called it in the site configuration).
Freeway user since 1997
hugh
24 Jul 2008, 5:07 pmNothing’s working…..and I’m going round in circles now….I’ve got localhost addresses, addresses with shortnames (users?), address with computer names, variations on them all with slashes and caps…..aaarrrrggghhhh
The Sites folder is sitting there under my ‘user’ directory (as viewed in the finder)….i.e. anonanon/Sites. It’s full of subfolders with all kinds of web sites and other goodies!
Apache seems to be working.
But none of these addresses produces a visible web site. It just returns a Not Found or Can’t Connect.
Am I to use…
??…because none of these work. Maybe I should use…
and get an all-in solution which doesn’t require you to jump through hoops!
pandion
24 Jul 2008, 6:30 pmon 24/07/2008 18:00, Walter Lee Davis at email@hidden wrote:
/Users/yourshortname/Sites is where you put it on your disk. [protocol]servername/~yourshortname/ is where the browser will “see” it.
Walter
Continuing this a little further
I have 2 Macs on Leopard both of which when I do 127.0.0.1 come up with the index page I placed Library/WebServer/Documents/.
But also on both [Leopard] if I do 127.0.0.1/~petertuc/ where I’ve put an index.html page I get a 403 error:
Forbidden You don’t have permission to access /~petertuc/index.html on this server.
If I do the same on Tiger, I get index.html pages turn up in both locations.
I have Web Sharing turned on in Sharing in Sys Prefs.
Best wishes Peter
================================ Peter Tucker, Oxford UK email@hidden
waltd
24 Jul 2008, 6:43 pmGIYF:
http://forums.macosxhints.com/archive/index.php/t-80130.html
http://forums.macosxhints.com/showthread.php?p=418359
This only happened on upgrade installs. I’m surprised that it hasn’t been patched with a system update since the Leopard launch.
Walter
On Jul 24, 2008, at 2:30 PM, Peter Tucker wrote:
Forbidden You don’t have permission to access /~petertuc/index.html on this server.
Freeway user since 1997
hugh
24 Jul 2008, 8:01 pmI just saw Peter’s post, so thought “what the hell, stick 127.0.0.1 in”…….
http://127.0.0.1/~anon ……….works!!
Now the interesting parts: as soon as I try and access a website in a subfolder of Sites, the address in the browser changes to show: http://mine.gateway.2wire.net/~anon/myhtmlsite/
‘Mine’ is the shortname for my computer (changed to this as per Walter’s suggestion) and ‘gateway.2wire.net’ must have something to do with my wireless router which is a 2wire model. Don’t know what it has to do with it, though!!
The other odd thing is that I had lots of PHP scripts in the Sites folder and none of these are parsed anymore. I must have put them there because I was testing them under 10.3.9, and they must have worked otherwise I wouldn’t have had 20 of them in there! But now they don’t work at all - call a PHP file and it just reads as text.
What is 127.0.0.1…?? Why should that work and not my own computer address?
Hugh
pandion
24 Jul 2008, 8:48 pmon 24/07/2008 19:43, Walter Lee Davis at email@hidden wrote:
http://forums.macosxhints.com/showthread.php?p=418359
This only happened on upgrade installs. I’m surprised that it hasn’t been patched with a system update since the Leopard launch.
Yup that link helped fix the issue I had with the personal folders.
The truth is out there
Thanks for the signpost ;~}}
Best wishes Peter
================================ Peter Tucker, Oxford UK email@hidden
David Ledger
25 Jul 2008, 10:43 amAt 13:07 -0400 24/7/08, hugh wrote:
Nothing’s working…..and I’m going round in circles now….I’ve got localhost addresses, addresses with shortnames (users?), address with computer names, variations on them all with slashes and caps…..aaarrrrggghhhh
The Sites folder is sitting there under my ‘user’ directory (as viewed in the finder)….i.e. anonanon/Sites. It’s full of subfolders with all kinds of web sites and other goodies!
Apache seems to be working.
But none of these addresses produces a visible web site. It just returns a Not Found or Can’t Connect.
Am I to use…
??…because none of these work. Maybe I should use…
and get an all-in solution which doesn’t require you to jump through hoops!
mamp isn’t going to be any different. The location accessed by http://localhost/~anon/ (assuming ‘anon’ is a real user name) is set in the httpd.conf file. A standard Mac install set it to the ‘Sites’ folder under anon’s home folder. If you put an index.html file at /Users/anon/Sites/index.html Apache will serve it to you.
You say you have subfolders under ‘Sites’. If your login is ‘hugh’, and you have a subfolder under ‘Sites’ called ‘MySite’ that has a Freeway site in it, and that is set within FW to publish to a ‘site’ folder, then http://localhost/~hugh/MySite/site will serve you the index.html from the Freeway MySite.
David
David Ledger - Freelance Unix Sysadmin in the UK. HP-UX specialist of hpUG technical user group (www.hpug.org.uk) email@hidden www.ivdcs.co.uk
David Ledger
25 Jul 2008, 10:43 amAt 16:01 -0400 24/7/08, hugh wrote:
I just saw Peter’s post, so thought “what the hell, stick 127.0.0.1 in”…….
http://127.0.0.1/~anon ……….works!!
Now the interesting parts: as soon as I try and access a website in a subfolder of Sites, the address in the browser changes to show: http://mine.gateway.2wire.net/~anon/myhtmlsite/
‘Mine’ is the shortname for my computer (changed to this as per Walter’s suggestion) and ‘gateway.2wire.net’ must have something to do with my wireless router which is a 2wire model. Don’t know what it has to do with it, though!!
The other odd thing is that I had lots of PHP scripts in the Sites folder and none of these are parsed anymore. I must have put them there because I was testing them under 10.3.9, and they must have worked otherwise I wouldn’t have had 20 of them in there! But now they don’t work at all - call a PHP file and it just reads as text.
What is 127.0.0.1…?? Why should that work and not my own computer address?
You may have to change the httpd.conf to allow PHP. By default it doesn’t. Not sure where the real httpd.conf is now, as my /etc/httpd.conf sets my docroot to /usr - which it isn’t, so it’s not what my Apache is reading.
127.0.0.1 is known as the ‘loopback’ address. All IP stacks have this reserved, just like they know about unroutable and multicast addresses.
All packets to 127.0.0.1 get passed directly to the software that handle them. They don’t go through the IP stack. Before M$ got their sticky fingers into IP there was also a convention of a ‘localhost’ address, which was always set on each host to be that host’s real main IP address. Packets to localhost did go through the IP stack, but didn’t hit the cable. This was useful in debugging in that you could write scripts that checked loopback and localhost in a hostname independent way. M$, not understanding such things, used them interchangeably and now localhost also resolves to 127.0.0.1.
David
David Ledger - Freelance Unix Sysadmin in the UK. HP-UX specialist of hpUG technical user group (www.hpug.org.uk) email@hidden www.ivdcs.co.uk
hugh
25 Jul 2008, 11:07 amThanks for that, David. Unfortunately a little over my head I’m afraid!
On the powerbook (which was the original issue and which had been upgraded from 10.3 to 10.4), http://127.0.0.1/~anon gets the web page, and and any subsequent subfolders. Serves html, but won’t parse PHP.
On the desktop G4, running 10.3, http://127.0.0.1/~hugh just gets a 404 Not Found error.
Couldn’t be arsed anymore so have ditched all the faffing around in OSX and installed MAMP on both machines. Although I have to type localhost:8888 as a preface to everything, IT ALL WORKS easy peasy :)
Hugh
hugh
30 Jul 2008, 2:04 pmAn interesting but disappointing conclusion to this (as I haven’t been able to fix it, really) is that if I have a FW site with a lot of .php file notations - this because some PHP is included in the freeway page to pull in various PHP functions.
On my PowerMac G4, previewing this site displays the site correctly in all browsers, with the exception, of course, that none of the PHP functions actually work. But at least I can ‘see’ the site, visually.
Working on the same file on my PowerBook, previewing the same site just shows a load of code in the browser window. i.e. the browser (locally) won’t have anything to do with a file with .php extension at all and won’t even interpret the html parts of it, which at least the desktop machine does. ie. basically impossible to preview anything from Freeway unless the pages are all pure html.
What works on one machine doesn’t work on another, even though they are virtually the same!
But this is the problem….there are so many ‘hidden’ settings in OSX which belie the apparent simplicity of the operating system.