Better way to build a Website Development Environment

Events happening in the community are now at Drupal community events on www.drupal.org.
RayAdams23's picture

My purpose was to take a website already in production and be able to test doing module upgrades.

Here is what I did:

Through the cpanel of my production site (www.example.com) I added a sub-domain (dev), additionally I added a second database (devdb).

I then backed up the production db and restored into the devdb. Copied my entire file structure from the root directory into the /dev directory. Changed the settings.php to point to the new devdb. At this point I thought I was in business - not so much. When I go to the url http://dev.example.com I appear to be navigating within the development site okay - at least according to all the urls. But I did a simple change to front page that also appears on the production site. So it am writing to the production db.

One other piece of information. I have the production site in a secured state so everything is https - when I go to the dev site by typing http://dev.example.com it redirects me to https://dev.example.com. I am pretty certain that ubercart is pushing this redirect just like the production site.

I did write a php file and put it in the root directory of /dev and ran this (http://dev.example.com/phpinfo.php) without moving me to https.

Thanks for any help,
Ray

Comments

Hi Ray, SSL redirects are

joshua.stout's picture

Hi Ray,

SSL redirects are problematic on stand-alone servers and can be a nightmare on a shared hosting solution. It's very difficult to troubleshoot these errors without access to root level config files and logs. I would recommend you go with a virtual private server and configure this properly. A good VPS will also give you additional performance tools like Google's mod_pagespeed for Apache.

All that being said, the trouble is likely in your mod_rewrite. Can you send a copy of your .htaccess file?

Josh

thanks for the help

RayAdams23's picture

what is the best way to send you a copy of .htaccess?

I don't really need the SSL on my dev site so maybe I should have turned on the SSL Module for Ubercart before copying the file structure?

Again thanks for the help,
Ray

SSL

joshua.stout's picture

If you're going to accept credit card transactions you will have to use SSL. The .htaccess file can be downloaded by FTP from your site root directory.

clarification

RayAdams23's picture

sorry about that - I have the .htaccess file locally I just don't have an attach file file option here. I could change the name to something .doc and attach to the original post.

Or is there a better way to get you the file?

.htaccess

joshua.stout's picture

Copy/Paste it onto the forum. It's not very big.

I am going to sound dumb here

RayAdams23's picture

How do I add it to the forum?

how

joshua.stout's picture

Reply and paste the contents of the file.

yep sounded dumb

RayAdams23's picture

#

Apache/PHP/Drupal settings:

#

Protect files and directories from prying eyes.

Order allow,deny

Don't show directory listings for URLs which map to a directory.

Options -Indexes

Follow symbolic links in this directory.

Options +FollowSymLinks

Make Drupal handle any 404 errors.

ErrorDocument 404 /index.php

Force simple error message for requests for non-existent favicon.ico.

# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.

Set the default handler.

DirectoryIndex index.php

Override PHP settings. More in sites/default/settings.php

but the following cannot be changed at runtime.

PHP 4, Apache 1.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

PHP 4, Apache 2.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

PHP 5, Apache 1 and 2.

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0

Requires mod_expires to be enabled.

# Enable expirations.
ExpiresActive On

# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600

# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off

Various rewrite rules.

RewriteEngine on

# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /~usa

# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

$Id: .htaccess,v 1.90.2.5 2010/02/02 07:25:22 dries Exp $

Solution

joshua.stout's picture

The source of your problem is the way your hosting provider is running the virtual servers off of the shared host. I would find another hosting provider. This one is not doing a very good job.

any suggestions

RayAdams23's picture

?

Suggestion

joshua.stout's picture

Most Drupal developers I work with are using Rackspace. We've all tried the cheap shared hosting providers but it's not worth the nightmare headaches and 2am phone calls. I can get you set up properly if you need help. Would take about 30 minutes to move you over to a decent server.

sending a message to your email on file with Drupal

RayAdams23's picture

.

drupal hosting

jmcquaid's picture

I've had good luck with hotdrupal.com. My site is very simple, but the performance and support are excellent!

SSL

joshua.stout's picture

For SSL to work the encryption has to be bound to an IP address where more than 1 certificate exists on a server. This requirement prohibits most shared hosts unless the hosting provider is willing to attach multiple IP addresses to a single server.

North Carolina

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: