Monday, July 5, 2010

New 10.4 LTS Dev Environment

Today I slicked my drive full of Ubuntu upgrades and performed a fresh install using the latest version of 10.4 LTS. It occurred to me this might be a good time to document some steps to get a minimum dev environment up and going on Ubuntu:

1) Install Java
  • Download from http://java.sun.com/javase/downloads/index.jsp
  • chmod 777 jdk-6u20-linux-x64.sh
  • ./jdk-6u20-linux-x64.sh
  • mv jdk1.6.0_20 /usr/local/lib/jdk1.6.0_20/bin/java
  • sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/lib/jdk1.6.0_20/bin/java" 1
  • sudo update-alternatives --set java /usr/local/lib/jdk1.6.0_20/bin/java
  • Create sym link for Firefox Java Plugin:
  • ln -s/usr/local/lib/jdk1.6.0_20/lib/amd64/libnpjp2.so ~/.mozilla/plugins
2) Install Eclipse
  • Download from http://www.eclipse.org
  • Extract to "eclipse" and move to new home
  • Install SVN plugin and checkout project from sourceforge
3) Install Apache & PHP 5.3
  • sudo apt-get install php5 php5-mysql php5-pgsql php5-sqlite php5-curl php5-xsl php5-mcrypt php5-dev php5-xdebug php-pear php-gettext
  • sudo vim /etc/php5/cli/conf.d/mcrypt.ini (remove deprecated ini #comment)
4) Install & configure MySQL 5.1
  • sudo apt-get install mysql-server mysql-client
  • grant all privileges on *.* to php@localhost identified by 'php007';
5) Install & configure PostgreSQL 8.4
  • sudo apt-get install postgresql
  • sudo -s
  • su postgres
  • createuser -P -s -e php (password php007)
CREATE ROLE php PASSWORD 'md51a344967d2534f238d89148a8f67bd7a' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
  • - createdb -O php php
6) Import agilephp_test and agilephp_studio MySQL schemas
  • mysql -u root -p < /storage/Apps/eclipse-galileo/workspace/AgilePHP/test/agilephp_test.sql
  • mysql -u root -p < /storage/Apps/eclipse-galileo/workspace/AgilePHP/studio/agilephp_studio.sql
7) Configure Apache Virtual Host
  • vim /etc/apache2/conf.d/agilephp
<VirtualHost *:80>
ServerName agilephp
DocumentRoot "/storage/Apps/eclipse-galileo/workspace/AgilePHP"
DirectoryIndex index.php

<Directory "/storage/Apps/eclipse-galileo/workspace/AgilePHP">
AllowOverride All
Allow from All
</Directory>

</VirtualHost>
  • Create hosts entry that points "agilephp" to localhost
8) Make AgilePHP/test/logs writable
  • sudo chmod -R 777 test/logs
9) Install Phing
  • sudo pear channel-discover pear.phing.info
  • sudo pear install --alldeps phing/phing
11) Install PHPUnit
  • sudo pear channel-discover pear.phpunit.de
  • sudo pear install phpunit/PHPUnit
12) Install PEAR_PackageFileManager
  • sudo pear install PEAR_PackageFileManager channel://pear.php.net/XML_Serializer-0.20.0
13) Install JSlint
  • Download from http://www.javascriptlint.com/download.htm
  • Extract archive
  • cd jsl-0.3.0/src
  • make -f Makefile.ref
  • sudo ln -s /storage/Sources/jsl-0.3.0/src/Linux_All_DBG.OBJ/jsl /usr/bin/jsl
14) Install YAML
  • apt-get install libyaml-0-2 libyaml-dev
  • sudo pecl install yaml channel://pecl.php.net/yaml-0.6.3
  • sudo vim /etc/php5/conf.d/yaml.ini
  • # yaml.ini
    extension=yaml.so
15) Install Sendmail
  • sudo apt-get install sendmail
16) Restart Apache
  • sudo /etc/init.d/apache2 restart
17) Install Locales (used in unit tests)
  • sudo locale-gen es_ES (Spanish)
  • sudo locale-gen de_DE (German)
  • sudo locale-gen fr_FR (French)
18) Give Apache Write Privileges
  • sudo chown -R jhahn.www-data AgilePHP
19) Update AgilePHP/build.properties
  • locate phpunit-frames.xsl (note directory)
  • phpunit.styles.dir=(path to directory noted above)
20) Phing/AgilePHP Bug Fix

phing/Phing.php
line 1016 $pieces = explode(DIRECTORY_SEPARATOR, $path);
line 1017 $class = preg_replace('/\.php/', '', array_pop($pieces));
line 1018 if(class_exists($class, false)) return;

21) Build the project
jhahn@xenia:/storage/Apps/eclipse-galileo/workspace/AgilePHP$ phing

Buildfile: /storage/Apps/eclipse-galileo/workspace/AgilePHP/build.xml
[property] Loading /storage/Apps/eclipse-galileo/workspace/AgilePHP/build.properties

AgilePHP Framework > delete-logs:

[delete] Deleting /storage/Apps/eclipse-galileo/workspace/AgilePHP/test/logs/agilephp_07-05-10.log
[delete] Deleting directory /storage/Apps/eclipse-galileo/workspace/AgilePHP/test/logs
[delete] Deleting directory /storage/Apps/eclipse-galileo/workspace/AgilePHP/studio/logs
[mkdir] Created dir: /storage/Apps/eclipse-galileo/workspace/AgilePHP/test/logs
[mkdir] Created dir: /storage/Apps/eclipse-galileo/workspace/AgilePHP/studio/logs
[chmod] Changed file mode on '/storage/Apps/eclipse-galileo/workspace/AgilePHP/test/logs' to 777
[chmod] Changed file mode on '/storage/Apps/eclipse-galileo/workspace/AgilePHP/studio/logs' to 777

AgilePHP Framework > clean:

[delete] Deleting directory /storage/Apps/eclipse-galileo/workspace/AgilePHP/build

AgilePHP Framework > test:

[mkdir] Created dir: /storage/Apps/eclipse-galileo/workspace/AgilePHP/build/reports/phpunit
[mkdir] Created dir: /storage/Apps/eclipse-galileo/workspace/AgilePHP/build/reports/phpunit/tests
[mkdir] Created dir: /storage/Apps/eclipse-galileo/workspace/AgilePHP/build/reports/phpunit/coverage
[coverage-setup] Setting up coverage database for 124 files
localhost[8404]: [6] localhost 07-05-10 2:22:05pm / info 2010-07-05T14:22:05-04:00
localhost[8404]: [4] localhost 07-05-10 2:22:05pm / warn 2010-07-05T14:22:05-04:00
localhost[8404]: [3] localhost 07-05-10 2:22:05pm / error 2010-07-05T14:22:05-04:00
localhost[8404]: [7] localhost 07-05-10 2:22:05pm / debug 2010-07-05T14:22:05-04:00
[phpunit] Tests run: 111, Failures: 0, Errors: 0, Incomplete: 0, Skipped: 0, Time elapsed: 103,57901 s
[coverage-report] Transforming coverage report

AgilePHP Framework > main:

// lots of ouput not included

BUILD FINISHED

Total time: 2 minutes 57,44 seconds

No comments:

Post a Comment