Best Practices - Installing Drupal

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by Branjawn on February 18, 2011 at 5:24pm

Is it best to install Drupal at root level (public_html)?
Or is it better to create a Drupal folder (public_html/Drupal) and install there.

Are there pros and cons, warnings... or does it simply not matter?
Also, are there ramifications regarding multisite install or subdomains?

As always, thanks so much for your insights.

Comments

Where to put any LAMP App

Posted by Screenack on February 18, 2011 at 6:11pm

Your question suggests a shared site.

I'd generally advise against it, with the proviso that your host lets you establish a different root folder per domain. (guess who DOESN'T let you do that?) Installing into, say, "live" let's you later set up additional sites as needed without having to perform file management as part of the task of adding sites. The other gotchas here are host policies with .htacess overrides per directory; again, with more strict restrictions on the bottom-basement types of hosts.

Argggg

Posted by Branjawn on February 18, 2011 at 9:08pm

So, I set up the hosting using a domain i purchased, we'll call it mysite.org, and was told by support that I cannot then install Drupal in public_html/drupal and have mysite.org point there. To quote support, "The primary install must go under public_html".

"with more strict restrictions on the bottom-basement types of hosts."
I'm using one of the 'preferred' Drupal hosting solutions.

So, yeah, it would have been nice to quarantine Drupal to a directory. Lesson learned.

Solution

Posted by Branjawn on February 20, 2011 at 2:44pm

I added this to the root .htaccess and am having success so far...
(this assumes Drupal is installed in public_html/drupal and the site is mysite.us)

Options -Indexes
RewriteEngine on
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} ^www.mysite.us$ [NC]
RewriteRule ^$ drupal/index.php [L]
RewriteCond %{HTTP_HOST} ^www.mysite.us$ [NC]
RewriteCond %{DOCUMENT_ROOT}/drupal%{REQUEST_URI} -f
RewriteRule .* drupal/0ドル [L]
RewriteCond %{HTTP_HOST} ^www.mysite.us$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* drupal/index.php?q=0ドル [QSA]

Now to test it with multisite install.

North Carolina

Group organizers

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /