enabling awstats causes crash upon restart

jrmarino

Well-Known Member
#1
I have litespeed 3.10 on two servers, both identical hardware with Solaris 10. Awstats works fine on the first one.

On the second one, enabling awstats for the only virtual host for the port 80 listener causes litespeed to immediately crash upon restart. The only way to recover is to edit the virtual host XML configuration file by setting <updateMode>0</updateMode> for awstats.

here is the configuration:
Code:
Update Mode             Dynamic
Working Directory       /export/home/syn/awstats
AWStats URI             /access/
Site Domain             shepard.synsport.net
Site Aliases            REGEX[.\(synsport\.com|synsports\.com|synsport\.net)$]
Update Interval         Hourly
Update Offset (secs)    0
Secured Connection      No
Authentication Realm    Not Set
Removing the REGEX did not change anything.
I added the directory "access" to the document root (I didn't think it was required) but it didn't change anything.

the directory "/export/home/syn/awstats" is next to the document root which is "/export/home/syn/www" and it is 777 with same user/group as the document root.

I don't think I have misconfigured this. Even if I did, Litespeed should not hard crash right?
 

mistwang

LiteSpeed Staff
#2
Do you have the core file in /tmp/lshttpd? Please exam it with GDB, post the result of "bt" command.
What is the name of that vhost?
Thanks.
 
Last edited:

jrmarino

Well-Known Member
#3
EDITED:

Sorry, there is no core dump in the /tmp/lshttpd/ directory.

vhost name is maverick and this is not the same server you examined before.
 
Last edited:

mistwang

LiteSpeed Staff
#4
Did the data and conf directory got created under /export/home/syn/awstats? If yes, please list all files under those directories. Did awstats.maverick.conf get created?
Can you do something like truss or ktrace, which ever is available. like
Code:
truss ./lshttpd -n
"-n" tell lshttpd not to daemonize.
 

jrmarino

Well-Known Member
#5
Before checking, I upgraded to 3.1.1.

Nothing changed, litespeed still crashes.

There are no files at all under /export/home/syn/awstats

truss has a man page, but I don't launch LS in this manner, I use Solaris' SMF utility. Additionally this is a production server, so I can't just take down the webserver repeatedly to test this.
 

mistwang

LiteSpeed Staff
#6
Please look into "coreadm" command to let solaris dump core file for setuid process, with a core file, we can easily identify and fix the problem.
 

jrmarino

Well-Known Member
#7
ok, by using coreadm and changing some settings, then repeating the attempt to start litespeed, I now have a core file (5909274 bytes) in the /tmp/lshttpd directory.

What do I do with it? Send it to you?
 

jrmarino

Well-Known Member
#9
I had to install GDB first -- required a few upgrades.

Code:
#0  0xfedd4c7c in strlen () from /lib/libc.so.1
#1  0xfee2a296 in _ndoprnt () from /lib/libc.so.1
#2  0xfee2d3cb in vsnprintf () from /lib/libc.so.1
#3  0x080d5842 in log4cxx::PatternLayout::format (this=0x8289c20, pEvent=0x80413d4, args=0x8043464 "")
    at /home/gwang/crossrel/release/httpd/httpd/log4cxx/patternlayout.cpp:96
#4  0x080d4113 in log4cxx::Appender::append (this=0x82b6920, pEvent=0x80413d4, args=0x8043464 "")
    at /home/gwang/crossrel/release/httpd/httpd/log4cxx/appender.cpp:54
#5  0x080d4682 in log4cxx::Logger::vlog (this=0x8264090, level=3000, 
    format=0x81a35a0 "[%s] AWStats working directory: %s is not inside virtual host root: %s%s, AWStats integration is disabled.", args=0x8043464 "")
    at /home/gwang/crossrel/release/httpd/httpd/log4cxx/logger.cpp:79
