0 users online. Create an account or sign in to join them.Users

Search

Hello all, long time reader first time poster here.

I’m decently competent with the Symphony workflow and have had a great time learning it over the last 6 months.

I’m working on a client project and I’m attempting to use the “Ninja Technique” to manage multiple domains from one Symphony installation. I’ve been through the first tutorial which Michael Eichelsdörfer and Stephen Bau put together and everything makes sense saving one thing. The server or hosting setup.

Unfortunately I’m still pretty fresh when it comes to server tasks.

My central question is this; under the heading “Basic Setup” in the tutorial can anyone tell me what this means:

Domain1 and Domain2 should point to the same directory on the server, like so:

http://www.domain1.com  =>  /var/www/www.domainx.com
http://www.domain2.com  =>  /var/www/www.domainx.com

I’m on Dreamhost (shared) and currently I have the domains (i.e. domain1.com and domain2.com) mirrored to domainx.com but I’m pretty sure that’s incorrect.

Just to be clear this is a 2.0.6 install.

Any help would be appreciated, thanks!

I believe this is a reference to your virtual host set up, Aaron; such that, domain1.com points to the single server directory /path/to/website/files and then domain2.com and following point to that same path.

I’m not familiar with the Dreamhost setup; however; assuming they’re running Apache 2.x, are you able to edit httpd-vhosts.conf?

Yes. The right part is meant to be the Symphony directory on the server (which can be completely different – there is a standard Debian path in the examples). If you are on a server or virtual server, you will need to edit the virtual host setup accordingly. On a shared hosting account you should be able to edit the server paths for your domains in your administration interface. Just make sure to set your Symphony directory for both domains.

UPDATED:

Got it working

It is running Apache 2.x, but no I’m not able to edit the httpd-vhosts.conf Dreamhost says that I should be able to utilize .htaccess files in place of editing the httpd-vhosts.conf

I think you’re right as to the virtual host setup here is what the Dreamhost panel looks like: (I’ve of course modified it to stay in the context of the tutorial.)

dreamhost panel example

Ok so this is the right place, it says it 5-10 to take effect. It takes more like 5-6 hours (in my case at least.)

It was giving me a “Site Temporarily Unavailable” and “error id: bad_httpd_conf” at http://domain1.com

“error id: bad_httpd_conf” is Dreamhost’s way of telling me that “…the IP your domain is resolving to on our system points to an Apache web server not configured for your domain.”

But after waiting a bit everything is working as expected.

Glad you got it working!

By this tutorial I would try to get the ninjadomains technique working for multiple subdomains.

Being on a shared host with no access to the virtualhostconfig, but with access to dns settings in the controlepanel, I understand all my host needs to do is set up a wildcart serveralias, right after the VirtualHost section ffor my controlpanel subdomains, so I can still create proper subdomains as well. The rest I should be able to handle in the dns settings and with a modrewrite on my rootdirectory.

  1. There is no way I can create the wildcard, or make this work any other way, from my side, without shell access?

  2. as discussed here does symphony 2.0.7 offer non domain specific logins yet?

  3. How would I go about adding a real other external domain to the list of subdomains (mixed setup subdomains and external domains)

The first example in the Ninja Domain tutorial (using a single directory for several domains) should be possible on nearly any hosting account.

  • On shared hosting accounts configuring domains/folders is normally done in your administration interface. All you have to do is to “point” the domains to the same physical folder. This is what you always do if you have more than one domain for a website.
  • .htaccess should work anywhere except on the cheapest accounts – otherwise you wouldn’t get Symphony to run anyway.

Does the ninja domain technique support subdomains by now?

Sure. There is no technical difference.

Can one use .htaccess files and a wildcard in place of editing the httpd-vhosts.conf without having your host setup a serveralias line in their config?

Don’t confuse these. .htaccess files allow just a few additional manipulations, e.g. rewrites. The virtual hosts configuration file is much more powerful, but it will probably never be accessible on a shared hosting account – instead you will configure your hosts in your online administration interface. (Actually what they will do is write to the vhosts config file in the background. They simply don’t give anybody direct editing access.)

If you really don’t have such an interface to set up subdomains and domain mappings yourself (which is hard to imagine), you should definitely upgrade your plan or switch to another (more professional) host.

Michael, my apologies, I have refined my question while you were answering, so it seems. Now only question 2 remains unanswered.

