M.S. Babaei

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • M.S. Babaei replied on the discussion topic Elgg refuses to work on nginx
    @Brett Thank you so much. You saved the day ;) view reply
  • M.S. Babaei has a new avatar
    M.S. Babaei
  • M.S. Babaei added a new discussion topic Elgg refuses to work on nginx in the group Elgg Technical Support
    Hi Folks, I've been trying to install Elgg on FreeBSD+nginx for a day now, without any success. During the installation process, it says: We think your server is running the Nginx web server. The rewrite rules test failed. You need to...
    • I have a working config, but for 1.9, so you'd need to add few missing rules. Have a look here: https://gist.github.com/Srokap/7dbfc423812f09a5ee43 and for thread with few other versions: https://github.com/Elgg/Elgg/issues/5929

    • Thanks @RvR & @Pawel Sroka, I´ve done a small progress, the rewriting seems to be working with this rule:

      rewrite ^/action/([\/A-Za-z0-9_-]+)$    /engine/handlers/action_handler.php?action=$1                   last;

      This is the log:

      2014/04/05 05:42:45 [notice] 27116#0: *27 rewritten data: "/engine/handlers/action_handler.php", args: "action=login", client: 212.170.174.236, server: ec2-54-72-103-90.eu-west-1.compute.amazonaws.com, request: "POST /action/login HTTP/1.1", host: "ec2-54-72-103-90.eu-west-1.compute.amazonaws.com", referrer: "http://ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/login"

      BUT

      When I try to login, it dont works, the button Log in does nothing. 

      If anyone would test it, this is the url http://ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/login

      Any suggestion??, I´m obsessed with this!!!

       

    • I reply myself, there was an issue with igbynary PHP module, is not working with Elgg:

      [06-Apr-2014 17:50:26 Australia/Brisbane] PHP WARNING: 2014-04-06 17:50:26 (EST): "igbinary_unserialize_header: unsupported version: 34865425, should be 1 or 2" in file /home/nginx/domains/ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/public/engine/lib/sessions.php (line 425)
      [06-Apr-2014 17:50:26 Australia/Brisbane] PHP WARNING: 2014-04-06 17:50:26 (EST): "session_start() [<a href='function.session-start'>function.session-start</a>]: Trying to destroy uninitialized session" in file /home/nginx/domains/ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/public/engine/lib/sessions.php (line 425)
       
      So I removed this module and use the standard PHP serializer. Thanks to @dramirez for his valuable help!!!
       
      This is my actual vhost configuration:
       

      #
      ## Nginx configuration for Elgg 1.8
      #

      server {
      listen 80;
      server_name myurl.com;
      charset utf8;

      error_log /mydirectory/log/error.log debug;

      root /mydirectory/public;
      index index.php;


      client_max_body_size 8M;
      client_body_buffer_size 256K;

      #rewrite_log on;

      try_files /maintenance.html $uri @rewrite;

      location @rewrite {

      # # Legacy URL rewriting (for use with the legacy URL plugin)
      # rewrite ^/pg/([A-Za-z0-9_-]+)$ /engine/handlers/page_handler.php?handler=$1 last;
      # rewrite ^/pg/([A-Za-z0-9_-]+)/(.*)$ /engine/handlers/page_handler.php?handler=$1&page=$2 last;
      # rewrite ^/tag/(.+)/?$ /engine/handlers/page_handler.php?handler=search&page=$1 last;

      # Fallback to the new router
      rewrite ^(.*)$ /index.php?__elgg_uri=$uri&$args last;
      }


      # rewrite ^/pg/([A-Za-z0-9_-]+)$ /engine/handlers/page_handler.php?handler=$1 last;
      # rewrite ^/pg/([A-Za-z0-9_-]+)/(.*)$ /engine/handlers/page_handler.php?handler=$1&page=$2 last;
      # rewrite ^/tag/(.+)/?$ /engine/handlers/page_handler.php?handler=search&page=$1 last;
      # rule for rewrite module test during install - can be removed after installation
      rewrite ^/rewrite.php$ /install.php last;
      # Routes to specific handlers
      rewrite ^/action/([\/A-Za-z0-9_-]+)$ /engine/handlers/action_handler.php?action=$1 last;
      rewrite ^/cache(.*)$ /engine/handlers/cache_handler.php?request=$1 last;
      rewrite ^/export/([A-Za-z]+)/([0-9]+)/?$ /engine/handlers/export_handlers.php?view=$1&guid=$2 last;
      rewrite ^/services/api/([A-Z-a-z0-9_-]+)/(.*)$ /engine/handlers/service_handler.php?handler=$1&request=$2 last;


      if (!-d $request_filename){
      set $rule_11 1$rule_11;
      }
      if (!-f $request_filename){
      set $rule_11 2$rule_11;
      }
      if ($rule_11 = "21"){
      rewrite ^/([A-Za-z0-9\_\-]+)$ /engine/handlers/page_handler.php?handler=$1;
      }
      if (!-d $request_filename){
      set $rule_12 1$rule_12;
      }
      if (!-f $request_filename){
      set $rule_12 2$rule_12;
      }
      if ($rule_12 = "21"){
      rewrite ^/([A-Za-z0-9\_\-]+)\/(.*)$ /engine/handlers/page_handler.php?handler=$1&page=$2;
      }

       


      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;

      }