=_= 긴 연휴 집안 일 완전 열심!

어제 저녁 갑자기 필 받아서 쓸데없이? 달린 https+svn 셋팅 외에는 몸 만들기 및 집안일…
문제는 어제 날 지세우면서 축척했던 에너지를 다 날려버렸다는것이고…
너무나도 열심히 집안 일 하다보니.. 혓바늘이 났다는것!
허리가 끊어질듯 아프긴 하지만, 나름 보람있는 하루 하루였을까나…

내일부터 다시 스트레스의 통돌이로 들어가는구나… =_=

 

MAC, Apahe2, SVN, https

Snow Leopard에서 https로 svn을 접근하기 위해 셋팅 도중…

mod_authz_svn을 로딩하지 못하는 오류 메시지 발견…
httpd: Syntax error on line 155 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_authz_svn.so into server: dlopen(/usr/libexec/apache2/mod_authz_svn.so, 10): Symbol not found: _dav_svn_split_urin  Referenced from: /usr/libexec/apache2/mod_authz_svn.son  Expected in: flat namespacen in /usr/libexec/apache2/mod_authz_svn.so

이를 해결 하기 위해 svnserve를 컴파일… 하려 했으나, sqlite3가 당장 없다고 투덜 투덜…

www.sqlite.org에서 sqlite3를 다운로드…
configure하고 make한 다음, make install로 install

subversion.apache.org에서 subversion 다운로드…
./configure –with-sqlite=/usr/local로 configure, make
여기까지 하고 여기에서 나오는 mod_authz_svn등을 apache의 mod로 복사…
[subversion디렉토리에 들어가보면 mod_ 디렉토리 2개가 있는데 막상 해당 디렉토리에 so 파일들이 없는것처럼 보이는데, .libs 한단계 더 들어가보면 shared lib 빌드가 이곳에 들어 있다!!!]

————————————————————————————————-

잠시 apache 서버를 띄워서 수정..;;;
갑자기 일이 커졌다..;;;
결국 위의 모듀들 다 넣어서 구동을 시작하였으나 APR/APR-UTIL등의 버젼이 다르다는 메시지가 발생…
httpd 컴파일할때 연결된 APR/APR-UTIL의 버젼 문제로 새 모듈하고 연결이 안되는거 같아서 httpd를 다시 빌드하기로 결정…
고난의 길이 시작…

apr 옵션
./configure –enable-other-child –with-sendfile –enable-allocator-uses-mmap –enable-ipv6 –prefix=/usr/local/apr

apr-util 옵션
./configure –with-apr=/usr/local/apr –prefix=/usr/local/aprutil –with-berkeley-db=/opt/local/include/db53:/opt/local/lib/db53
./configure –with-apr=/usr/local/apr –prefix=/usr/local/aprutil –with-berkeley-db=/opt/local/include/db53:/opt/local/lib/db53 –with-sqlite3 –with-mysql –with-pgsql –with-iconv –with-expat=/opt/local
./configure –with-apr=/usr/local/apr –prefix=/usr/local/aprutil –with-berkeley-db=/opt/local/include/db53:/opt/local/lib/db53 –with-sqlite3–with-iconv –with-expat=/opt/local

apr-util에 대해서는 3가지 옵션을 테스트중인데, 모 결국 다 되는거 같은데 include/lib path yes/lib등이 들어가는 문제를 빨리 잡아야 될듯…
apr-util 빌드 후 make test를 할때 testmemcache에서 segment fault가 일어나는데, 이것은 테스트 코드의 문제라고…

failure on test : memcache
http://issues.apache.org/bugzilla/show_bug.cgi?id=52705

berkeley-db 설치… 그냥 간편하게 Mac Ports로…
macport
port install db53

httpd – apache 대망의 httpd
./configure –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/aprutil/bin/apu-1-config –with-expat=/opt/local –with-pcre –enable-mods-shared=all –enable-authn-alias=shared –enable-ssl –enable-cache –enable-disk-cache –enable-file-cache –enable-mem-cache –with-mpm=prefork –prefix=/Users/belliny/Dist

prefix를 저렇게 지정은 했지만 전혀 먹히지 않는…
httpd의 디렉토리들은 상수값으로 지정이 되어 있다… 이것을 바꿀 수 있는 방법은 configure단계에서 layout을 지정하는것…
그러나, 일단 이것을 보면…

원래 Snow Leopard에 실려 있는 httpd -V

