We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    Sean Kimball Reply #1, 14 years ago
    I just did a google search for something & saw one of my sites modx error logs come up in the search results!

    checked a few more sites and the same thing, checked more sites from the mods site gallery ... again - the same thing!

    I can browse to anysite.com/core/cache/logs/error.log and view that sites error log!!!

    How can we prevent this? Logs should not be world readable.
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      I imagine this is precisely why there's an extensive section in the docs dedicated to hardening MODX with an advanced installation, and moving the core above the root.

      Which is something I've never bothered with, I'm sure like many others. Makes you think, eh?
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You definitely should have a robots.txt file, denying everything in the core, assets, connectors and manager folders. That will at least keep it out of the search engine results.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 11055 ☆ A M B ☆
          • 3,112 Posts
          use .htaccess

          btw, I prefer to use Advanced installation, where I can move the core folder out of the web root.
          Since then, the world is not only unable to see the error log, but the whole component's files.
            Rico
            Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
            MODx is great, but knowing how to use it well makes it perfect!

            www.virtudraft.com

            Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

            Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

            Maintainter/contributor of Babel

            Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
            • 26503
            • 620 Posts
            Sean Kimball Reply #5, 14 years ago
            Quote from: goldsky at Oct 09, 2012, 02:33 AM
            use .htaccess

            btw, I prefer to use Advanced installation, where I can move the core folder out of the web root.
            Since then, the world is not only unable to see the error log, but the whole component's files.

            what did you do in an .htaccess? a rewrite/redirect?
              *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

              Sean Kimball CLP, CLS.
              Technical Director / Sr. Developer | BigBlock Studios
              ._______________________________________________.
              Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
              27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
              phone/fax: 905-426-5525
              • 22303 MODX Staff
              • 10,725 Posts
              You can easily rename the ht.access in the core folder, which prevents direct access via the web server to any file in that location.
                • 26503
                • 620 Posts
                Sean Kimball Reply #7, 14 years ago
                never noticed this file before... why wouldn't it be enabled by default? Seems to make more sense at first look.
                  *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

                  Sean Kimball CLP, CLS.
                  Technical Director / Sr. Developer | BigBlock Studios
                  ._______________________________________________.
                  Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
                  27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
                  phone/fax: 905-426-5525
                  • 11055 ☆ A M B ☆
                  • 3,112 Posts
                  http://www.htaccess-guide.com/
                  is a good start to learn .htaccess.
                  there is also .htpasswd.

                  just google them.
                  you'll see.

                  btw, it's for Apache server.
                  IIS does different way. [ed. note: goldsky last edited this post 14 years ago.]
                    Rico
                    Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                    MODx is great, but knowing how to use it well makes it perfect!

                    www.virtudraft.com

                    Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                    Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                    Maintainter/contributor of Babel

                    Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: sean69 at Oct 09, 2012, 10:53 AM
                    never noticed this file before... why wouldn't it be enabled by default? Seems to make more sense at first look.
                    Same reason none of the included ht.access files are enabled by default. We don't want upgrades overwriting any customizations folks have made in those files. If we included them as .htaccess in the distributions, those local changes would be lost on every upgrade.

                    At some point, I would love to have a process that automatically updated these as a step during setup, where possible, though I imagine having your .htaccess files writable by your PHP process is generally not a good idea. That is something we need to consider when adding such a feature.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      More and more hosts are using alternative webservers such as nginx (<cough> MODx Cloud <cough>), so default .htaccess files wouldn't be of much use there anyway.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org