Port Log file locations [was Re: Replacing Mac OS Apache with macports Apache]

Ryan Schmidt ryandesign at macports.org
Sun Feb 14 17:18:15 PST 2010


On Feb 14, 2010, at 17:11, Scott Haneda wrote:

> Good point. I've aliased my Apache logs to a command, "wwwl" which cd's me to their current location of /opt/local/apache2/logs. In retrospect, that seems an unusual location.

The apache2 port is unusual in that it puts all of its parts in /opt/local/apache2 instead of merged into the standard directories within /opt/local.


> On OS X it is /var/log/apache2 and most ports follow that convention but with {Prefix} in front of the path.
> 
> I know there is a long standing Trac issue to work on a layout change to Apache2.

Right, that ticket would fix the unusual apache2 directory layout to match MacPorts layout better.

http://trac.macports.org/ticket/21315

> Would perhaps a first step be possible for the maintainer to move the logs now?

I would recommend an all or nothing change, not a piecemeal one.


> However, I took liberty to make {Prefix}/var/log/PureFTPd for the user. Is this good, bad, or neither?

That's good.


> How is it suggested to deal with MySql, an application that has traditionally logged to it's own directory?

I add the following lines to my /opt/local/etc/mysql5/my.cnf:

pid-file=/opt/local/var/run/mysql5/mysqld.pid
log-error=/opt/local/var/log/mysql5/mysqld.err
slow-query-log-file=/opt/local/var/log/mysql5/slow_queries.log


> Right now with my MySql 5 server install I have hostname.err in /opt/local/var/db/mysql/localhost.err
> 
> I have an empty mysql5 dir in /opt/local/var/log/mysql
> * should that be mysql5?

The mysql5-server port creates the directory /opt/local/var/log/mysql5 for you. It does not do anything with a directory /opt/local/var/log/mysql.


> If i were to enable slow query logging, or any other non standard logging calls, I would point them to /opt/local/var/log/mysql.
> 
> However, it would make no sense to me to move the ib_logfile* logs to /opt/local/var/log/mysql

I believe you're correct there.


> MySql seems a bit of a strange case, and I'm certain there are other similar cases. I've never paid attention on Linux to how it is done. Does MySql have a guideline?

I don't know. I don't think it matters where you put things on your server, as long as you know where they are.




More information about the macports-users mailing list