We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22548
    • 58 Posts
    Hello to all folks around,

    I have successfully installed Revo (that was a breeze, I always thought it would be way above my head...), and now I tried to grasp this context thing also.

    So I created a new context (’sub1’) for a subdomain (’sub.domain.com’), attached new values for site_start, base_url, http_host and site_url to it, created a new document in this context and published it.

    As I am on shared hosting here and therefore do not have access to Apache server files, I tried to use the One Gateway Plugin, as I read somewhere in the forum that this works for subdomains as well and it would not required to touch the http.conf in this case. I created the new plugin with the code at the documentation, changed the two cases to match my subdomain, gave the plugin a name (’gateway’), and checked the OnHandleRequest event.

    On the part of my provider, I added a new CNAME alias for the subdomain with a value ’@’.

    When I try to enter the subdomain in my browser now, I am getting a
    Forbidden. You don’t have permission to access / on this server.
    error message from Apache, only, however.

    Does anybody know if things can work this way at all, or if these sorts of things can’t be done on shared hosting anyway? Or did I confuse the two methods and just need to undo some things? Please help if possible.

    My specs are:
    MySQL 5.0.91
    PHP 5.2.8
    Server API CGI/FastCGI
    Linux

    Greetings, Alex
      • 25979
      • 178 Posts
      Hi, can you create a subdomain in your hosting account?
      Have you copied necessary files to your subdomain folder?
      Have you made new context active for this subdomain?

      Regards,

      Mike
        //Why use windows since there is a door?//
        • 22548
        • 58 Posts
        Hi Mike,

        thank you for your feedback!

        If that is where I messed up, there is hope. Great news!

        can you create a subdomain in your hosting account?
        I can create a new A record pointing to my domain IP, to live in a subfolder of my domain folder in the hosting environment. That was actually what I tried first, but I did not succeed with that. I had created the A record with the name of the subdomain, and followed the instructions to set up a multi-domain environment from the tutorial at http://www.h-quadrat.com/techblog/111-modx-revolution-multi-domain-context-installation-english.php (with an altered index.php at root).

        As that did not work for me, I went for the OneGateway solution with a regular index file, the plugin for switching contexts when the subdomain is called, and a CNAMES alias instead of an A record for my subdomain, as I thought that I would not need a separate folder for the subdomain with Revolution anyway. That was about all I did, actually, and I may miss the most important part here, as I never created a subdomain before (no pro at all sad).

        Have you made new context active for this subdomain?
        I made the context active for the subdomain by adding the value sub.mydomain.com to the key http_host in the context for my subdomain, in which the document for the subdomain lives.

        Hope this is not too mixed and you can help!

        Best greetings,
        Alex
          • 25979
          • 178 Posts
          1. - I know you added your subdoomain entry into DNS - believe it looks like this:
          subdomain A  IP_ADDRESS 
          , where subdomain is your desired name of subdomain; A - is type of entry, and IP_ADDRESS is the IP of your server. Is that correct?

          2. Did you add subdomain to your server configuration? Apache needs to know where files to the subdomain are, isn’t it?

          3. Check whether it works or not by simply pointing your web browser to subdomain.domain.tld address.

          4. If it works, then we can deal with Revolution configuration if not it is server configuration issue in the very first place.

          If you need more help with server configuration PM me.

          Regards,

          Mike
            //Why use windows since there is a door?//
            • 22548
            • 58 Posts
            Hi Mike, I have sent you a PM.

            I had tried (1) as you described, but it did not work. I do not have access to the Apache server, which is why I went for the plugin solution. Guess it just does not work this way.

            Thanks for your feedback and help.
            Alex
              • 25979
              • 178 Posts
              Plugin alone wouldn’t work. Apache needs to know how to serve the address.

              Regards,

              Mike
                //Why use windows since there is a door?//
                • 22548
                • 58 Posts
                It wooooorks!!!! grin

                Triple star for salik! kiss

                I had messed up creating the subdomain with my hoster in the first place, so my problem had nothing to do with MODx at all.

                To anybody as new to it as me:

                First - point the subdomain to live in your main domain folder (do not create a separate folder, as you want the single MODx install to do the magic)

                Then - follow the instructions for setting up a context and the plugin and: wait. It can take a couple of hours until the subdomain is available in the browser.

                That’s it. Works in shared hosting and couldn’t be easier.

                Alex