The Mosso hosting system can be fast and works well for websites that may suddenly need more bandwidth, thanks to a Digg effect or being Slashdotted. Drupal is a powerful web framework that allows you to build robust professional websites in less time than handcoding. Putting the two technologies together seems like a dream come true.
Because of Mosso's distributed model, which is the secret to its speed and scalability, getting Drupal up and running is not as straightforward as it would be on a single machine hosting solution.
To start, you will create the website in your Mosso control panel.
Once the website has been created and provisioned properly, you will need to add a new MySQL database for your Drupal site to use.
Once the database is created and working correctly, you will open an FTP client and connect to your new website. Create a new folder in the root directory (yourdomainname/web/content ) and call it drupal. You can call it anything you want actually, drupal is rather logical, don't you think?
Download the latest version of Drupal 6 from the Drupal website. Unpack it, and upload it into your new drupal folder.
Before we run the Drupal installation script, we are going to make a few modifications to the .htaccess files to account for Mosso's unique setup.
In your FTP client, open the drupal folder, and edit the .htaccess file that is stored there.It will look similar to this:
I also recommend you increase the php memory limits here as well. On occasion, Drupal will run into problems trying to update modules or perform numerous sql queries in a row and will timeout or hit a memory limit. This is very common when installing the Views module, for example. A memory limit of 16mb is required for Drupal [1] but I set this higher than that.
In the new .htaccess file, first we will make sure the Rewrite Engine is on, and that the RewriteBase is set:
RewriteCond %{HTTP_HOST} ^chadhenderson\.com$ [NC]
RewriteRule ^(.*)$ http://www.chadhenderson.com/$1 [L,R=301]
Now we will do the actual rewrite of the url to add the subdirectory into the mix.
In your FTP client, go to /drupal/sites/default and download the default.settings.php file. Rename this file to settings.php and open it. Inside you will see a lot of settings for a basic Drupal site. The main ones we need to work on are the URL and the Database.
Look for these lines:
Change the $db_url line to contain your database information.
Important: Remember that you cannot use localhost, but instead have to use the MySQL hostname that is listed in your control panel. In my case, this is mysql5-25.wc1.
Now scroll down and look for these lines:
Uncomment the $base_url line and enter your website URL here.
$base_url = 'http://www.chadhenderson.com'; // NO trailing slash!
Now save settings.php and upload back to the drupal/sites/default folder.
Finally, create a folder within the drupal/sites/default folder called files, and give it write permissions. You can actually place this folder somewhere else if you wish, but this is a good place to have it when it comes time to upgrade Drupal.
Visit your new Drupal domain and you should see the beginning of the installation script. Follow the steps it asks and soon you will have your new site ready to go.
The only other step is to turn on Clean URL's, if you did not do that during the installation script. The Clean URL's page can be found under http://yourdomain/admin/settings/clean-urls
I hope this helps you get Drupal running on Mosso. My next article will cover upgrading an existing site to Drupal on Mosso and how to have both live at the same time for development.
Because of Mosso's distributed model, which is the secret to its speed and scalability, getting Drupal up and running is not as straightforward as it would be on a single machine hosting solution.
To start, you will create the website in your Mosso control panel.
Once the website has been created and provisioned properly, you will need to add a new MySQL database for your Drupal site to use.
Once the database is created and working correctly, you will open an FTP client and connect to your new website. Create a new folder in the root directory (yourdomainname/web/content ) and call it drupal. You can call it anything you want actually, drupal is rather logical, don't you think?
Download the latest version of Drupal 6 from the Drupal website. Unpack it, and upload it into your new drupal folder.
Before we run the Drupal installation script, we are going to make a few modifications to the .htaccess files to account for Mosso's unique setup.
In your FTP client, open the drupal folder, and edit the .htaccess file that is stored there.It will look similar to this:
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# 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.
<Files favicon.ico>
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# 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.
<IfModule mod_php4.c>
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
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
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
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
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
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
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:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# 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 /
# 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]
</IfModule>
# $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $
You will need to uncomment the line that sets the Rewrite Base.# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# 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.
<Files favicon.ico>
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# 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.
<IfModule mod_php4.c>
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
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
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
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
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
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
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:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# 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 /
# 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]
</IfModule>
# $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
RewriteBase /
# uncomment the following line:
RewriteBase /
I also recommend you increase the php memory limits here as well. On occasion, Drupal will run into problems trying to update modules or perform numerous sql queries in a row and will timeout or hit a memory limit. This is very common when installing the Views module, for example. A memory limit of 16mb is required for Drupal [1] but I set this higher than that.
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
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
</IfModule>
Now save this .htaccess file and move back to your website root folder. You should only see the drupal folder you created and the default index.html Mosso placed there for you when the website was created. We are going to create another .htaccess file here to handle the redirecting of our website into the drupal subfolder.<IfModule mod_php5.c>
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_value memory_limit 40M </IfModule>
In the new .htaccess file, first we will make sure the Rewrite Engine is on, and that the RewriteBase is set:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
Then we will make sure that all sites use a www in front of the url. If they do not have one, we add it for them. This is good for SEO and for any cookies we may use.RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^chadhenderson\.com$ [NC]
RewriteRule ^(.*)$ http://www.chadhenderson.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} www.chadhenderson.com
RewriteCond %{REQUEST_URI} !^/drupal
RewriteRule ^(.*)$ drupal/$1 [L]
And finally we add the rewrite rule that will allow clean urls to work for us. This way, we can us http://www.chadhenderson.com/about/bio instead of http://www.chadhenderson.com/index.php?q=about/bio . This is also good for SEO and great for human beings!RewriteCond %{REQUEST_URI} !^/drupal
RewriteRule ^(.*)$ drupal/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
Once you have saved this new file into the root of the website, you will now need to create a settings file for Drupal.RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
In your FTP client, go to /drupal/sites/default and download the default.settings.php file. Rename this file to settings.php and open it. Inside you will see a lot of settings for a basic Drupal site. The main ones we need to work on are the URL and the Database.
Look for these lines:
* Database URL format:
* $db_url = 'mysql://username:password@localhost/databasename';
* $db_url = 'mysqli://username:password@localhost/databasename';
* $db_url = 'pgsql://username:password@localhost/databasename';
*/
$db_url = 'mysql://username:password@localhost/databasename';
$db_prefix = '';
This is were you will add your MySQL database information from the database we created in the Mosso control panel. Looking at our database information in the control panel, we can see what values to place in this url.* $db_url = 'mysql://username:password@localhost/databasename';
* $db_url = 'mysqli://username:password@localhost/databasename';
* $db_url = 'pgsql://username:password@localhost/databasename';
*/
$db_url = 'mysql://username:password@localhost/databasename';
$db_prefix = '';
Change the $db_url line to contain your database information.
Important: Remember that you cannot use localhost, but instead have to use the MySQL hostname that is listed in your control panel. In my case, this is mysql5-25.wc1.
$db_url = 'mysql://344171_chad:mypassword@mysql5-25.wc1/344171_chaddrupal';
$db_prefix = '';
$db_prefix = '';
Now scroll down and look for these lines:
/**
* Base URL (optional).
*
* If you are experiencing issues with different site domains,
* uncomment the Base URL statement below (remove the leading hash sign)
* and fill in the URL to your Drupal installation.
*
* You might also want to force users to use a given domain.
* See the .htaccess file for more information.
*
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
# $base_url = 'http://www.example.com'; // NO trailing slash!
* Base URL (optional).
*
* If you are experiencing issues with different site domains,
* uncomment the Base URL statement below (remove the leading hash sign)
* and fill in the URL to your Drupal installation.
*
* You might also want to force users to use a given domain.
* See the .htaccess file for more information.
*
* Examples:
* $base_url = 'http://www.example.com';
* $base_url = 'http://www.example.com:8888';
* $base_url = 'http://www.example.com/drupal';
* $base_url = 'https://www.example.com:8888/drupal';
*
* It is not allowed to have a trailing slash; Drupal will add it
* for you.
*/
# $base_url = 'http://www.example.com'; // NO trailing slash!
Uncomment the $base_url line and enter your website URL here.
$base_url = 'http://www.chadhenderson.com'; // NO trailing slash!
Now save settings.php and upload back to the drupal/sites/default folder.
Finally, create a folder within the drupal/sites/default folder called files, and give it write permissions. You can actually place this folder somewhere else if you wish, but this is a good place to have it when it comes time to upgrade Drupal.
Visit your new Drupal domain and you should see the beginning of the installation script. Follow the steps it asks and soon you will have your new site ready to go.
The only other step is to turn on Clean URL's, if you did not do that during the installation script. The Clean URL's page can be found under http://yourdomain/admin/settings/clean-urls
I hope this helps you get Drupal running on Mosso. My next article will cover upgrading an existing site to Drupal on Mosso and how to have both live at the same time for development.
References
- http://drupal.org/no
de/207036






