Perfect server Ubuntu+nginx+wordpress upstream not working

Discussion in 'Installation/Configuration' started by lulolulito, Feb 3, 2012.

  1. lulolulito

    lulolulito New Member

    Hi guys, noob here, I followed The perfect setup ubuntu+nginx and everything worked fine. the setup is complete and working. thanx!

    I create a site and uploaded wordpress to it, but when I go to start the setup of wordpress i get this error:

    ERROR 502 - Bad Gateway!

    The following error occurred:

    This server received an invalid response from an upstream server it accessed to fulfill the request.


    I need to know what steps to follow configuring wordpress on it.
    all help is appreciated

    thank you
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please restart the php-fpm daemon. The 502 error is caused by a bug in the ubuntu php-fpm package which fails to reload the configuration. It has already been fixed in debian upstram as far as i know.
  3. lulolulito

    lulolulito New Member

    thank you for answering

    I did, service php-fpm restart, i rebooted the server but same thing.

    when I created the site it works fine, but as soon as I upload wordpress I get error 502

    do i need to do any special configuration to run wordpress?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Are thw wordpress files you uploaded all owned by the web user and client group of this website?
  5. lulolulito

    lulolulito New Member

    yes I created an ftp user for that site, used it to upload the files
  6. lulolulito

    lulolulito New Member

    the service name i have is php5-fpm

    I restarted it with this command:

    sudo service php5-fpm restart

    [email protected]:/home/administrator# sudo service php5-fpm restart
    * Restarting PHP5 FastCGI Process Manager php5-fpm [ OK ]
  7. lulolulito

    lulolulito New Member

    What is the best distribution to use to install "the perfect server with nginx" ?

    I followed the one with ubuntu 11.10 to the letter and it doesn't work for wordpress.

    now i am getting erro 500.

    If i create a new site it works fine, upload a script like wordpress i get error 502 gateway error, restart php-fpm and then i get error 500-internal server error.
    There has to be something wrong with nginx and wordpress php code

    any suggestions would help

  8. falko

    falko Super Moderator ISPConfig Developer

    The php5-fpm init script is buggy:

    The do_stop and do_reload functions in /etc/init.d/php5-fpm must look as follows:

    # Function that stops the daemon/service
            # Return
            #   0 if daemon has been stopped
            #   1 if daemon was already stopped
            #   2 if daemon could not be stopped
            #   other if a failure occurred
            start-stop-daemon --stop --quiet [B][COLOR="Red"]--retry=QUIT/$TIMEOUT/TERM/5/KILL/5[/COLOR][/B] --pidfile $PIDFILE --name $NAME
            [ "$RETVAL" = 2 ] && return 2
            # Wait for children to finish too if this is a daemon that forks
            # and if the daemon is only ever run from this initscript.
            # If the above conditions are not satisfied then add some other code
            # that waits for the process to drop all resources that could be
            # needed by services started subsequently.  A last resort is to
            # sleep for some time.
            start-stop-daemon --stop --quiet --oknodo --retry=0/30/TERM/5/KILL/5 --exec $DAEMON
            [ "$?" = 2 ] && return 2
            # Many daemons don't delete their pidfiles when they exit.
            rm -f $PIDFILE
            return "$RETVAL"
    # Function that sends a SIGHUP to the daemon/service
    do_reload() {
            # If the daemon can reload its configuration without
            # restarting (for example, when it is sent a SIGHUP),
            # then implement that here.
            start-stop-daemon --stop --signal [B][COLOR="Red"]USR2[/COLOR][/B] --quiet --pidfile $PIDFILE --name $NAME
            return 0

Share This Page