We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30058
    • 8 Posts
    Hi, guys. i’m newbie to MODx (and greatly impressed by it by now). i like to move my current site to MODx, but have a question. Where should i put my current directories with js, flash, css, img and other resources? how to distinguish these ’external’ assets from MODx ones? should i use directory /assets for that?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can store them wherever you like; you’ll just have to make sure your links to them in your template and content are correct.

      Generally speaking, for organization, I use the /assets folders provided in a MODx installation. But MODx itself doesn’t care where you put these things.

      The Rich Text editor, which is itself not MODx but a third-party addon provided for convenience, is configured by default to expect files to be in assets/files, images to be in assets/images, and so forth. These expectations can actually be modified if you wish in the MODx Manager’s Configuration.
        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
        • 30058
        • 8 Posts
        i supposed that one can use whatever path he wishes, but i was asking for common practices. your reply is exactly what i expected to gain. Thanx a lot smiley
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I usually separate my images; those that are strictly for use in a template (background images, link and heading images and the like) go in assets/templates/mytemplate/images, while any images that are part of the content go in assets/images. That way I know which is what and keep things organized, plus it’s easier to re-use a template elsewhere if it’s all together.
            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
            • 30058
            • 8 Posts
            Thanks for advice. One more question if u don’t mind?
            Several times during installation and configuration of MODx i’ve had to set 777 for dirs and 666 for files (/core/components, /assets/components for example) for MODx to work properly. Isn’t it a security hole? How can i avoid this? (ubuntu lucid)
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Yeah, I don’t like that either. That’s why when using shared hosting I prefer a host that runs PHP with some kind of "suexec". The problem is that the PHP interpreter to process the .php file is run by the user that calls it (usually the user assigned to Apache). Since "you" own that file, it has to be set to world-writable for the Apache user to be able to write to it. With "suexec", it "Switches User" to "EXECute" the PHP interpreter to the owner of the file ("you"). This way you can have files set to 644 and directories 755 (others can open it and read it, but only the owner ("you") can write to it.

              There are several ways to do this; I believe Apache has a module to do this when PHP is an Apache module, or there are programs to do it when PHP is run as CGI or FastCGI (an independent PHP interpreter).

              On my own VPS, since it’s not a shared host it’s really not necessary. The only way anybody can access my stuff is if they are able to get their grubby paws on my account login, or a root login, in which case I’m sunk anyway. I don’t allow the other domains I’m hosting any file access at all; no FTP server running and they don’t get SFTP access.
                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
                • 30058
                • 8 Posts
                Excellent reply, thank you again smiley As for my environment, i don’t use that good old Indian... nginx + php5-fpm instead. And i’m also the only visitor on the server (ubuntu lucid) smiley I was just curious how other MODx users deal with such a frightening default permissions.

                May i continue with questions? As a newbie i’ve decided to "proof-concept" with the latest MODx. AFAIK, there’s no any suitable syntax highlighter (textarea ’nicificator’) for resource editor by now. How do u edit your html resources inside MODx?
                PS. Firefox addon "It’s all text!" is very nice, though i’d prefer some built-in way to solve the task.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I just installed the EditArea plugin, and so far it’s wonderful. I never paid much attention to it before, being quite content with plain text in a textarea or using It’s All Text if I need to do a search/replace or something, but now I wonder why I put up with it for so long...

                  I’ve been trying to stir up the energy to learn how to use nginx for some time now (Solaris server).

                  What about support for something like mod_suexec?

                  mod_suexec is a solution to a problem that Nginx does not have. When running servers such as Apache, each instance consumes a significant amount of RAM, so it becomes important to only have a monolithic instance that handles all one’s needs. With Nginx, the memory and CPU utilization is so low that running dozens of instances of it is not an issue.

                  A comparable Nginx setup to Apache + mod_suexec is to run a separate instance of Nginx as the CGI script user (i.e. the user that would have been specified as suexec user under Apache), and then proxy to that from the main Nginx instance.

                  Alternatively, PHP could simply be executed through FastCGI, which itself would be running under a CGI script user account. (Note that mod_php - the module suexec is normally utilized to defend against - does not exist with Nginx.)
                    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
                    • 30058
                    • 8 Posts
                    Wow! Then i dare to ask u: how did u achieve that? how did u install it? i’ve installed the transport (editarea-0.8-beta1.transport.zip). isn’t it enough? still have plain textarea field in the resource editor :-(
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Ah, you’re on Revo. I’m an old-fashioned granny, and am sticking to Evo. I’m afraid I’m of no help at all with Revo stuff.
                        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