Apache won't start (was: Hi, I need some help)
Ali A Samii
samii at me.com
Wed Jul 28 09:34:39 PDT 2010
OK, so stopped apache2, sudo port load apache2
This is what echoed back:
sudo port load apache2
Error: Target org.macports.load returned: org.macports.apache2: Already loaded
Log for apache2 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_apache2/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
Re mysql, lots of problems
When I reinstalled it via the shell command line, it seemed to install properly. But then I tried create the initial databases using:
sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
I got no end of errors.
It couldn't make several directories, such as /opt/local/var/db/ and /opt/local/var/db/mysql5
and it couldn't build the initial databases.
So I issued an su and logged in as root, and there, I was successful to do it. Makes no sense to me because I issued the previous command using sudo.
Logged out as root, and tried to confirm mysql is running using mysqladmin5 -u root -p ping
I got no response, No error, no nothing.
mysql does not show up in ps auxw | grep mysql
then I issued a "mysql5 -u root -p" which echoed the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
I then created a file "/opt/local/etc/mysql5/my.cnf" and put in it the following line: "[mysqld_safe] socket = /tmp/mysql.sock"
Retried, and I got the same ERROR 2002.
So gave up on that, tried setting the password using "mysqladmin5 -u root password" and the echo was:
error: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/opt/local/var/run/mysql5/mysqld.sock' exists
And there I stand!
On 28 Jul, 2010, at 18:18 , Ryan Schmidt wrote:
>
> On Jul 28, 2010, at 11:13, Ali A Samii wrote:
>
>> OK, prior to the total reinstall I did, apache was running, as was mysql
>>
>> when I do a ps auxw | grep
>> and query for httpd - no process running now
>> and query for mysql - no process running now
>>
>> It appears that nothing is running.
>>
>> I just issued "sudo touch /opt/local/apache2/conf/httpd.conf" command
>
> why?
>
>> I followed it by "sudo /opt/local/apache2/bin/apachectl start"
>> I didn't get an error message nor any feedback whatsoever.
>
> I think that's normal.
>
>
>> However, I decided to try to get to localhost, and for some reason, something changed because I got there.
>>
>> So, I issued a " ps auxw | grep httpd": and it seems I now have 11 httpd start processes!
>>
>> _www 1510 0.0 0.0 2451584 1548 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1509 0.0 0.0 2451584 1564 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1508 0.0 0.0 2451584 1544 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1507 0.0 0.1 2451584 1636 ?? S 6:07PM 0:00.01 /opt/local/apache2/bin/httpd -k start
>> root 1506 0.0 0.2 2451584 5316 ?? Ss 6:07PM 0:00.09 /opt/local/apache2/bin/httpd -k start
>> ali 1550 0.0 0.0 2425568 204 s000 U+ 6:09PM 0:00.00 grep httpd
>> _www 1521 0.0 0.0 2451584 620 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1520 0.0 0.0 2451584 620 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1519 0.0 0.0 2451584 620 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1518 0.0 0.0 2451584 620 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1517 0.0 0.0 2451584 620 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>> _www 1516 0.0 0.0 2451584 620 ?? S 6:07PM 0:00.00 /opt/local/apache2/bin/httpd -k start
>
> Ok good. Note that you've just started the server, not scheduled it to start at system startup. So if you restart your computer, the server will not start again.
>
> If you want the server to start at system startup, use the launchd plist MacPorts has installed for you. The simple way to do that is to first stop Apache again, then run "sudo port load apache2". If you ever want to undo that, then you run "sudo port unload apache2". You can also use any 3rd-party launchd plist manager. Lingon used to be a good one, but is no longer being developed; not sure if there's a current alternative.
>
>
>> But still no mysql.
>
> Ok, so what's going on there? Logs? Messages?
>
>
More information about the macports-users
mailing list