Your explenation finally makes me get it though; from irc I though for a minute I could create virtualhost magic by addign lines in my htaccess at root. Not so, I simply must do it via control panel.

Now looking at the documentation of plesk controlpanel it seems I should be able to do that.

You have a Plesk Control Panel? Then you can do anything that’s needed!

Thats what I thought, but as this post points out, I still need to access the vhost.conf file and restart. I dont think I can do that via the panel, and I dont have commandline access, so I’d have to ask my host in the end :/

@aarongarcia

I should be able to utilize .htaccess files in place of editing the httpd-vhosts.conf

Is this how you got it working, would you care to share?

@newnomad

I edited the .htaccess file as per the Ninja Tutorial…besides that nothing special is going on there.

Michael E is correct, since I’m on shared hosting I can’t directly edit the httpd-vhosts.conf or any other root level assets…but in my case that’s OK, Dreamhost gives you the ability to edit certain things through it’s web interface. That screenshot I posted is from the Dreamhost web panel, that’s where I “pointed” the URL of my sencondary domains to the location of my main Symphony install (the one that I want to control everything from).

Each hosting company will have a different web panel and different privileges so whether or not you have the power to change that is dependent on your host.

So far Dreamhost has made me happy, I had to compile my own version of PHP so I could utilize the Export Ensemble Extension. But for a shared solution it gives you quite a bit of control.

Hope that helps.

Could I get some clarity on the first ninja domain technique?

I have access to htaccess file and wanted a heads up on how to ensure a .com domain would stay present in the url if the symphony primary install was under a .co.uk url?

How would I ensure the following rule served up my .com domain in the url and lept it there rather than re-directed to the .co.uk url when I click on any link in the website that’s hosted under .co.uk

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /

    ### GLOBAL REWRITE

    RewriteCond %{HTTP_HOST} ^www.domain1.com$ [NC]
    RewriteRule ^(.*)$ http://domain1.com/$1 [R,L]

    RewriteCond %{HTTP_HOST} ^domain2.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain2.com/$1 [R,L]

</IfModule>

If you are on Symphony 2, your website will work with any domain. It has no “favourite domain”. If I understand you correctly, you want to serve all the pages pages from one domain, no matter which domain is called. In this case you don’t need the ninja technique at all. Just try this:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    ### GLOBAL REWRITE
    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]
</IfModule>

Hi Michael.. thanks for the info!

What I’m trying to do is serve up the site (which is hosted under a .co.uk domain) with a .com url that is also mapped to the hosting space.. I see it working but when I hover any link.. it shows me the .co.uk url.. the only link that seems to retain it’s .dom reference in URL is a parameter for languauge switch.. I am tied to a 2.0.4 install at present as it is live and no down time till the holidays.. is it a case of assigning a global parameter for the {$root} instead of using the .htaccess ninja technique?

P.S in the above, just to double double check.. I would need to replace domain.com with the actual domain I am using yes? :)

If you do not need to serve two different websites on two domains, forget this NInja domain stuff.

You don’t even need to set a global value for the $root variable. Symphony will know the root of the current page. Simply do not overwrite this! So if you have links in your template like <a href ="{$root}/contact/">Contact Page</a>, Symphony will use the root from the current URL! (You can see the root parameter in the param pool in debug mode.)

in the above, just to double double check.. I would need to replace domain.com with the actual domain I am using yes?

Yes.

What’s weird is that if I am logged in while on the .com url it retains the correct URL in the address.. but when I log out.. it does not retain the URL and reverts to .co.uk if I click on any link that has {$root} or {$workspace} in the link.. any pointers? appologies if this is drifting off topic!

Do you have a “force www.-subdomain” redirect rule?

No why?

It’s really weird.. 2 domains pointing at 1 hosting with no special htaccess alterations.. I can only get propper .com links on all page links if I am logged in.. actually the only ink that does not mess up is one that has no reference to {$root} or {$workspace} just a param link this: ?language=english.. once I have clicked this link.. all other links seem to know where the URL is and retain the .com reference.. weird huh..

No idea about that. Besides: There is something wrong…

Can you post your .htaccess file and your navigation templates (containing the mystically changing links)?

I got a feeling if cachelite is involved somehow!

When I place ?flush=site as a trailing param in url all links change to the correct url domain name.. but when I then click on a link after refreshing the page. it returns to the .co.uk ones..

Here is a pastie of my htaccess: Pastie of Htaccess

And here is my navigation xsl: link text

See what you think!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details