You are not logged in.

#1 2010-06-01 17:05:02

jernej
Member
Registered: 2008-10-22
Posts: 11

Lighttpd + php + mysql not working after upgrade

Hello!
I have been using Arch for a couple of years now and I love it. However, recently I made an upgrade (pacman -Syu) on one web server and I can't get the lighttpd server back to working state. If I start it with "/etc/rc.d/lighttpd start" it looks like everything is ok. Even "/etc/rc.d/lighttpd status" returns that it is [STARTED] , but when I try to stop it, it returns FAIL. I assume that something is preventing the lighttpd to start, but there is nothing in the lighttpd log, neither in error.log. I have also tried to reinstall all the packages, but with no difference.I have to fix it, but I don't know where to start. Thank you for any hints you may provide.

Best regards!

Jernej

Offline

#2 2010-06-01 18:04:47

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Lighttpd + php + mysql not working after upgrade

here's how i debug daemons:

1. take a look at /etc/rc.d/<daemon> directly in some text editor
2. work out what executable it uses under the start case 
3. man or --help that executable and try to find the --debug or --verbose flag*
4. try that command (as root) directly from the commandline
5. profit

*also note if there's any --nodaemon or --foreground flag you could use while testing (useful for mpd)

Offline

#3 2010-06-01 18:59:36

jernej
Member
Registered: 2008-10-22
Posts: 11

Re: Lighttpd + php + mysql not working after upgrade

Here's the content of /etc/rc.d/lighttpd I'm not that smart to figure out the name of the executable.



=====================================

#!/bin/bash

daemon_name=lighttpd

. /etc/rc.conf
. /etc/rc.d/functions

get_pid() {
        pidof -o %PPID $daemon_name
}

case "$1" in
  start)
    stat_busy "Starting $daemon_name daemon"

    PID=$(get_pid)
    if [ -z "$PID" ]; then
      [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
      # RUN
      $daemon_name -f /etc/lighttpd/lighttpd.conf
      #
      if [ $? -gt 0 ]; then
        stat_fail
        exit 1
      else
        echo $(get_pid) > /var/run/$daemon_name.pid
        add_daemon $daemon_name
        stat_done
      fi
    else
      stat_fail
      exit 1
    fi
    ;;
  stop)
    stat_busy "Stopping $daemon_name daemon"
    PID=$(get_pid)
    # KILL
    [ ! -z "$PID" ] && kill $PID &> /dev/null
    #
    if [ $? -gt 0 ]; then
      stat_fail
      exit 1
    else
      rm -f /var/run/$daemon_name.pid &> /dev/null
      rm_daemon $daemon_name
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 3
    $0 start
    ;;

  status)
    stat_busy "Checking $daemon_name status";
    ck_status $daemon_name
    ;;

  *)
    echo "usage: $0 {start|stop|restart|status}"
esac

exit 0


=====================================

Offline

#4 2010-06-01 19:10:22

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Lighttpd + php + mysql not working after upgrade

please use [ code ] tags smile

# snip

daemon_name=lighttpd

# snip

case "$1" in
  start)
    stat_busy "Starting $daemon_name daemon"

# snip

# RUN
      $daemon_name -f /etc/lighttpd/lighttpd.conf

# snip

so, step 3...

Last edited by brisbin33 (2010-06-01 19:11:02)

Offline

#5 2010-06-01 19:29:38

jernej
Member
Registered: 2008-10-22
Posts: 11

Re: Lighttpd + php + mysql not working after upgrade

Thank you Brisbin! I'm moving forward smile I found out that the server.username and server.groupname in lighttpd.conf was set to "http", but my installation was using "lighttpd" user (and all the web files were owned by that user). So I changed it to "lighttpd" and restarted the server and voila - It works. Almost smile It can serve the static content, but as soon as I try to run a php scipt I get the 403 - Forbidden. I doublechecked folder and file permissions (of the script). So I assume php is running with the wrong user now? Where to set that?
Thank you for help!
j.

Offline

#6 2010-06-01 19:41:46

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Lighttpd + php + mysql not working after upgrade

if i had to guess, you've got something else incorrect either with file/folder perms (i know you checked but...) or in lighthttpd.conf.  the only other place is /etc/php/php.ini, but i just skimmed mine and didn't see anything about what user to run as.  i use apache and it seems php inherits its user from the webserver running it.

Offline

#7 2010-06-01 19:56:44

jernej
Member
Registered: 2008-10-22
Posts: 11

Re: Lighttpd + php + mysql not working after upgrade

I guess you are right again. I probably messed up my configuration when trying to reinstall php fcgi... will have to dig some more.
If anyone has something to add I would appreciate it. Will post the solution when I resolve the error. Thanks again Brisbin!

Offline

#8 2010-06-01 22:13:08

jernej
Member
Registered: 2008-10-22
Posts: 11

Re: Lighttpd + php + mysql not working after upgrade

I made a system upgrade again and got to this:

[root@Archlinux pacman.d]# pacman -S fcgi php eaccelerator
Illegal instruction
[root@Archlinux pacman.d]# pacman -S fcgi php eaccelerator
Illegal instruction
[root@Archlinux pacman.d]# pacman -Sy
Illegal instruction
[root@Archlinux pacman.d]# reboot 
Illegal instruction
[root@Archlinux pacman.d]# shutdown -r now
Illegal instruction

I called my brother on the remote site, to reset the server, but now I can't reach it with ssh. I'll drive there tomorrow.

Last edited by jernej (2010-06-01 22:13:38)

Offline

Board footer

Powered by FluxBB