Announcement

Collapse
No announcement yet.

Server alias for secondary domain

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Server alias for secondary domain

    Hey everyone,

    for a WordPress-Multisite installation I usually create pointer domains as "Server Alias". I can do this via Siteworx or I can edit the vhost-primarydomain.conf file and add the ServerAlias.

    But this won't work, if the customer wants to use E-Mail on those domains (Pointer domains can't be configured).

    So I would have to set up the domain as a secondary domain. But how do I do the Server alias thing? Because now there is a vhost-secondarydomain.conf file for the secondary domain and editing the vhost file of the primary domain would be ignored.

    Any ideas?

    Cheers,

    Michael

  • #2
    Hi Michael

    I hope your well and business is good

    I would think of 2 ways quickly

    Either a rewrite rule or a redirect scrip

    Both should do what you want I think

    Many thanks

    John

    Comment


    • #3
      Hi John,

      all is well, thanks. And you too, I hope?

      A redirect can't work, as the domain mapping within Wordpress Multisite is done via redirect and this would create a loop.
      Afaik only a ServerAlias works.

      Comment


      • #4
        Hi Michael
        Many thanks, yes good thank you, I have 2 grandschildren stopping until the weekend. Makes you feel old...
        I read your update yesterday, and was wondering of the following may help
        I hope it helps and sorry of you have already seen or tried it
        Many thanks
        John
        https://wpengine.com/support/multisi...add-new-sites/
        https://wordpress.org/plugins/wordpr.../installation/
        http://ottopress.com/2010/wordpress-...ping-tutorial/

        Comment


        • #5
          I was about to post a thread about this. I've been trying to get domain mapping for WPMU working for a week now with Interworx with no luck. If I add a domain to the account, it gives it its own public folder rather than pointing to the account's original vhost. Neither domain addon/pointer/whatever option will work by default afaik. So... The answer would seem to be to create a secondary domain and then modify the vhost to point to the domain's WP root. I haven't tried this yet but if anyone can think of anything better, please let me know. I was hoping I could just add the domain and WP would take care of the rest but that's not the case with Interworx. I'm really hoping to avoid having 100 WP installs but I'm not sure I'll be able to avoid it in any practical way. I don't like the idea of having to alter apache's conf to circumvent an Interworx feature's config.
          Last edited by Synthetisoft; 08-04-2016, 04:44 PM.

          Comment


          • #6
            I'd like to post a related feature request but I don't seem to have permission to post in that section under siteworx. Feature would be something like "Ability To Add Secondary Domain Using Custom Path For public_html/VHost Config"

            Comment


            • #7
              Hi Synthetisoft,

              don't add the domain as subdomain, add it as a pointer domain and choose "Server Alias" in the options there and let it point to the domain where you installed your WP. Then use this Domain mapppig plugin https://wordpress.org/plugins/wordpr...omain-mapping/ and set it up according to their installation notes.

              It works very well, all I want is NOT to use the Pointer domain/Server alias mechanism for completely different reasons. But it sounds as if this is what you are looking for.

              Hope that helps

              Michael

              Comment


              • #8
                Originally posted by mdeinhardt View Post
                Hi Synthetisoft,

                don't add the domain as subdomain, add it as a pointer domain and choose "Server Alias" in the options there and let it point to the domain where you installed your WP. Then use this Domain mapppig plugin https://wordpress.org/plugins/wordpr...omain-mapping/ and set it up according to their installation notes.

                It works very well, all I want is NOT to use the Pointer domain/Server alias mechanism for completely different reasons. But it sounds as if this is what you are looking for.

                Hope that helps

                Michael
                With that setup you're not able to create emails and such? Is that what your problem is? Also, I will need to be using Let's Encrypt for all the domains. Hoping that's possible.

                Comment


                • #9
                  Hi synthetisoft

                  Feature has been closed, so no one can post on them

                  You now need to post your feature on the ideas webpage, where it is voted on (interworx.com/ideas)

                  I do not think I can help much here as we do not use wp and do not have spare domain names to test

                  Many thanks

                  John

                  Comment


                  • #10
                    Hi Michael and synthetisoft

                    As a small workaround, which should work I think but not ideal sorry

                    Create a new siteworx account called mail.mydomain.url, then edit the DNS and change mx record so it only shows mail.mydomain.url

                    The webmail would then be on mail.mydomain.url/webmail

                    The actual domain would be server alias on the wpmu domain (mydomain.url alias mywpmu.url

                    I think this may work whilst it is been discussed

                    Many thanks

                    John

                    Comment


                    • #11
                      Playing off John's idea, I think you could create a siteworx account for the other domain.

                      Example:
                      Site1.com
                      * The main SiteWorx accounting hosting wordpress
                      * DNS points site1.com to IP 1.1.1.1

                      Site2.com
                      * The additional wordpress account
                      * No SiteWorx account setup
                      * DNS points site2.com to IP 1.1.1.1 and VHOST server alias from site1.com accepts this website and then wordpress does its thing


                      Now you create a SiteWorx account for site2.com, just as if it was its own website.

                      Then you can either delete the site2 vhost file from "/etc/httpd/conf.d" or just make sure that site1.com's vhost loads first by renaming it from vhost_site1.com.conf to vhost_000_site1.com.conf.
                      I'm not 100% sure this will work, but figure it's worth a try...even if it is a bit hacky.
                      Last edited by Justec; 08-05-2016, 08:42 PM.
                      [ JUSTIN ]
                      [ OFF unit ]
                      [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
                      ]

                      Comment


                      • #12
                        Server alias for secondary domain

                        Hi Justin, Michael and synthetisoft
                        I hope your well
                        I was thinking about this, and as I statd, I do not use WPMU, but are we overthinking this if all that is been asked is for email on a server alias name... also, cpanel require the domain used to be a parked domain, so I do not think cpanel would give email facilities to a parked domain.
                        My thought now is, just manually create the email account(s) required, and for webmail, use server domain.
                        Obviously, you would not see a siteworx account for server alias, but you would have access to webmail, pop, imap and smtp, and the MX DNS woudl be correct as it points to your server.
                        you would need to SSH into server, and run the following, replacing domain.url with correct domaina and replace password with your new strong password.
                        This would create a postmaster@domain.url, then you manually create new email addresses required.
                        /home/vpopmail/bin/vadddomain domain.url password
                        /home/vpopmail/bin/vadduser new-user@domain.url password
                        The account is then located at /var/vpopmail/domains (you will see new domain listed)
                        I have not tested this in production, and if used, you use at your own risk, as there may be good reasons not to use the above as a quick fix
                        For SSL LE, I am not sure, I guess it would be possible, and there is a WPMU SSL plugin, but I have not tried it as we do not use WPMU sorry

                        The drawback to above is it would not count in quotas
                        I hope that helps a little
                        Many thanks
                        John
                        Last edited by d2d4j; 08-06-2016, 04:11 AM.

                        Comment


                        • #13
                          Another, less hacky idea, compared to my other one.
                          You put the wordpress site and the email only site on different IPs on your server.


                          site2.com A record will point to the site1.com IP and hooked into the site1.com account via the server alias.

                          site2.com MX (let's say mail.site2.com) would point to the site2.com IP address.

                          UPDATE
                          In order to achieve this, you would have to manually add the server alias to vhost of site1.com as SiteWorx won't allow it because it already exist on the server.

                          1) So you have site1.com running with no alias to site2.com
                          2) You setup SiteWorx account for site2.com
                          3) You manually edit site1.com VHOST with server alias of site2.com
                          This idea could be used for multiple separate multiWP sites, by just using two shared IPs on your server.
                          So really you are only losing 1 IP in your block for this setup, pretty good trade off.

                          ...if it works that is :D
                          Last edited by Justec; 08-06-2016, 11:52 AM.
                          [ JUSTIN ]
                          [ OFF unit ]
                          [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
                          ]

                          Comment


                          • #14
                            Hi Justin

                            Sounds good but IW recognises the domain is already present on server

                            I'm sorry though, I may have misunderstood, so I apologise in advance

                            Many thanks

                            John

                            Comment


                            • #15
                              Originally posted by d2d4j View Post
                              Sounds good but IW recognises the domain is already present on server
                              Right, if you do it in SiteWorx, good point.

                              But I think if you create site2.com account, then go back and manually edit the vhost file it will work.

                              I'll update my other post to reflect this.
                              [ JUSTIN ]
                              [ OFF unit ]
                              [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
                              ]

                              Comment

                              Working...
                              X