Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-27 03:36:44

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

How do I create a subdomain for developing?

Hi!

I would like to learn how do I create a subdomain for developing a TxP site?

There is currently a site running on the www subdomain, so I would like to create a devel.domain.com and there, to have a duplicate installation (pointing to a copy of the database) of the current site.

I have a cPanel control panel and there is a tool for creating subdomains, although I try to avoid this automagic tools.
It’s a cheap hosting, so I have a virtual host account. Probably, I don’t have access to any Apache thing, just the .htaccess.
Of course, there is a chance that using that cPanel tool is the only way for me to create a subdomain (it seems that you create a subdomain that points to a subfolder in your root directory, is that the standard way?).

So, what are best practices?
Any advice (like plug-ins that will make the task easier) will be appreciated.

For example, will be ied_if_domain be helpful in the task of redesigning/redeveloping a site?

Thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2007-11-27 03:54:01

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: How do I create a subdomain for developing?

This is how I do it:

  1. create the subdomain using cpanel. Cpanel just takes care of mapping the subfolder to a Virtual Host entry in Apache for you.
  2. copy the DB
  3. copy your TXP install into the sub domains folder
  4. change the DB name and txpath in config.php (update DB users if necessary)
  5. log in to subdomain.domain.com/textpattern/ and change the site URL

Everything should work.


Shoving is the answer – pusher robot

Offline

#3 2007-11-27 04:07:09

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: How do I create a subdomain for developing?

Hi hakjoon.
Many thanks! That was fast.

It seems easy, now that you explained it so clear.

While I was waiting for an answer, I found this article about subdomains and development. There, the author wrote about some not-so-good experiences of developing on subdomains.
But i think that article doesn’t apply to the simple task I need to do.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2007-11-27 14:56:15

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: How do I create a subdomain for developing?

The SSL issue is definitely a valid point, as is sharing resources across so many subdomains. We do a lot of that at work and we’ve had to write special handlers just to the same css from sub.domain.com and www.domain.com while still being able to have it pull from local when developing.

For a TXP dev environment though it’s much better because both will have TXP in the root and not in a subfolder which creates a more consistent environment.


Shoving is the answer – pusher robot

Offline

#5 2007-12-27 07:47:38

yusoshi
Member
From: Tokyo
Registered: 2004-09-02
Posts: 11
Website

Re: How do I create a subdomain for developing?

hakjoon wrote:

This is how I do it:

  1. create the subdomain using cpanel. Cpanel just takes care of mapping the subfolder to a Virtual Host entry in Apache for you.
  2. copy the DB
  3. copy your TXP install into the sub domains folder
  4. change the DB name and txpath in config.php (update DB users if necessary)
  5. log in to subdomain.domain.com/textpattern/ and change the site URL

Hi – I’m on Textdrive and I don’t think I have access to cPanel (have webmin and phpmyadmin). I think I can just make folders within my public_html folder and they become subdomains. My big difficulty is I don’t know how to do steps 2 & 3. I use Transmit for ftp access to my domains and I can’t figure out a way of doing this. Maybe I can copy everything in TxP to my local drive and then upload it to the new folder, but I’m worried that’s not going to get everything I need and I have no idea where the database actually is.

What I’m trying to do is split off a bilingual site that’s been built under one domain so that each language version can have its own subdomain – the reason for this is to – hopefully – make sure the RSS feeds are only going to be from each subdomain so English subscribers don’t also get Japanese updates. Also, my site uses tags and at the moment the tags are in both languages, which creates a mess.

So, before I get into a technical problem of duplicating databases and deleting all the English postings, leaving just the Japanese – does it sound like what I want to do will actually work?

Offline

#6 2007-12-27 07:58:38

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: How do I create a subdomain for developing?

On Textdrive it goes like this:

  1. Login to Webmin
  2. Create a new DB if you need to use a new DB (create the DB in Webmin)
  3. Login to your phpMyAdmin and export your current DB
  4. SFTP to your /users/home/yourname/public_html/ and download your TXP install, or copy to the subdomain
  5. Go to phpMyAdmin, and import the DB your exported earlier into the new DB
  6. Go to the new TXP install, and find config.php. Edit the DB name variable, and check the path settings
  7. Login to the new TXP, and edit the path settings in Admin > Preferences, and Advanced. Check also the Diagnostics

That’s about it.

Offline

#7 2007-12-27 08:07:44

yusoshi
Member
From: Tokyo
Registered: 2004-09-02
Posts: 11
Website

Re: How do I create a subdomain for developing?

Thanks very much Jonathan – this is going to help me a lot. If I can get it to work out, I’ll post my findings here so other’s can benefit.

Offline

#8 2007-12-27 10:23:41

yusoshi
Member
From: Tokyo
Registered: 2004-09-02
Posts: 11
Website

Re: How do I create a subdomain for developing?

Ok – Done all that – your instructions were easy enough to follow – thanks again.

I’m very confused though. A lot of my navigation forms and so on use txp:site_url and even though I changed the site url in preferences by adding the subdomain at the front, everything still navigates to the original install. I’ve even deleted my old home page, the English template and all the English articles in the new subdomain and they’re still showing up, so somehow it’s defaulting to the original install.

Is there something else I need to add or edit (.htaccess?) to get it to work? You can see if you visit here; http://jp.creativityinbusiness.net/ There aren’t any English articles left in this subdomain or the new database I created so all you should see is Japanese.

If it’s not a simple thing that a novice like me would have missed through ignorance, then please don’t take too much time answering – I’ll just wait for my support guy to return from his holiday break. Many thanks.

Offline

#9 2007-12-27 10:59:05

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: How do I create a subdomain for developing?

Check the path to site in config.php and also check any paths in Admin > Preferences. Usually its something simple.

Offline

#10 2007-12-27 11:18:33

yusoshi
Member
From: Tokyo
Registered: 2004-09-02
Posts: 11
Website

Re: How do I create a subdomain for developing?

Triple, now quadruple-checked all those. I’m sure you’re right – it will be something simple, but it will have to wait. Thanks again for your help.

Offline

#11 2007-12-27 11:39:32

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: How do I create a subdomain for developing?

Yusoshi

Did you clear your browser cache?


Steve

Offline

#12 2007-12-27 12:05:49

yusoshi
Member
From: Tokyo
Registered: 2004-09-02
Posts: 11
Website

Re: How do I create a subdomain for developing?

yes – and tested it in Safari as well as shift-cmd R in Firefox which refreshes without referring to the cache.

Offline

Board footer

Powered by FluxBB