We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10295
    • 6 Posts
    Hi guys,

    First of all compliments to all the developers of ModX for this beautiful framework!

    I have installed ModX and it all works fine except for when I want to insert the php-code when installing a module. On save I get the following error in FireFox:

    Method Not Implemented

    POST to /manager/index.php not supported.
    Apache/2.2.0 (Fedora) Server at Port 80


    And the 501/505 page in IE7

    The thing is that when I just fill in ’hello’ in the php-code-field I don’t get the error-page. So I figured something in the code is not accepted by my configuration (php version 5.1.6 and MySQL 5.0.27). I have set the rights of the files exactly as instructed in the ModX manual.

    Anyone ideas what can cause this and how to solve this problem?

    Thanks in advance!


      • 7231
      • 4,205 Posts
      THis could related to mod_security. Check out this post in the wiki about mod_security:
      http://wiki.modxcms.com/index.php/What_is_mod_security_and_how_does_it_affect_me
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 10295
        • 6 Posts
        Thanks dev_cw, that seems exactly the problem. I tried all the suggestions on the page, resulting in another 500 error. Found the following warnings in the server-log:

        [msg "Cross-site Scripting (XSS) Attack. Matched signature <<meta>"] [severity "CRITICAL"]
        [msg "SQL Injection Attack. Matched signature <varchar>"] [severity "CRITICAL"]
        [msg "System Command Injection. Matched signature <;\\r\\necho>"] [severity "CRITICAL"]

        /var/www/vhosts/mysite.nl/httpdocs/manager/.htaccess: Invalid command ’SecFilterEngine’, perhaps misspelled or defined by a module not included in the server configuration, referer: http://www.mysite.nl/manager/

        ModSecurity: Access denied with code 501 (phase 2). Pattern match
        [msg "System Command Injection. Matched signature <;\\r\\necho>"] [severity "CRITICAL"]


        Do I have to ask my webhost to change a server setting? Or is it something I can fix one way or another?
          • 27708 MODX Staff
          • 2,502 Posts
          In that wiki doc there are instructions on how to turn off mod_security:


          Open your .htaccess file(s) and add the following to it:

          SecFilterEngine On
          SecFilterSelective "REQUEST_URI" "/manager/index.php" "allow,nolog"



          If that doesn’t work, in the Wiki doc there are more steps to follow. smiley

          Cheers,

          Jay
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 10295
            • 6 Posts
            Thanks, but that’s what I said: ’I tried all the suggestions’...thus all the steps untill the end of the wiki-page. And I keep getting the 500 page, seems my host doesn’t allow me to make the suggested changes to the .htaccess file

            With the step-by-step testing I found that the words ’id’ and ’echo’ amongst others give problems. But overruling the filter with the code gives a 500-page...
              • 27708 MODX Staff
              • 2,502 Posts
              Sorry, in a hurry to help didn’t read carefully. sad

              Were you using an .htaccess file before? Were you using any php_flags? It is likely that your host has allow_override set to off so you should contact them to fix this.
                Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                • 10295
                • 6 Posts
                Thanks, no prob smiley I did use htaccess before to make friendly urls, that worked fine with this code:

                # The Friendly URLs part
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


                I didn’t use php_flags and when I use .htaccess to solve the POST problem I get the error. I will check it out with my host in the meantime. I’ll let you know if that was the problem.
                  • 10295
                  • 6 Posts
                  Ok, it was my webhost configuration. It blocked posting certain php code to another php file to precent injection. They changed permissions for a few pages now.

                  Thanks for giving me the above suggestions,