stephen
Invite as author
For those with questions about multis-tes
http://capellic.com/
stephen
Invite as author
My experience with Mosso.
The above tutorial is a bit out of date. I only had to do two things to get my site to work on Mosso -- uncomment the RewriteBase line so that it is set to "/" and increase the memory. Both are done in the .htaccess file in document root.
Ryan Szrama
Invite as author
Editing settings.php manually?
Anonymous
Invite as author
Cloud Sites vs Cloud Servers and Multi-Sites
We are looking to implement Drupal within Cloud Sites. However, I read some posts that this is not a good idea. What is your opinion on this?
Is it possible to use one instance of Drupal to create multiple web sites? The concern with creating separate instances of Drupal for each site is upgrade.
Thank you!
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
According to RackSpace, when we setup a new web site (b2.com) in Cloud Sites, we would need to create an alias and point it to another web site (a1.com) within Cloud Sites that already has Drupal installation. In a1.com, we would use mod rewrite to point b2.com to the appropriate directory.
Knowledge Base on creating an alias to an existing website on my Mosso account: http://help.mosso.co
Is there an article on setting up Drupal for multiple web sites?
Thank you!
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
Tomáš Fülöpp
Invite as author
Nice, but how about multi-sites?
Aditi
Invite as author
Thanks a ton