Server version: Apache/2.2.22 (Unix)
Server built: Jul 12 2012 15:09:37
Server’s Module Magic Number: 20051115:30
Server loaded: APR 1.3.8, APR-Util 1.3.9
Compiled using: APR 1.3.8, APR-Util 1.3.9
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with….
-D APACHE_MPM_DIR=”server/mpm/prefork”
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FLOCK_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT=”/usr”
-D SUEXEC_BIN=”/usr/bin/suexec”
-D DEFAULT_PIDLOG=”/private/var/run/httpd.pid”
-D DEFAULT_SCOREBOARD=”logs/apache_runtime_status”
-D DEFAULT_LOCKFILE=”/private/var/run/accept.lock”
-D DEFAULT_ERRORLOG=”logs/error_log”
-D AP_TYPES_CONFIG_FILE=”/private/etc/apache2/mime.types”
-D SERVER_CONFIG_FILE=”/private/etc/apache2/httpd.conf”

반면 그냥 빌드한 httpd의 -V는… 이와는 꽤 다른 모습이다..
왠지 이거 맞춰줘야 될거 같은 느낌이랄까…;;;
이걸 맞추기 위해서는 코드를 직접 손 대야 되는 문제가….

grep -r “DEFAULT_PIDLOG” ./

등과 같이 해당 코드를 일일이 찾아서 수정~!

결과는..?
몇몇 definition은 버젼이 올라가면서 없어졌다고 한다…

Server version: Apache/2.4.3 (Unix)
Server built: Oct 3 2012 05:56:12
Server’s Module Magic Number: 20120211:6
Server loaded: APR 1.4.6, APR-UTIL 1.4.1
Compiled using: APR 1.4.6, APR-UTIL 1.4.1
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with….
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT=”/usr”
-D SUEXEC_BIN=”/usr/bin/suexec”
-D DEFAULT_PIDLOG=”/private/var/run/httpd.pid”
-D DEFAULT_SCOREBOARD=”logs/apache_runtime_status”
-D DEFAULT_ERRORLOG=”logs/error_log”
-D AP_TYPES_CONFIG_FILE=”/private/etc/apache2/mime.types”
-D SERVER_CONFIG_FILE=”/private/etc/apache2/httpd.conf”

 

subversion
./configure –with-sqlite=/usr/local –enable-shared –with-apr=/usr/local/apr –with-apr-util=/usr/local/aprutil

————————————————————————————————-

httpd를 사용자 계정 디렉토리에 설치하여 mod_authz_svn, mod_dav_svn 로딩이 잘 되는지 테스트 중인데, 뜻하지 않은 에러가 발견되었다…
_ap_log_error symbole not found
구글링해보니… apache2에서 이 api가 변경된듯한데 mod_authz_svn과 mod_dav_svn에서는 아직 이전 api interface를 사용하면서 참조가 안되는듯…

추가가 된 파라미터는 APLOGNO(n)
매크로인데  n으로 들어가는 5자리 숫자는 원래 정해진 값을 공유해서 유니크하게 들어가야 되는거 같은데…
-_- 일단 파일별로 inc…

테스트중…
테스트를 하다가 ap_log_error의 인자값 개수 문제가 아니라는게 떠올랐다…
결국 문제는 다시 처음부터…

움? 언제 tigris svn이 apache아래로 들어간거지..?

움..?

언제 옮겨진거지..?
Subversion

This is the former website of the Subversion software project, which now calls subversion.apache.org home.

Until the transition into Apache-hood is complete, this site will continue to serve some of the purposes of the Subversion project. For example, the project is still using the issue tracker hosted here. But in time, it is expected that this site will be converted into mostly just a set of pointers to information that has moved over to the subversion.apache.org site.

If you’re looking for downloads of Subversion, visit our Source Code or Packages pages.

Thanks for your patience as we work through this transition!

 

mac Log종류

간략하게 로그의 종류들을 설명한 페이지

http://www.mactech.com/articles/mactech/Vol.23/23.03/2303Shell-WhichLog/index.html

Volume Number: 23 (2007)
Issue Number: 03
Column Tag: Mac in the Shell

Mac In The Shell — Which Log?

Following up on which log shows you what

by Edward Marczak

 

Introduction

I’ve had incredible response to my last two columns that talked about logs: what they are, how to interpret them and how to notify yourself if a log is telling you something important. More than any other question, however, people have asked, “which log does what?� While I gave an overview of some logs, there are plenty more that I haven’t gone into, and more locations for logs than I could describe previously. That’s what I’ll be following up on this month. So, read on for even more on logs.

 

Kinda I Want To

Just as a review for anyone who didn’t read the previous columns, logs are text files that running programs write to that keep track of their activity. Text files, that’s all. (OK, an app could keep a binary log, but for the most part, text it is). This allows other apps and, more importantly, humans to read their contents. Apps are free to deal with logging on their own, or, they can use syslog to hand off their data to the system logger. It’s a bit of a style issue, and usage is roughly split on which method is chosen. There’s nothing that says that an application can’t do both. Let’s look quickly again at the syslog method.

