Below you'll find my slides for the presentation at fosdem 2010
Setting up a new machine to be able to do drupal development often takes a lot of time, googling and tweaking. To ease that process i've created a automated installation process which takes you up to speed in roughly 20 minutes.
The whole installation process is split up in three different steps.
- Setup Lamp Server
- Setup Drush
- Setup Eclipse
These steps have been automated based on a freshly installed Ubuntu 9.04.
Just run the following code and follow the trivial installation steps.
SETUP UBUNTU
mkdir ~/bin cd ~/bin wget http://krimson.be/sites/default/files/setup_ubuntu.sh && chmod +x setup_ubuntu.sh && ./setup_ubuntu.sh
SETUP DRUSH
cd ~/bin wget http://krimson.be/sites/default/files/setup_drush.sh && chmod +x setup_drush.sh && ./setup_drush.sh . ~/.profile
SETUP ECLIPSE
cd ~/bin wget http://krimson.be/sites/default/files/setup_eclipse.php.txt && mv setup_eclipse.php.txt setup_eclipse.php && chmod +x setup_eclipse.php && ./setup_eclipse.php
Please go through the last slides for some extra manual steps to give even more power in drupal,eclipse and firefox
I'll paste the current version of those scripts here for further reference and discussion.
setup_ubuntu.sh : SETUP Drupal friendly LAMPSERVER in Ubuntu
#PREPARE ubuntu dev machine sudo apt-get update #sudo apt-get upgrade sudo tasksel install lamp-server sudo apt-get install phpmyadmin sudo apt-get install php5-cli sudo apt-get install curl php5-curl sudo apt-get install php5-xdebug sudo apt-get install subversion sudo sed -i 's/memory_limit = .*/memory_limit = 128M/' /etc/php5/apache2/php.ini sudo sed -i 's/upload_max_filesize = .*/upload_max_filesize = 128M/' /etc/php5/apache2/php.ini sudo sed -i 's/post_max_size = .*/post_max_size = 256M/' /etc/php5/apache2/php.ini #for installing PECL libs sudo apt-get install php5-dev php-pear #better uploadprogress bar sudo pecl install uploadprogress sudo sed -i '/; extension_dir directive above/ a\ extension=uploadprogress.so' /etc/php5/apache2/php.ini #cleanurl sudo sed -i 's/AllowOverride (None)/AllowOverride All/' /etc/apache2/sites-available/default sudo a2enmod rewrite && sudo /etc/init.d/apache2 restart
TEST Point your browser at http://localhost and Apache will tell you it's working
setup_drush.sh : SETUP Drush in Ubuntu
#default directory structure DEFAULT_WORKSPACE=$HOME/workspace if [ ! -d "$DEFAULT_WORKSPACE" ];then echo "create workspace folder" mkdir $DEFAULT_WORKSPACE fi cd $DEFAULT_WORKSPACE #install drush #NOTE : WHEN changing the drush folder, also update the $PROFILE_PATH DRUSH_ROOT=$DEFAULT_WORKSPACE/drush PROFILE_PATH='\n # set PATH so it includes drush if it exists \n if [ -d "$HOME/workspace/drush" ] ; then \n \t PATH="$HOME/workspace/drush:$PATH" \n fi \n' DRUSH_VERSION=2.1 DRUSH_TGZ=drush-All-Versions-$DRUSH_VERSION.tar.gz if [ ! -d "$DRUSH_ROOT" ];then echo "grabbing drush" wget http://ftp.drupal.org/files/projects/$DRUSH_TGZ if [ -a "$DRUSH_TGZ" ];then tar -zxvf $DRUSH_TGZ rm $DRUSH_TGZ else echo "ERROR : unable to download $DRUSH_TGZ" fi fi if grep -q drush ~/.profile then echo 'DRUSH already in path' source ~/.profile echo ' ---------------------------------------------------------------------- | Please update your path by reloading your .profile. | | Just run the command at the bottom from your terminal. | | Note : this will only work in current shell. if you want a decent | | DEV environment, you should logout/login. | | | | the command to run : | | | | . ~/.profile | ---------------------------------------------------------------------- ' fi
TESTRun the command 'drush' from the commandline and retrieve info about most common drush commands.
setup_eclipse.php : SETUP Eclipse 3.5 in Ubuntu
#!/usr/bin/php -q <?php $ECLIPSE_DOWNLOAD_URL="http://d2u376ub0heus3.cloudfront.net/technology/epp/downloads/release/galileo/SR1/eclipse-php-galileo-SR1-linux-gtk.tar.gz"; $ECLIPSE_NEW_FOLDER_NAME="eclipse-pdt-galileo"; $ECLIPSE_BIN_FILE="eclipse"; echo "#Install JAVA Runtime\n"; // Download it - if needed } else { } } system("cd ~/bin/packages/ && tar -zxvf $ECLIPSE_TAR_NAME && rm $ECLIPSE_TAR_NAME && mv eclipse $ECLIPSE_NEW_FOLDER_NAME"); $stringData = "#/bin/bash\n"; $stringData = "export GDK_NATIVE_WINDOWS=1\n"; $stringData = "`~/bin/packages/$ECLIPSE_NEW_FOLDER_NAME/eclipse -data ~/eclipse-workspace -vmargs -Xms128M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=512M &> /dev/null` & \n"; } ?>
TESTLaunch eclipse from the commandline by running 'eclipse'.
For more mouse oriented people, drag 'n drop the eclipse command onto your top-panel.






pdf corrupt?
hi, brilliant write-up, thanks!
i can't seem to open your pdf, file corrupt?
Pdf is corrupt
Indeed. the pdf is corrupt I will search for replacement asap
Drubuntu
I just discovered the Drubuntu project http://drupal.org/project/drubuntu
which seems to be doing roughly the same stuff.
Have to check if it's interesting to join forces.
New drush version
Drush 3.0 currently is the most recent version.
So in the script, you can change:
Change BOTH the version (2.1 => 3.0)
and the basic name (note the 'version' - was 'Version')
Post new comment