Actually looking for comments and advice on the attached script. On Sat, Sep 13, 2008 at 12:48 PM, Charliej <[EMAIL PROTECTED]> wrote:
> On Sat, 2008-09-13 at 10:24 -0400, Jim Tarvid wrote: > > Rough cut on an install script. usage install_drupal user pass domain > > dbpass dbname > > The intent is to install drupal in user space such that http://domain/ > > brings up Drupal's install screen. > > > > This would allow users to design their website and prepare it for > > uploading to a public server. > > > > To do that > > 1) add the user > > 2) build the skeleton at /home/user > > 3) download and install drupal 6.4 from drupal.org > > 4) prep the drupal install tree > > 5) fix ownership and permissions > > 6) create the mysql user and database > > 7) create the apache virtual config file and enable > Not sure if this is what your looking for but gallery2 would be a good > *example* package to look at for 1-7 and 10(apache2), debconf and > wwwconfig-common are your friends. Not sure about the rest.=) > > 8) create the bind9 zone and add to named.conf.local > > 9) add domain to /etc/hosts file > > 10 reload bind9 and apache2 > > > > Some obvious improvements > > 1) error check the parameters > > 2) test existence before creating users, apache config files, bind > > files, hosts modifications > > 3) error checking and recovery > > > > This could lead to an ubuntu package > > > > I'd appreciate wisdom and advice. > > > > > > > > -- > > http://ls.net > > http://drupal.ls.net > > > > -- > > ubuntu-server mailing list > > ubuntu-server@lists.ubuntu.com > > https://lists.ubuntu.com/mailman/listinfo/ubuntu-server > > More info: https://wiki.ubuntu.com/ServerTeam > > -- http://ls.net http://drupal.ls.net
#!/bin/bash echo user=$1 echo password=$2 echo domain=$3 echo dbpass=$4 echo dbname=$5 useradd $1 -p `mkpasswd $2` mkdir /home/$1 mkdir /home/$1/public_html cd /home/$1/public_html wget http://ftp.drupal.org/files/projects/drupal-6.4.tar.gz tar xzvf drupal-6.4.tar.gz mv drupal-6.4 $3 mkdir /home/$1/public_html/$3/sites/all/modules mkdir /home/$1/public_html/$3/sites/all/themes mkdir /home/$1/public_html/$3/sites/default/files chmod -R 777 /home/$1/public_html/$3/sites/default/files cp /home/$1/public_html/$3/sites/default/default.settings.php /home/$1/public_html/$3/sites/default/settings.php chmod 777 /home/$1/public_html/$3/sites/default/settings.php chown -R $1.$1 /home/$1 mysql -uroot -p$4 -e "DROP USER '$1'@'localhost';" mysql -uroot -p$4 -e "DROP DATABASE IF EXISTS $5;" mysql -uroot -p$4 -e "CREATE USER '$1'@'localhost' IDENTIFIED BY '$2';" mysql -uroot -p$4 -e "CREATE DATABASE IF NOT EXISTS $5;" mysql -uroot -p$4 -e "GRANT USAGE ON $5.* TO '$1'@'localhost' IDENTIFIED BY '$2';" mysql -uroot -p$4 -e "GRANT ALL PRIVILEGES ON $5.* TO '$1'@'localhost';" mysql -uroot -p$4 -e "flush privileges;" echo "<VirtualHost *>" >/etc/apache2/sites-available/$3 echo " DocumentRoot /home/$1/public_html/$3" >>/etc/apache2/sites-available/$3 echo " ServerName $3" >>/etc/apache2/sites-available/$3 echo " <Directory /home/$1/public_html/$3>" >>/etc/apache2/sites-available/$3 echo " allow from all" >>/etc/apache2/sites-available/$3 echo " AllowOverride AuthConfig FileInfo Indexes Limit Options" >>/etc/apache2/sites-available/$3 echo " Options FollowSymLinks SymLinksIfOwnerMatch +Indexes" >>/etc/apache2/sites-available/$3 echo " </Directory>" >>/etc/apache2/sites-available/$3 echo " ServerAlias www.$3" >>/etc/apache2/sites-available/$3 echo "</VirtualHost>" >>/etc/apache2/sites-available/$3 a2ensite $3 echo "\$TTL 86400" >/etc/bind/$3 echo "$3. IN SOA www.$3. root.$3. (" >>/etc/bind/$3 echo " `date +%Y%m%d`00" >>/etc/bind/$3 echo " 8H" >>/etc/bind/$3 echo " 2H" >>/etc/bind/$3 echo " 4W" >>/etc/bind/$3 echo " 1D)" >>/etc/bind/$3 echo " IN NS `hostname`" >>/etc/bind/$3 echo "$3 A `ifconfig|awk '/Bcast:/ {print $2}'|cut -d":" -f2`" >>/etc/bind/$3 echo "www.$3 A `ifconfig|awk '/Bcast:/ {print $2}'|cut -d":" -f2`" >>/etc/bind/$3 echo "zone \"$3\" {" >>/etc/bind/named.conf.local echo " type master;" >>/etc/bind/named.conf.local echo " file \"/etc/bind/$3\";" >>/etc/bind/named.conf.local echo " };" >>/etc/bind/named.conf.local echo "127.0.0.1 $3" >>/etc/hosts /etc/init.d/bind9 reload /etc/init.d/apache2 force-reload
-- ubuntu-server mailing list ubuntu-server@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-server More info: https://wiki.ubuntu.com/ServerTeam