Probably not the right forum but I'm desperate and I've been looking for hours.

I've got Domain Access installed on a virtual dedicated server account. I am trying to get two different domains (domain1.com and domain2.com, not subdomains) to both point at the same IP address. However, when I create the domains, each domain requires a different user account and thus creates a different document root for each domain (/home/user1/public_html and /home/user2/public_html). Maddening and stupid, since I have no problem at all when I set up Domain Access on a grid server (I can add all the domains I want and they'll all share a documentroot).

So I guess I have a few questions:

1) The hosting company's tech support tells me it's possible to manually redirect a documentroot via SSH. I've scoured the web and I can't find anything explaining this. Can someone point me in a better direction?

2) I'm using the cheapie (free) Simple Control Panel, which is what is requiring that each new domain have its own user. Does anyone know if Plesk or cPanel allows me to manually redirect each domain's docroot? It'll involve reprovisioning but I'm good and ready to do that if I know it'll work.

Thanks!

Comments

croryx’s picture

cPanel will definitely allow you to do this.

pbeakley’s picture

Status: Active » Closed (won't fix)

Well, I ended up hacking it out another way, by creating a forwarding/masking thing on the second domain and giving up on the Domain Access module. I'll know better in the future, and set up the virtual dedicated server account with cPanel in the future.

pbeakley’s picture

This subject came up again, same client, so I did a little more digging and include my findings here for posterity:

If you have a Virtual Dedicated Server that uses the Simple Control Panel, you definitely can edit your document root domain-by-domain. The file is stored at

/etc/httpd/conf.d/turbopanel.conf

Once you're into it it is very obvious which Virtualhost lines to change.

What I did not find out was how to change the settings in Apache so that Simple doesn't automatically write a new Virtualhost line into turbopanel.conf following its standard home/username/public_html format. So for now, I still have to manually edit turbopanel.conf each time we add a domain name. Not a BIG deal but still an annoyance.

EDIT: Also, it appears the old, incorrect documentroot does not change when you go back and review your entry under "Domains" -- it'll look like your docroot is still home/username/public_html, but be assured that it is not. :-)

aosiname’s picture

I can confirm that this worked on a Go Daddy Virtual Dedicated Server (Centos Option) with Simple Control Panel.

It is annoying that when you create a new domain - it automatically creates a new directory and points your domain there - so you cant do a drupal multisite install.

With this guide - you can. It worked for me.

Thanks

aosiname’s picture

hmm although i added another site (subdomain to primary domain) and my server automatically switched my turbopanel.conf file to point the old dir (maybe because I didnt delete the old dir)

pbeakley’s picture

Interesting -- I haven't attempted a subdomain on a multidomain installation yet. I'll bet there's something we can do to rewrite the file that writes turbopanel.conf, but that's beyond my abilities for now.

mattwmc’s picture

I'm doing this now with GoDaddy and am a total noob to VPS.

What do I need to edit in the turbopanel.conf?

I assume it would be this:

NameVirtualHost xx.xx.xxx.xxx:xx

<VirtualHost xx.xx.xxx.xxx:xx>
    ServerAdmin "name@site.com"
    ServerName downloads.site.com
    ServerAlias www.downloads.site.com
    MIMEMagicFile /dev/null
    CustomLog logs/downloads.site.com_access_log "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
    ErrorLog logs/downloads.site.com_error_log

    DocumentRoot "/home/xxxxx/downloads"
    <Directory "/home/xxxxx/downloads">
        Options +Indexes +FollowSymLinks
        Order allow,deny
        Allow from all
        AllowOverride All
    </Directory>

    Alias /usage "/home/xxxxx/downloads/usage"
    <Location /usage>
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

pbeakley’s picture

Yeah, that's the file but there aren't any domains designated yet. Once you start adding domains via Simple Control Panel, additional entries will start appearing, at which point the documentroot lines will be really obvious.

EDIT: Actually, yes, the lines are right there in this example -- the one that says Documentroot, and the line right below it.

aosiname’s picture

Some of my findings...
The turbopanel.conf is re-written everytime you add a new domain so all your changes are lost.

What you should do is create a file called a_local.conf in the same dir as turbopanel.conf.

Whatever you put in there overrides turbopanel.conf.

So to create a new domain, I dont even use the free simple panel to do it - as it creates a domain user etc.

I just add the lines in my a_local.conf and restart apache web server: /etc/init.d/httpd restart (using su)

This works fine.

The only time i add a new domain is if i want to create email addresses for it.

But I always override turbopanel.conf with a_local.conf

Trust me it works for subdomains and normal domains :)

Anyone know how to install SSL?
I got my certificate from comodo - instantssl.com but cant install it. Https works but no idea where it is pointing AND it is an untrusted cert...

pbeakley’s picture

Does the file need to be specifically named a_local.conf?

I assume you just copy/paste the basics out of turbopanel.conf, right?

This is great news if it's this simple. I've got a client for whom I'm building a domain-based franchising thing, and every time we add a new domain, sure enough, I have to go back through turbopanel.conf and make good and sure everything is aimed right.