Click to See Complete Forum and Search --> : Localhost Problem
kreativmediauk
12-09-2008, 01:53 PM
Hello. Sorry if this has been threaded before... or is in the wrong place.
I need information on setting up a local host.. but more like a dumb persons guide to setting up a local host on the mac.
Any offers please post.
Thankyou
TheBearMay
12-09-2008, 02:02 PM
I'd start here: http://www.macdevcenter.com/pub/a/mac/2001/12/07/apache.html
kreativmediauk
12-09-2008, 02:32 PM
hey. Thanks a lot. That really does help. I can set up a local host on a pc but not mac, but that link helps. Thanks
kreativmediauk
12-10-2008, 05:01 AM
Has anyone had this problem...
localhost was working fine one day... the html file was in the webserver folder and i could type in localhost and my local site would pop up no problem...
then today... the html file still in the right place but when i type in localhost.. it pops up with the usual error page. all the files are still in the right folder but no local website.
ps. Im on a Mac
TheBearMay
12-10-2008, 07:07 PM
Check to make sure Apache is still running....
kreativmediauk
12-11-2008, 05:16 AM
This is getting stranger...
Apache is running...
If i was to type in any of these below, I get nothing.
http://localhost/
http://***.***.*.5/ (* Being my computers I.P Numbers)
http://***.***.*.5/~Steve/ (* Being my computers I.P Numbers)
A copy of my files are in my local Sites folder and in my Library/WebServer folder.
I am on Mac OSX 10.5.5.
I have followed a lot of tutorials browsing the net but all dont explain any troublshooting, I found a lot of people in other forums whilst browsing that have / had this problem but no one replies with an explanation of how to fix the problem.
Im not knew to web development but I am knew to the server side of things and general stuff.
If someone knew how to fix this problem and write an explanation of how to here then maybe a lot of people can use this as a resource.
And I for one would forever be in the debt of whoever knows hot to solve this problem. It is a common problem.
Thank you in advance.
Steve
TheBearMay
12-11-2008, 07:47 AM
Just for the sake of argument how about http://localhost:8080 ? May need to look for the httpd.conf file - should be in the Apache/conf folder - and look through it for the root directory and port numbers....
kreativmediauk
12-11-2008, 08:15 AM
Thank you for the reply.
nope http://localhost:8080 doesnt work :(
The error page is as follows:
______________________________
Failed to Connect
Firefox can't establish a connection to the server at localhost.
Though the site seems valid, the browser was unable to establish a connection.
* Could the site be temporarily unavailable? Try again later.
* Are you unable to browse other sites? Check the computer's network connection.
* Is your computer or network protected by a firewall or proxy? Incorrect settings can interfere with Web browsing.
______________________________
I know that its not a firewall problem, my networks working fine, and all the web files are in the right places.
I admit though, I was messing around with terminal at the time and probably not sure what ive done.
It was working yesterday but not today... In that time I have done something with the terminal.
cannot find the httpd.conf file. ive searched it but no success...
any help would be appretiated and thanks for the replys so far..
kreativmediauk
01-06-2009, 09:42 AM
Ok So heres what Ive post on Webmaster-Talk.
Ok So I went through the first tutorial at : http://www.devarticles.com/c/a/Apach...P-on-Mac-OS-X/
I took all the # off these...
LoadModule php4_module
AddModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
restarted web sharing and Apache. went to http://localhost/ but still a Fail To Connect comes up. Theres an Index.html file in both Library/WebServer and MySites.
One thing I noticed was in System Preferences / Sharing / Web Sharing all the information has gone, nothing there at all also if i was to click the ? in the bottom right corner no help is there.
Id love to have this sorted before I install PHP and MySql but im reaching the end... not sure where to go? whats wrong? or what i am doing wrong?
Ive been through lots of online tutorials, all of which mainly telling me how to set this up, but not troubleshooting.
All the tutorials i have been through are :
http://www.devarticles.com/c/a/Apach...P-on-Mac-OS-X/
http://www.gigoblog.com/2007/11/08/c...x-105-leopard/
http://www.macdevcenter.com/pub/a/mac/2001/12/07/apache.html
http://lists.evolt.org/archive/Week-of-Mon-20071001/192059.html
http://www.mac-forums.com/forums/app...lhost-mac.html
http://forums.invisionpower.com/lofi...p/t279327.html
Maybe these links could help others but due to my problem I cant find what I need, or either figure out what my problem is, this is really pushing my knowledge on server set ups. Im at the point of no return, help lol
so continuing...
I have reached the point of no return on getting my localhost to work.
No matter what I have tried nothing works, its great to have it working on my MacBook but I really need it on my iMac...
Now Im asking for services, can anyone help?
Also for anyone wishing to help me install PHP & MySql on my iMac..
Thank you
any offers?
Hope to hear from anyone soon
I'm developing on a macbook and I had difficulty initially getting the webserver running that comes with 10.5. I did manage to get all running though (except I still can't connect to mysql).
What I do remember is that you did have to have the Web Sharing checkbox checked in System Preferences / Sharing.
You said that all of the information was gone from there, does that include Web Sharing no longer being checked? If so check that again and see if that makes a difference.
The other thing I noticed is you typed Index.html. The apache config specifies the filename to run by default when a directory is requested, and it is usually index.html index.php. So if your file is Index.html and you are just typing in http://localhost then it will fail to find the file to display, and apache is typically setup to not allow directory listings, which is what your browser would try next.
Could you have accidentally renamed the file to Index.html while in the terminal?
scribbles
03-07-2009, 03:45 PM
More informative way to start Apache is through the terminal. Start X11, xterm, bash, or whatever you have... And type "httpd". See what it says?
You might have to switch to a super user before being able to start the server, for example if it says it can't access the log files. In that case write "su" and it will ask you for a super user password. If that doesn't work try "su <admin username>", and the same... You might have to first switch to a regular admin, and then to root with "su root", depending on your file access rights.
I had a similar problem and it said that Apache had not been shut down properly the last time, for some reason. And looks like Mac OS X's "web sharing" panel is totally useless, it tells you the server is started even if it failed, and doesn't show you any of the errors that occurred.
scribbles
03-07-2009, 04:50 PM
Oh yeah and you might want to start the process by making sure you shut down all the old versions of Apache first. So type "ps -A | less" and write down all the PID numbers for "httpd" processes that are running. Then type "kill <pid>" for each... And try to start your own server after this. This way you don't have other instances of the server somewhere on the background causing problems. You may have to be a super user first to do this.
scragar
03-07-2009, 05:00 PM
Oh yeah and you might want to start the process by making sure you shut down all the old versions of Apache first. So type "ps -A | less" and write down all the PID numbers for "httpd" processes that are running. Then type "kill <pid>" for each... And try to start your own server after this. This way you don't have other instances of the server somewhere on the background causing problems. You may have to be a super user first to do this.
Doesn't mac support `killall process name` rather than killing each process in turn?