#6  0x080d4ad3 in log4cxx::Logger::verror (this=0x8264090, 
    format=0x81a35a0 "[%s] AWStats working directory: %s is not inside virtual host root: %s%s, AWStats integration is disabled.", args=0x8043464 "")
    at /home/gwang/crossrel/release/httpd/httpd/log4cxx/logger.h:122
#7  0x080875be in HttpLog::error (
    fmt=0x81a35a0 "[%s] AWStats working directory: %s is not inside virtual host root: %s%s, AWStats integration is disabled.") at /home/gwang/crossrel/release/httpd/httpd/http/httplog.cpp:239
#8  0x08056408 in HttpServerBuilder::initAwstats (this=0x8290bf8, pVHost=0x82aad08, pNode=0x82a4090)
    at /home/gwang/crossrel/release/httpd/httpd/main/httpserverbuilder.cpp:2129
#9  0x08056d6b in HttpServerBuilder::configVhost (this=0x8290bf8, pVHost=0x82aad08, 
    pVhConfNode=0x82a4090) at /home/gwang/crossrel/release/httpd/httpd/main/httpserverbuilder.cpp:2289
#10 0x08057596 in HttpServerBuilder::configVHost (this=0x8290bf8, pNode=0x82bf740, 
    pName=0x82bd8d4 "maverick", pDomain=0x82bd8d4 "maverick", pAliases=0x81a1f80 "", 
    pVhRoot=0x82bc6ac "/export/home/syn/www_maverick", pConfigNode=0x82a4090)
    at /home/gwang/crossrel/release/httpd/httpd/main/httpserverbuilder.cpp:2437
#11 0x0805782f in HttpServerBuilder::configVHost (this=0x8290bf8, pNode=0x82bf740)
    at /home/gwang/crossrel/release/httpd/httpd/main/httpserverbuilder.cpp:2490
#12 0x08057931 in HttpServerBuilder::initVHosts (this=0x8290bf8, pRoot=0x828c6e8)
    at /home/gwang/crossrel/release/httpd/httpd/main/httpserverbuilder.cpp:2517
#13 0x0805d7de in HttpServerBuilder::configServer (this=0x8290bf8, reconfig=0)
    at /home/gwang/crossrel/release/httpd/httpd/main/httpserverbuilder.cpp:4381
#14 0x0805dc9f in HttpServerBuilder::initServer (this=0x8290bf8, reconfig=0)
    at /home/gwang/crossrel/release/httpd/httpd/main/httpserverbuilder.cpp:4484
#15 0x0804df74 in LshttpdMain::config (this=0x8289940)
    at /home/gwang/crossrel/release/httpd/httpd/main/lshttpdmain.cpp:838
#16 0x0804e52d in LshttpdMain::init (this=0x8289940, argc=1, argv=0x8047e00)
    at /home/gwang/crossrel/release/httpd/httpd/main/lshttpdmain.cpp:1080
#17 0x0804e739 in LshttpdMain::main (this=0x8289940, argc=1, argv=0x8047e00)
    at /home/gwang/crossrel/release/httpd/httpd/main/lshttpdmain.cpp:1149
#18 0x0804be52 in main (argc=1, argv=0x8047e00)
    at /home/gwang/crossrel/release/httpd/httpd/main.cpp:108
My guess from looking at this is that litespeed REQUIRES that the awstats working directory be inside the virtual directory. It may not be obvious from the configuration I provided earlier, but /export/home/syn/awstats is not in the document root of the virtual host. If this really is the problem:

1) Should it really be a limitation?
2) Should it cause a core dump if configured that way?
3) Can't litespeed warn if you it's misconfigured?
 

mistwang

LiteSpeed Staff
#10
A NULL pointer has been referenced when dumping the error message. Fixed.
The requirement is for security reason, since this awstats update is initiated as "root" user, (changed user id later).

Document root for a vhost can be same as virtual host or a sub directory under vhost root. Right now, you probably set vhost root and document root to the same directory. If you change virtual host root to "/export/home/syn", it will work.

Validation should be added in the admin console.
 
Top