![]() |
Trying to verify that Apache is running
I'm going insane trying to install Wordpress locally on my MBP running 10.5.5.
I've been using tutorials online to get Apache started up, then PHP, then MySQL, then set up a virtual host address, then get Wordpress up and running. Sadly, it's failing miserably. Right now, the thing that's frustrating me is that I can't get the Apache test screen to show up so I know it's running properly. I got that up last night, but then a later step told me to move the files to a different folder, so it's gone now. I've since tried to get the files back in to test again, but can't get anything to come up. BTW, all the files I'm talking about are located at Library/WebServer/Documents When I go to my Sharing pref panel, turn Web Sharing on, and then click on my "Your computer's website" link, I get the following: "Failed to Connect Firefox can't establish a connection to the server at 10.200.18.86. Though the site seems valid, the browser was unable to establish a connection." I've tried the same using "127.0.0.1" and "localhost" in my browser, and get the same message. What am I doing wrong? |
Do you have any other firewall software (other than the built-in one in OS X) running? It could be blocking port 80.
|
I know nothing that would be blocking any ports that has been changed since yesterday when it was working. Yesterday, I got Apache up and running, then I got MySQL up and running, then I put Wordpress in the Documents directory, moving the Apache files to another directory. Now nothing works.
I think my databases may be screwed up, and I'm trying to install PHPMyAdmin to work on that, but at this moment, I can't confirm that Apache is up because the Apache files don't seem to do anything after moving them back into the Documents folder. |
Save this to your sites folder and pull it up:
PHP Code:
|
Quote:
There's also a pre-existing similar file under the /Library/WebServer/Documents/ folder, and nothing happens when I try to pull it up in the browser as well. Oh, and I did make sure MySQL shows as running under the MySQL pref pane and Web Sharing is activated under the Sharing pref pane. |
Quote:
Code:
http://127.0.0.1/~yourshortusername/thefilename.php |
Is my shortname the one on my user folder?
If so, it doesn't bring up anything. I get: "Failed to Connect Firefox can't establish a connection to the server at 127.0.0.1. Though the site seems valid, the browser was unable to establish a connection." |
Quote:
|
Quote:
So now Documents includes all the stuff I moved over to "apache docs". There also appears to be a PHP folder in there, as well as the PHPMyAdmin folder I put in there. BTW, feel free to IM me. Info is in my profile. |
Looking back on the procedure I used to get here, the phpinfo.php test worked fine several times in the past.
Since then, I've installed the MySQL.prefPane-leopardfix. And I've done that file moving. Just in case those have anything to do with this problem. |
Have you tried turning off web sharing, then turning it on again?
|
Yes. Many times. :-)
|
Is your firewall on?
I can't think of anything in the Library/WebServer/Documents folder that might cause this. |
Also, when I do this in Terminal:
/usr/local/mysql/bin/mysql test it shows that MySQL is running. |
Quote:
I can't seem to get do anything with the WebSharing there. Can't highlight it. There's only a "+" down below. |
I'm on Tiger, so I can't tell you how, but see if you can turn off the firewall.
|
I've set it to accept all connections, but nothing has changed. I also turned Web Sharing off and then on after that, but nothing changed.
|
I'm trying to back out whatever changes I made, but nothing's working. I truly have no idea what's going on. No matter what I try, the browser "can't establish a connection to the server".
|
Assuming that lawyervon is your shortusername, try:
http://127.0.0.1/~lawyervon/index.html |
From everything I'm finding, it appears that john is my shortname
I've changed the URL to that, but nothing. |
Please launch the "Terminal" application (under /Applications/Utilities) and copy & paste the following commands (all together), press Return, then copy & paste the results back here so we can see:
id /usr/sbin/apachectl -t sudo /usr/sbin/lsof -i -P | grep 80 ps -aex | grep httpd grep DocumentRoot /etc/apache2/httpd.conf echo "done" |
Something odd happens when I do the cut and paste.
When I paste it, it gets al the way through the "Macintosh:~ john$ sudo /usr/sbin/lsof -i -P | grep 80" line shown below, so I pasted in the rest again, but it comes out as (see below): ps -aex | grep httpd grep DocumentRoot /etc/apache2/httpd.conf echo "done"ps -aex | grep httpd grep DocumentRoot /etc/apache2/httpd.conf echo "done" instead of what I input, which was: ps -aex | grep httpd grep DocumentRoot /etc/apache2/httpd.conf echo "done" Anyway, below is the result: Code:
Last login: Mon Nov 24 07:47:22 on ttys000 |
Quote:
You seem to have introduced a syntax error in the Apache config files. |
Here's what's in that document after the instructions at the very beginning. What's wrong? I backed out the one change I've made trying to add a virtual host setting:
# # Use name-based virtual hosting. # NameVirtualHost *:80 # Override the default httpd.conf directives. Make sure to # use 'Allow from all' to prevent 403 Forbidden message. <Directory /> Options ExecCGI FollowSymLinks AllowOverride all Allow from all </Directory> # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "/www/docs/dummy-host.example.com" ServerName dummy-host.example.com ServerAlias www.dummy-host.example.com ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log" CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log common" </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "/www/docs/dummy-host2.example.com" ServerName dummy-host2.example.com ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log" CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log common" </VirtualHost> |
I've removed the CustomLog entries and get the same error
|
What directory are these /www/ references referring to? I don't find a /www/ subdirectory anywhere.
|
Quote:
I think you copied an example path when you should have used a path to an actual site that you had set up. |
Actually those example paths were already there when I opened up the file to create my entry. I have no idea where they came from. Should I delete those example paths or at least hash them out?
|
In case you need the examples in the future, I'd put the # in front of them
#<VirtualHost *:80> #ServerAdmin webmaster@dummy-host.example.com #DocumentRoot "/www/docs/dummy-host.example.com" #ServerName dummy-host.example.com #ServerAlias www.dummy-host.example.com #ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log" #CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log common" #</VirtualHost> #<VirtualHost *:80> #ServerAdmin webmaster@dummy-host2.example.com #DocumentRoot "/www/docs/dummy-host2.example.com" #ServerName dummy-host2.example.com #ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log" #CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log common" #</VirtualHost> |
OK -- I've commented out everything. Guess I'll need to rethink virtual hosting, or do it right next time. Regardless, that works. I've now got the Apache screen to show up. Yea! Thanks!
Terminal now says the following. What's all this mean?: Last login: Mon Nov 24 12:54:39 on ttys000 Macintosh:~ john$ id uid=501(john) gid=501(john) groups=501(john),98(_lpadmin),80(admin) Macintosh:~ john$ /usr/sbin/apachectl -t Syntax OK Macintosh:~ john$ sudo /usr/sbin/lsof -i -P | grep 80 ntpd 14 root 21u IPv6 0x3c7e380 0t0 UDP *:123 FileSyncA 175 john 10u IPv4 0x6dfca68 0t0 TCP 10.10.100.60:52791->idisk.mac.com:80 (CLOSED) StickyWin 185 john 4u IPv4 0x5fcd66c 0t0 TCP 10.10.100.60:49201->webx25.aruba.it:80 (CLOSED) Adium 278 john 22u IPv4 0x6e6b66c 0t0 TCP 10.10.100.60:49808->kc-in-f125.google.com:5222 (ESTABLISHED) Mail 279 john 31u IPv4 0x5fcd270 0t0 TCP 10.10.100.60:49670->idisk.mac.com:80 (CLOSED) Mail 279 john 34u IPv4 0x636666c 0t0 TCP 10.10.100.60:52805->mu-in-f111.google.com:993 (ESTABLISHED) firefox-b 309 john 6u IPv4 0x5f7166c 0t0 TCP 10.10.100.60:52545->72.32.115.41:80 (ESTABLISHED) firefox-b 309 john 49u IPv4 0x5d02e64 0t0 TCP 10.10.100.60:52857->12.120.101.14:80 (ESTABLISHED) httpd 2293 root 3u IPv6 0x3c81720 0t0 TCP *:80 (LISTEN) httpd 2297 _www 3u IPv6 0x3c81720 0t0 TCP *:80 (LISTEN) httpd 2298 _www 3u IPv6 0x3c81720 0t0 TCP *:80 (LISTEN) Macintosh:~ john$ ps -aex | grep httpd 2293 ?? 0:00.69 /usr/sbin/httpd -D FOREGROUND 2297 ?? 0:00.01 /usr/sbin/httpd -D FOREGROUND 2298 ?? 0:00.00 /usr/sbin/httpd -D FOREGROUND 2320 ttys000 0:00.00 grep httpd Macintosh:~ john$ grep DocumentRoot /etc/apache2/httpd.conf # DocumentRoot: The directory out of which you will serve your DocumentRoot "/Library/WebServer/Documents" # This should be changed to whatever you set DocumentRoot to. # access content that does not live under the DocumentRoot. Macintosh:~ john$ echo "done" |
I now have Apache working and I have my phpinfo.php file producing results.
Now I'm trying to get phpMyAdmin to work so I can work on my databases because I think my ultimate problem may lie in the database connections and permissions. When I pull up localhost/phpmyadmin, I get a welcome to phpmyadmin screen with the following errors: "The configuration file now needs a secret passphrase (blowfish_secret). Cannot load mcrypt extension. Please check your PHP configuration." If it matters, my /Library/WebServer/Documents folder now contains all the Apache files, plus a PHP folder, the PHPMyAdmin folder, and the folder containing my Wordpress files. I thought I'd created a secret passphrase in the config.inc.php file by filling in a word where the xxxx are: $cfg['xxxx'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ I'M GOING TO MOVE THIS DISCUSSION UNDER A NEW THREAD TITLE FOR CLARITY |
Quote:
Quote:
Quote:
Quote:
Quote:
|
Wow - thanks!
I've been wondering how my Mac knows to look in the Library/WebServer/Documents folder instead of the Sites folder. I'm assuming it's that entry in the Apache config file relating to the DocumentRoot. Thanks everyone for your help here. SO MUCH! I never would have figured this out without you. As you'll see over in the other discussion about Wordpress once I got the Apache up and running, I've now got Wordpress running just fine. Thanks so much again! http://forums.macosxhints.com/showthread.php?t=96155 |
I'm having a similar problem. Apache used to work just fine on my MacBook Pro, but I hadn't tried to use it in probably 6+ months until yesterday. Regardless of what I try, I get "Page Load Error" "Failed to Connect" message from Firefox. I've tried using Wildcat (my computer name), localhost, 127.0.0.1, and several variations at the hostname with no luck. I have placed a small index file in both /Library/WebServer/Documents and /Users/Ben/Sites to insure the serving directory isn't the problem.
I stumbled across this thread while doing some research and I'm hoping someone can help me out. I've included my results to the series of Terminal commands from earlier... Ben@Wildcat[/private/etc/apache2] [22:53:39]> id |
| All times are GMT -5. The time now is 07:59 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.