PDA

View Full Version : Subdomain when domain.com not transfered yet



Ashford
03-25-2007, 04:46 PM
The business owner wants to keep the live pages at our original web host account and test the new pages in the WestHost account (dedicated IP). Therefore, I would assume the domain name has not been transferred.

I am having a few problems with the subdomain and not certain if it is the settings or because the domain is not transferred. I am open to suggestions about a better way to handle the WebHost subdomain situation.

main domain
--domain.com
--web dir: /var/www/html

subdomain
--domain.com.whsites.net
--web dir: default

Programs installed via Site Manager
--Perl 5.8.7
--PHP 5.2.0
--MySQL5 5.0.27
--PerlMySQL 1.53
--phpMyAdmin 2.9.2


################
Problem 1
I have already noticed that the program links in Site Manager, such as phpMyAdmin, do not work because they use the domain.com and not the subdomain. I can get there by entering the subdomain URL in the browser.

This makes me wonder if some of the other automatically installed programs, such as Perl::DBI, will not work from the subdomain scripts.

################
Problem 2
I've installed this same perl/cgi script on numerous web hosts.

Connection string
dbi:mysql:hcshop:localhost,root,the_main_site_pwd

"Can't connect to data source , no database driver specified and DBI_DSN env var not set"




################

jalal
03-26-2007, 05:37 AM
Try using DNS to point 'domain.com' at the old host and 'newsite.domain.com' at the new WH Site (you have a static IP so it should be easy).

I doubt if it will solve Problem 1, as that tends to be based on the domain name you first set the site up with.

Problem 2 sounds like something is not installed properly. Maybe uninstall and reinstall things again. Failing that, contact support.

Ashford
03-26-2007, 11:32 PM
Jalal, I search and read a lot of your posts. With every search, it may not lead to what I needed, but I learn something new. I see the common sense of setting the domains like you mentioned. Unfortunately, I don't have the confidence to go messing about in that direction (yet); and fortunately, I didn't need to (yet).

I did get the database connection working and I wanted to share my solution here for when someone else runs into the same error.

In the script's config file where I was entering 'localhost', I had to add:
"host=localhost;database=theSpecificDatabaseName".

$dbh = DBI->connect("DBI:mysql:host=localhost;database=yourDatabaseName ,
"root","yourPasswordSetinSQLinstall",
{PrintError => 0, RaiseError => 1});


I figured it out by creating a Perl script that was not connected in any way to the main shopping cart program and did nothing but connect to the database. Once I could confirm it worked, I knew it had nothing to do with the subdomain issue.

Troubleshooting gets me nuts and loses me money on contract labor; but, I've got to admit that solving the puzzle is part of my addiction to web design.

Ashford