Project

General

Profile

Actions

DataPortalDeveloperEnvironmentSetupLinux » History » Revision 18

« Previous | Revision 18/91 (diff) | Next »
Patrick Plitzner, 10/01/2015 01:22 PM


Local dataportal development and test environment on Debian based Linux

Requires installed: mysql, apache2, php5-gd, php5-common:

sudo apt-get install php5 libapache2-mod-php5 php5-cli php5-common php5-curl php5-gd php5-mcrypt php5-mysql php5-suhosin php5-xdebug php5-json

NOTE: php5-suhosin may not be needed/available anymore. Does not matter

Local data portal installation

  1. get latest drupal from http://cybertaxonomy.eu/download/dataportal/stable/ (drupal7-cdm_dataportal-x.x.x.tar.gz)

  2. extract to /var/www

NOTE: It would be better to install it in sub folder of ~/@, e.g. @~/workspaces/www/drupal7-cdm_dataportal@, this however would involve that you modify the @/etc/apache2/sites-available/default accordingly.

  1. Go to /var/www/drupal/sites/all

  2. delete /themes

  3. insert symlink to checked out themes from svn (http://dev.e-taxonomy.eu/svn/trunk/drupal/7.x/themes/)

sudo ln -s /path/to/svn/drupal/7.x/themes/ themes
  1. delete /modules/cdm_dataportal

  2. insert symlink to checked out cdm_dataportal modules from svn (http://dev.e-taxonomy.eu/svn/trunk/drupal/7.x/modules)

sudo ln -s /path/to/svn/drupal/7.x/modules/cdm_dataportal/ modules/cdm_dataportal
  1. Go to /var/www/drupal/profiles

  2. delete /CDM_DataPortal and CDM_DataPortal_Testing

  3. insert symlink to checked out profiles from svn (http://dev.e-taxonomy.eu/svn/trunk/drupal/7.x/modules/cdm_dataportal/profile/)

sudo ln -s /path/to/svn/drupal/7.x/modules/cdm_dataportal/profile/CDM_Portal/ CDM_Portal
sudo ln -s /path/to/svn/drupal/7.x/modules/cdm_dataportal/profile/CDM_Portal_Testing/ CDM_Portal_Testing
  1. change ownership of drupal folder to www-data
 sudo chown -R www-data:www-data /var/www/drupal/. <-- not sure what ownership is necessary but this works
  1. Create database as root:

newSite

if you're not logged in to mysql as root then also:

 GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON newSite.* TO 'username'@'localhost';
  1. got to localhost/drupal/install.php

NOTE: If you are having problems with the graphical installer ("page not found" after installation) you may consider editing /var/www/drupal7-cdm_dataportal/sites/default/settings.php with the following and repeat all the steps above

 $databases = array();
 $databases['default']['default'] = array(
     'driver' => 'mysql',
     'database' => 'new_site',
     'username' => 'user',
     'password' => 'pass',
     'host' => 'localhost',
     'prefix' => '',
  );

Starting local CDM server from workspace

Requirements:

  1. In your run configurations you will find two Jetty Webapp launch configs ("cdmlib-remote-webapp - run" and "cdmlib-remote-webapp - profile")
  • "cdmlib-remote-webapp - run" will start the local CDM server

  • if you don't have anything configured yet the following output explains how to configure the CDM data bases for the CDM server

2014-04-15 13:41:08,244 ERROR [eu.etaxonomy.cdm.remote.config.AbstractWebApplicationConfigurer] - property {cdm.datasource} not found.
2014-04-15 13:41:08,245 ERROR [eu.etaxonomy.cdm.remote.config.AbstractWebApplicationConfigurer] - --> This property can be set in two ways:
2014-04-15 13:41:08,245 ERROR [eu.etaxonomy.cdm.remote.config.AbstractWebApplicationConfigurer] - -->       1. as attribute to the ServletContext
2014-04-15 13:41:08,245 ERROR [eu.etaxonomy.cdm.remote.config.AbstractWebApplicationConfigurer] - -->       2. as system property e.g. -Dcdm.datasource
2014-04-15 13:41:08,245 ERROR [eu.etaxonomy.cdm.remote.config.AbstractWebApplicationConfigurer] - -->       3. in ~/.cdmLibrary/cdmlib-remote.properties
2014-04-15 13:41:08,245 ERROR [eu.etaxonomy.cdm.remote.config.AbstractWebApplicationConfigurer] - Stopping application ...
  1. For the second option add a data source bean to your /home/user/.cdmLibrary/datasources.xml (<- create file if it does not exist) as follows (do NOT confuse with @/home/user/cdmLibrary/writableResources/cdm.datasources.xml@):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">

<bean id="cdmDB"  lazy-init="true" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="com.mysql.jdbc.Driver"/>
        <property name="user" value="user"/>
        <property name="password" value="password"/>
        <property name="jdbcUrl" value="jdbc:mysql://localhost/cdmDB?autoReconnect=true&amp;autoReconnectForPools=true&amp;"/>
    </bean>

</beans>
  1. In your "cdmlib-remote-webapp - run" launch configuration add to VM arguments:
-Dcdm.datasource=cdmDB
  1. To connect the data portal to your local CDM server add the following to Home -> Administration -> Configuration -> CDM Dataportal and choose your classification
http://localhost:8080/

Setup of the PDT project in eclipse

[!drupal-project-includespng!|!drupal7-core-buildpath.png!]

PDT launch configuration for Drupal projects

[!d7-pdt-launcher-1png!|!d7-pdt-launcher-2.png!]

NOTE: Default debug port is 9000.

If the eclipse progress bar stops at 57% with the message "Waiting for the XDebug Session" check if @xdebug.remote_enable=on@ is set in your php.ini (or xdebug.ini)

To see where the ini files are located type

php --ini

You may also look here for other troubleshooting: https://stackoverflow.com/questions/9534302/waiting-for-the-xdebug-session-57-in-eclipse-pdt

Setup of PhpStorm

[!directoriespng!|!deployment_connection.png!]

[!deployment_mappingpng!|!php_servers.png!]

Updated by Patrick Plitzner over 8 years ago · 18 revisions