The system logger, aka “syslog�, is a daemon run at boot that should be running all of the time. It listens for logging data locally, and knows where to put a logging entry based on its configuration file /etc/syslog.conf. “syslogd� can also be setup to listen for logging data from other machines as well. Log data can be categorized by facility and level (a “selector�). The facility is basically where the data is coming from (“mail�, “ftp�, etc., along with some generic facilities). The level describes the severity of the log message. The currently defined levels are:

Emergency (level 0) Alert (level 1) Critical (level 2) Error (level 3) Warning (level 4) Notice (level 5) Info (level 6) Debug (level 7)

(Don’t you love it when things neatly fit into a byte?) Looking at /etc/syslog.conf, you can then see which messages will be directed to which files. Note that some will go to multiple files.

This is a bit of a review, as all of this (and more) was covered in previous articles in this column.

 

Down In It

Apple has created a little bit of a split with logging: “Unix-y� files in /var/log, and everything else. While that may be a bit of an overgeneralization, it’s a good general guideline.

syslogd, as you can see from /etc/syslog.conf, will dump just about everything in some log residing in /var/log. Additionally, several non-syslog sending services also drop their files somewhere into the /var/log hierarchy. The two big notables in this category would be apache � logging into /var/httpd � and samba, which logs into /var/samba. You’ll also find some other non-syslog-ish files hanging around in /var/log, and we’ll address those a little later.

The other place you’ll find good logging information falls into the “everything else� category. You’ll find these in /Library/Logs or ~/Library/Logs. System processes will log to /Library/Logs and user processes, when the user home directory is writable, will log to ~/Library/Logs. For example, anything that needs admin level rights to run � AFP logs, Software Update and, my favorite, Directory Services � will log to the System directory /Library/Logs. Other user-space apps � Logic, SyncServices, Parallels, etc. � will log into the user’s own Library/Logs.

If you’ve peeked into either of these directories, you’ll notice that there’s another category of logs: logs that get generated as the result of a crash.

 

Something I Can Never Have

For those of you obsessed with the running process list, you’ll no doubt have noticed the persistent /usr/libexec/crashreporterd. Apple’s crash reporter daemon hangs around waiting for an application to crash. Technically, it listens for a Mach exception to be generated, and, upon that happening, launches crashdump. crashdump then logs and reports the event to the user. If the user can be determined, and they have a writable home, the report goes into ~/Library/Logs/CrashReporter. You really forget how much stuff takes a dive until you peek in there:

Jack-Kerouac:~/Library/Logs/CrashReporter marczak$ ls -1
BOMArchiveHelper.crash.log
Cyberduck.crash.log
Dreamweaver.crash.log
Finder.crash.log
GrowlTunes.crash.log
Mail.crash.log
Now Up-To-Date.crash.log
Pages.crash.log
Parallels.crash.log
Preview.crash.log
Quicksilver.crash.log
Safari.crash.log
VirtueDesktops.crash.log
Workgroup Manager.crash.log
firefox-bin.crash.log
iSnip.crash.log
mdimportserver.crash.log
vmware.crash.log

Wow. When an app’s owner can’t be determined, is a system process, or the user’s home directory is not writeable, crashdump logs into /Library/Logs:

Jack-Kerouac:/Library/Logs/CrashReporter root# ls -1 
ARDAgent.crash.log
Exited process.crash.log
httpd.crash.log
iSnip.crash.log
loginwindow.crash.log

LoginWindow crash…I like that one! crashreporter itself, however, logs its actions into /var/log/crashreporter.log. Finally, crashreporterd is also responsible for writing panic logs when the system is rebooted after a panic � find the log at /Library/Logs/panic.log.

 

Terrible Lie

If you root around /var/log long enough, you’ll even start to notice some other files that aren’t syslog generated at all. The most notable of the bunch are daily.out, weekly.out and monthly.out. These log files are generated by the daily, weekly and monthly periodic jobs that run overnight (if your machine is up and running, but not necessarily logged in).

Also of note are wtmp and lastlog. Interestingly, these are binary log files, and must be read with another application. These are not present for troubleshooting per se, but instead track login activity. User IDs, along with their login time get written to lastlog. From there, the utmp file gets updated with the user login information, and the same utmp record gets written to /var/log/wtmp. users, w and who use utmp to provide their information, while last and ac use wtmp.

 

That’s What I Get

So, back to the original question: which logs record which bit of information? Here’s a 40,000 ft. view:

/var/log/system.log

Along with asl.log, these are the big kahunas. Most system related activity is logged here. Specifically, the following selectors log to system.log:

*.notice
authpriv,remoteauth,ftp,install.none
kern.debug
mail.crit

As mentioned in January, asl.log pretty much gets everything, and displays the facility and level with the log message.

/var/log/secure.log

Messages from Apple’s SecurityServer get logged here � along with anything in the authpriv facility. Good one to keep an eye on. Interestingly, though, some security-related information logs to system log as well (such as sshd authentication errors through PAM).

/var/log/mail.log and /var/log/mailaccess.log

Complimentary logs that describe mail (if you’re running OS X Server’s built-in mail � OS X �client’ also uses /var/log/mail.log). mail.log contains activity for postfix, SMTP sending and receiving while mailaccess.log contains cyrus’ imap and pop activity. mail.log is the place to look when clients are telling you that they sent mail that the intended recipients never received (mail going out), or that someone sends them e-mail which they themselves never received (mail coming in).

/Library/Logs/DirectoryService/*

Huge. HUGE I say! Anyone operating in an OD, AD or other LDAP-reliant environment should be checking here occasionally. Of course, if you’re trying to bind a workstation to a directory, and it’s just not working for some reason, this is the place to check. Don’t forget to throw DirectoryService into debug mode (killall -USR1 DirectoryService, logging to DirectoryService.debug.log), or use boot-time debugging (touch /Library/Preferences/DirectoryService/.DSLogDebugAtStart � which will also log to DirectoryService.debug.log) if the situation calls for it � covered in detail in past Mac In The Shell articles.

 

Logs that you don’t need explained

There are some logs that simply don’t need any explanation. These include:

/var/log/ftp.log (contents of the ftp server)
/var/log/httpd/* (Apache's log files)
/var/log/samba/* (Samba's log files)
/var/log/lpr.log (lpr printing activity)
/var/log/cups/* (CUPS web sever activity)
/Library/Logs/Software Update.log (Software Update install history)

/Library/Logs/AppleFileService � OK, perhaps this one does need some explanation. But not by me � from the engineers at Apple. This should be the Mecca of information that you reach for when you want to track activity coming in through AFP. However, details in this log are so sparse to render it useless. Despite the fact that AppleFileServer runs as one grand, monolithic process, we need it to give up the goods on what’s happening internally in these logs.

 

The mega-log

Remember, that you can always have all syslog messages be delivered to a single file by using a wildcard selector in /etc/syslog.conf:

*.*      /var/log/mega.log

…although asl.log is already catching most of that. Further remember that this will not capture everything else that is performing logging on its own and not using syslog/asl.

 

The Only Time

While I made a strong case for watching and examining logs using good �ol Unix tools � grep, tail and less � and I would still make that assertion, there are some other very useful tools out there.

 


Figure 1: Splunk searching for events (detail)
Console.app is the most obvious for us Mac users; it’s “built-in� and clearly Mac-like. I still think it’s a miserable way to follow log activity as it happens, but it is a fantastic tool for exploring the various logs that exist on the system. Fire up Console.app (located in the Utilities folder) and poke around. It’s a great learning experience.

I’ve found a newer tool on the market to also be very useful, and while it’s not Mac-specific, it’s nice that there’s an OS X version at all. Splunk is billed as a logfile search engine. It comes in a free version that will sift through up to 500MB of logs per day, and a paid version which not only removes that restriction altogether, but also adds Splunk-to-Splunk logging for log correlation across many machines, and also authentication which is missing in the free version.

Splunk alone could take up an entire column (and may very well one day soon); it is so easy to get going, that I’d recommend the download. Excellent documentation exists on the site as well. Of course, Splunk makes it really easy to search for events, but I’ve found that it’s a nice exploratory tool in general. Splunk quickly categorizes events and can let you filter on those events. Figure 1 shows the search engine, running in a browser, looking at event type 9 on my machine.

Even cooler, perhaps, is the ability to look at the frequency of events. Figure 2 shows the frequency of events that appear in the secure.log of my machine � clearly a good one to keep an eye on and reign in this kind of data.

 


Figure 2 � Splunk showing the frequency of various events that appear in a given source.
In a small-to-medium sized organization, you could set up a single server as a log host (check the prior logging articles for instructions) and have Splunk access that log. 500MB is a lot of logging information. Enough that you shouldn’t have a problem using the free version of Splunk.

 

Sanctified

So here’s the real story with logs: you can ignore them, sure. Then when a problem crops up, you can just tell your client/employer that this is just the way computers are. There are bugs, there are problems; such is life. If you watch the logs, you’ll know there’s a problem, and then you’ll actually have to do something about it.

Or, you can realize that this is the only way the system can speak to you and more often that not, you’re warned well in advance of any catastrophic problems. You can head these off at the pass. You can keep the system providing services without interruption and keep up with real work.

Of course, the unfortunate cases do arise where you need to ascertain what happened after the fact. Did that mail get sent? Did that volume bomb on space and then recover without us really knowing? Was someone trying to brute-force a login through ssh at the same time our web server was under attack? In those cases, knowing which logs to look in and how to read them are your only resource for piecing together information after an event took place.

Media of the month: you might suspect it would be some Nine Inch Nails title, however, I’d have to disappoint: that was only a passing fancy. The real Media of the Month is, “Innumeracy: Mathematical Illiteracy and Its Consequences� by John Allen Paulos. A book that I forgot I had until I lent it out. Easy, enjoyable, powerful reading.

WWDC time again! Apple has announced the dates (June 11th through the 15th, if you’d missed it), so, get ready. If you’re attending, I hope to see you there in person! Until then, though, I’ll see you in print next month…


Ed Marczak owns and operates Radiotope, a technology consultancy that brings enterprise solutions to small and medium-sized businesses. Outside of this piece of the puzzle, he is Executive Editor of MacTech Magazine, a husband and father, and CTO of WheresSpot, among other things. Find the missing tech piece at.

com.apple.wikid[1517]: AssertionError

TimeMachine 복구 이후, 서버 로그에서 꽤 빈도가 잦게 다음과 같은 로그가 발견…

com.apple.wikid[1517]: AssertionError

원인은 특정 디렉토리들이 유실되어 시스템에서 파일 접근을 하지 못하여 나타나는 현상…
이곳에서 답을 찾음…
http://discussions.apple.com/thread/4296215?start=0&tstart=0
해결 방법
http://support.apple.com/kb/TS2915

Mac OS X v10.5, Mac OS X Server v10.5: Web, Mail, Wiki, Personal Web Sharing, Parental Controls services may not start after restoring a Time Machine backup

Products Affected

Mac OS X 10.5, Mac OS X Server 10.5

Symptoms

After restoring from a Time Machine backup in Mac OS X v10.5 (client), Personal Web Sharing and the Parental Controls web filter may not start.

After restoring from a Time Machine backup on Mac OS X Server v10.5, Web, Wiki and Mail services may not start.

Resolution

Recreate folders that are not included in the Time Machine backup as described below.

To restore the Web service (server), Personal Web Sharing (client), and restore Internet access for users subject to the Parental Controls web filter (client):

  1. Open Terminal (in /Applications/Utilities).
  2. Execute these commands, each on its own line, followed by Return. Note: When using these commands you will be prompted for an administrator’s password.sudo mkdir /var/log
    sudo mkdir /var/log/apache2

     

  3. To restore the Wiki service (server), run the following commands in addition to those above:

    sudo mkdir /Library/Logs/wikid

    sudo chown _teamsserver:_teamsserver /Library/Logs/wikid
     
  4. To restore the Mail service (server), execute the following command:sudo /etc/postfix/post-install create-missing
  5. After running these commands, stop and restart each service, or restart your computer.

 

더불어… ical에서도 비슷한 로그 에러가 난다면…

Mac OS X Server: CalDav Log Fun

갑자기 시작된 Server ReInstall

시작은… 아마도 XGrid가 안되서였지?
정확하게는 Open Directory가 정상 동작하지 않는거 같아서…

Snow Leopard Server를 clean install하고 테스트하니 너무나도 깔끔하게 동작…
다시 인스톨하고 time machine으로부터 이전 데이터 migration하려 하니… 에러… 한번에 1시간 30분씩 도합 3번을 실패하고 나서야 문제가 있군! 인식..;;;
내친김에 Mac Lion Server를 다시 한번 설치해보려고 했으나 App Store오류?로 설치 진행이 되지 않음…
결국 USB에 Mac Lion을 이미지 넣어 부팅하여 설치하려다… 문득 Time Machine Restore가 있는걸 발견…. 3시간 정도에 걸친 복구 진행…
훌라~ 완벽하게 돌아왔다…
신기한건 Open Directory 및 XGrid도 정상적으로 된다…

결국, 이번에도 기존 데이터를 새 서버로 옮기는 과정이 쉽지 않을 것이라는 두려움에 OS 업그레이드 실패…

덧붙임 : 문제는 XGrid가 더 이상은 진행되지 않는 프로젝트라는것… 왜 갑자기 이걸 써보고 싶어졌던거지… -_-;;;