geareddesign
17th November 2008, 21:39
I am setting up a Linode.com (http://linode.com) 360 server with Ubuntu 8.04 LTS Disk Image using the guide The Perfect Server - Ubuntu Hardy Heron (Ubuntu 8.04 LTS Server) (http://www.howtoforge.org/perfect-server-ubuntu8.04-lts). Since my primary use for this server is for Drupal I am using the guide a more secure drupal [multisite] install (http://justinhileman.info/blog/2007/06/a-more-secure-drupal-multisite-install) to build my server folder structure and Drupal multi-site configuration.
I thought I understood everything until I got to the discussion on the multi-site writeup about this script:
#!/bin/sh
if [ $# -lt 2 -o $# -gt 2 -o "$1" = "--help" ]; then
echo 1>&2 Usage: $0 webname example.com
exit 127
fi
# set up the site directory
# (i have .htaccess, robots.txt, and all the php include files mentioned in
# http://justinhileman.info/blog/2007/06/a-more-secure-drupal-multisite-install
# saved in a folder called ~/drupal/base)
cp /var/drupal/base/* /var/www/$1/web/
# make the file directory
mkdir /var/drupal/files/$1
chmod ug+w /var/drupal/files/$1
# set up some symlinks
ln -s /var/drupal/includes /var/www/$1/web/includes
ln -s /var/drupal/misc /var/www/$1/web/misc
ln -s /var/drupal/modules /var/www/$1/web/modules
ln -s /var/drupal/profiles /var/www/$1/web/profiles
ln -s /var/drupal/themes /var/www/$1/web/themes
ln -s /var/drupal/sites /var/www/$1/web/sites
ln -s /var/drupal/sites/all /var/www/$1/web/sites/all
ln -s /var/drupal/files/$1 /var/www/$1/web/files
# make the site file and edit it
mkdir /var/drupal/sites/$2
cp -r /var/drupal/sites/default/* /var/www/$1/web/sites/$2/
# append some stuff to the end of the new settings file
echo "\$conf = array('file_directory_path' => 'files/$1', 'file_directory_temp' => 'tmp');" >> /var/www/$1/web/sites/$2/settings.php
# i usually enter the db config by hand in vim. you could easily
# echo the db config to the end of the settings file kinda like above.
vim /var/www/$1/web/sites/$2/settings.php
How do I use/implement this? Where does it go?
I've been researching this for 3 weeks and I want to do everything right. This is the last piece of the puzzle. I would like to be able to automate the folder structure/creation for the Drupal sites without removing the ability to add html/php only sites, but it isn't a deal breaker.
:eek: If I can get this answered I am going to post my own write up merging all the tutorials into the configuration I implement. Many Druapl developers will benefit from this scenario. Thanks.
I thought I understood everything until I got to the discussion on the multi-site writeup about this script:
#!/bin/sh
if [ $# -lt 2 -o $# -gt 2 -o "$1" = "--help" ]; then
echo 1>&2 Usage: $0 webname example.com
exit 127
fi
# set up the site directory
# (i have .htaccess, robots.txt, and all the php include files mentioned in
# http://justinhileman.info/blog/2007/06/a-more-secure-drupal-multisite-install
# saved in a folder called ~/drupal/base)
cp /var/drupal/base/* /var/www/$1/web/
# make the file directory
mkdir /var/drupal/files/$1
chmod ug+w /var/drupal/files/$1
# set up some symlinks
ln -s /var/drupal/includes /var/www/$1/web/includes
ln -s /var/drupal/misc /var/www/$1/web/misc
ln -s /var/drupal/modules /var/www/$1/web/modules
ln -s /var/drupal/profiles /var/www/$1/web/profiles
ln -s /var/drupal/themes /var/www/$1/web/themes
ln -s /var/drupal/sites /var/www/$1/web/sites
ln -s /var/drupal/sites/all /var/www/$1/web/sites/all
ln -s /var/drupal/files/$1 /var/www/$1/web/files
# make the site file and edit it
mkdir /var/drupal/sites/$2
cp -r /var/drupal/sites/default/* /var/www/$1/web/sites/$2/
# append some stuff to the end of the new settings file
echo "\$conf = array('file_directory_path' => 'files/$1', 'file_directory_temp' => 'tmp');" >> /var/www/$1/web/sites/$2/settings.php
# i usually enter the db config by hand in vim. you could easily
# echo the db config to the end of the settings file kinda like above.
vim /var/www/$1/web/sites/$2/settings.php
How do I use/implement this? Where does it go?
I've been researching this for 3 weeks and I want to do everything right. This is the last piece of the puzzle. I would like to be able to automate the folder structure/creation for the Drupal sites without removing the ability to add html/php only sites, but it isn't a deal breaker.
:eek: If I can get this answered I am going to post my own write up merging all the tutorials into the configuration I implement. Many Druapl developers will benefit from this scenario. Thanks.