litespeed not working the next day, awstats errors

aww

Well-Known Member
#1
Well after a successful test of litespeed yesterday evening onto my cpanel server (running on alternate port 1080) I came back this morning to discover that our external cpanel based awstats was giving errors on all domains (can't open server log permission denied)

so I figured maybe litespeed had changed the permissions somehow on the logs and went to disable lightspeed

strange thing is, it wasn't running anymore

I also cannot restart it from the command line, it says its stopped and started with a new pid, but I can't get to the control panel and I cannot access any page through :1080
(firewall ports are open)

So where do I even begin to try to fix this?
 

aww

Well-Known Member
#2
I believe I have traced part of the problem in that the moment litespeed is started, it changes the ownership of all the domlogs to nobody.nobody - which messes up everything as it's supposed to be root.username

But unfortunately, even after I stop lshttpd, and change the chown, awstats still gets permission denied.

Also I need to know how to remove lshttp from automatically starting upon server reboot? Until I can get to stop changing the domlog ownership, it can't be allowed to run
 

mistwang

LiteSpeed Staff
#3
Please check the permission/ownership of /usr/local/apache/domlogs directory, maybe that is causing the permission problem.
The ownership of the log file probably is not that important as long as it has been set to be world readable.

To remove lshttpd rc script, just run "lsws/admin/misc/rc-uninst.sh"
 

aww

Well-Known Member
#4
Ah, you posted just as I figured it out.

chmod 711 domlogs

will fix it

I'd rather not uninstall litespeed but learn how to fix it instead?

Could you help me figure out why even when it runs I can no longer access the http port 1080 or the control panel 7080 ?
 

mistwang

LiteSpeed Staff
#5
Please check if the port is in use with command "netstat -an | grep <port>", It lists at least one listening port.

And you can turn on debug logging by changing "debugLevel" to 10 in lsws/conf/httpd_config.xml, it will give more detail log in lsws/logs/error.log. You should be able to find some clues there. :)
 

aww

Well-Known Member
#6
Okay found the answer myself again by digging around :)

http://litespeedtech.com/docs/webserver/troubleshoot/

remove the /tmp/lshttpd directory if it exists already

did just that, restarted it and bingo, everything is back

Still wondering what caused it all to fail in the first place.
If it doesn't happen again tonight, I won't worry.

Some thoughts - can I setup an alias of some kind for the service command to start/stop lshttpd?

ie.
service lshttpd start

I kinda got spoiled with that on apache.
Also would be nice if you added lswsctrl status
 

mistwang

LiteSpeed Staff
#7
Looks like that's a permission problem for /tmp/lshttpd directory. Have you reinstall LSWS under another user account?

Yes, the service command is available if the rc script has been installed.

Code:
service lsws start
 

aww

Well-Known Member
#8
No lsws was installed as root.

But I did use the cpanel security script to secure tmp
that might affect it?
/scripts/securetmp
Would you like to secure /tmp & /var/tmp at boot time? (y/n) y
Would you like to secure /tmp & /var/tmp now? (y/n) y
Securing /tmp & /var/tmp
oooh! service lsws start

I just didn't know what service name to call it. I figured it was lshttpd!

many thanks for your help...

my next challenge is somehow installing eacellerator at my more modest user knowledge level (used a 3rd party script for cpanel/apache)
 

aww

Well-Known Member
#9
By the way, the attributes reset again tonight.

I had to do this to get awstats to run again without error:

chmod -R 644 /usr/local/apache/domlogs
chmod 711 /usr/local/apache/domlogs

I hope I don't have to do that every night.

Either cpanel is changing the attributes or lsws is.

Any ideas where to look?
 

mistwang

LiteSpeed Staff
#10
cPanel does.
What is permission mask and owner of domlogs that cPanel changes it to?

We will change the owner of individual log files to nobody:username in next release, hope it will help.
 

aww

Well-Known Member
#12
Please forgive the dumb question but do I just run the regular install process
with the above file and install it right over my existing install?
My lsws control panel settings will remain?

Will I have to re-run the phpa script install afterwards as well or does that remain untouched?

I am very impressed how quickly improvements are made!
 
Last edited:

aww

Well-Known Member
#14
Sigh, I have a bigger problem now.

I just discovered I am somehow losing log data.

There is virtually no traffic data in the current log, just a little leftover from yesterday and then for the start of today.

Is there some process or setting that is truncating the logs?

Oh wait, does the access.log rotation size also control the individual domlogs rotation size? Because I guess if that defaults to 10M then it might have deleted all the domlogs when it hit that point?

From the timestamp I can tell all the logs in the domlogs folder were reset at 10:23pm. Very strange.
 
Last edited:

mistwang

LiteSpeed Staff
#15
LSWS will rotate the access log for apache vhost when the size reaches 2000MB to avoid server crashes. LSWS does not delete old log file when rotate it.

We are investigating a problem related to access logging.
 

aww

Well-Known Member
#16
Okay I think I have it figured out now.

I may have been accidentally destroying my own logs by trying to force awstats to run with the chmod changes.

As soon as I did that and started awstats, litespeed would try to keep writing the logs, changing their permissions to "nobody:nobody" As soon as that happened, the logs get reset and truncated to 0, starting over again.

The 3.1.1 upgrade does indeed correct the permissions but unfortunately I have lost 2-3 days worth of domlogs on a high activity site :(

So far so good though, the logs seem to be "sticking" and awstats does not complain any further.
 
#17
Is anyone still having this issue? I keep getting this on one of our servers using litespeed every day, and have to re-run those permission changes listed on the first page, but I keep loosing stats for the time period that it is messed up.

Got any ideas?
 

aww

Well-Known Member
#18
Rodney, once we upgraded to litespeed 3.1.1 (3.1.2 is also in testing now) the log problem went away as it will then write with the proper nobody:username owners/permissions.
 

hichew

Active Member
#19
is there a way to turn off the domlogs in litespeed?
i have a very busy site.. it can generate 4-5 files (2 gig of logs for each file) every week.
and sometime it make the site slow.
 

mistwang

LiteSpeed Staff
#20
Access logging can be turned off internally with vhosts configured via our web console, it cannot be turned off when LSWS read apache configuration.
You can remove the log file with a cron job.
 
Top