![]() |
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.