Developer Portal Silent Install

Not applicable

Hi Folks

I am looking for a little bit of assistance with automating the developer portal install.

Basically I am in the middle of finalising the edge automated installation using the silent install method with the config.host file.

After writing up prequisites that need to be considered such as Java SDK version and licence file but i am wondering if this method can also be used for the developer portal installation.

Has anyone else done this type of install already? Our current environment is 2 data centres with 2 web ui in them with master mysql on one machine and the remaining 3 mysql nodes are set as slaves.

Does mysql require to be done first manually?

Best,

Mark

1 12 1,593
12 REPLIES 12

Dear @Mark Lehmann ,

Yes, MySQL is required to do Apigee Developer Portal installation. Apigee Developer portal is built on top of famous open source Drupal CMS. I believe it's possible to build silent installation of Apigee Developer Portal.

Take a look at Drupal Silent Installation document using command line tool drush. That should help you get started. Keep us posted if you have any further queries.

Hi @Anil Sagar

Thanks for your prompt response on this one. I was taking a look at the page you forwarded me. I thought this would be part of Apigee as a default. Anyway looking at the link you sent me I can see there is a string:

drush site-install standard --db-url='mysql://[db_user]:[db_pass]@localhost/[db_name]' --site-name=Example

So the perquisite here is that you need to have mysql installed and configured first before you setup the Web UI's with the above cmd?

Best,

Mark

Yes that's correct, you should have mysql instance ready before you start devportal installation.

Hi @Anil Sagar

Thanks for confirming this is what can potentially delay us in doing automated install / downgrade deployments if we are dependant on mysql being provisioned first which I do not see it being a particular major issue.

Best,

Mark

Hi,

drush site-install standard installs drupal, but not the developer portal. How can I install devportal on top of drupal?

Separately, we are using networked-install.sh -c #{answer_file}

I'm also curious why the props in the answer_file are not read by the installer. It has props listed in autoinstall.properties.default, yet the web ui prompts for the values again.

Thanks,

Rob

Hi Rob,

Thanks for the question. I was forwarded your post from Michael Glenney. If you don't mind, I would recommend posting this as a separate question on the Dev Portal forum for more visibility / traction. I'll also have some of our drupal resources reply / take a look

Thanks!

On the 17XX releases you can use PostgreSQL instead of MySQL for DevPortal.

http://docs.apigee.com/private-cloud/latest/installing-edge-private-cloud-developer-services-portal

Not applicable

Drush site-install should work with the following command-line:

drush site-install apigee \
  apigee_install_api_endpoint.org="my_org" \
  apigee_install_api_endpoint.endpoint="https://api.enterprise.apigee.com/v1" \
  apigee_install_api_endpoint.user="me@example.com" \
  apigee_install_api_endpoint.pass="sup3r-s3cret" \
  apigee_install_create_admin_user.firstname="John" \
  apigee_install_create_admin_user.lastname="Doe" \
  apigee_install_create_admin_user.username="johndoe" \
  apigee_install_create_admin_user.pass="p4ssw0rd" \
  apigee_install_create_admin_user.emailaddress="johndoe@example.com" \
  --sites-subdir=default

Obviously substituting your own info for each field.

Be sure you are using an up-to-date Dev Portal codebase, because the above failed for older versions.

@Daniel Johnson - Do you know what version of dev portal this works with? We're running 4.16.05 and does not appear to be working as described above.

I also added to the command the --db-url=mysql://devportal:123456@localhost/devportal which does seem to work at dropping and recreating the DB but then I get a bunch of warning messages about array parameters

Maybe my command line is not correct, in the right order or just plain missing something here.

My instructions above assumed that you were on Pantheon cloud, where all the configuration from sites/default/settings.php is already set by the environment. On a local install, you will need to preconfigure the database portion of settings.php. Alternatively, you can replace the contents of settings.php entirely with the following code:

<?php
$update_free_access = FALSE;
$drupal_hash_salt = '';
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', 200000);
ini_set('session.cookie_lifetime', 2000000);

$databases = array ('default' =>
  array ('default' =>
    array (
      'database' => 'my-db-name',
      'username' => 'my-db-user',
      'password' => 'my-db-pass',
      'host' => 'my-db-host',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

Of course, you will need to provide your actual database connection credentials.

@Daniel Johnson

I am trying to do silent installation of DeveloperPortal 4.16.05 on CentOS 7.2 (on a VM with NO internet access)

I installed Edge (4.16.05), with

*URL*: http://keng01-dev01-api01-gtw.dev.internal:9000/login

*Credentials*: foo@bar.com / Secret@123!

Installed Developer Portal, say http://dev-portal-fqdn

Now when I hit the developer portal url above, I see web forms, wherein I am supposed to provide devportal database details, edge details etc.

I skip the above process and went for drush commands suggested by you. Before that I changes permission of settings.php:

chmod a+w /var/www/html/sites/default/settings.php
chmod a+w /var/www/html/sites/default

Now when I run the following drush commands, I get Authentication error from Edge (through I can login using the URL and credentials of Edge, in following command):

[root@keng01-dev01-api01-cms html]# drush site-install apigee \
> apigee_install_api_endpoint.org='myorg' \
> apigee_install_api_endpoint.endpoint='http://keng01-dev01-api01-gtw-dev.internal:8080/v1' \
> apigee_install_api_endpoint.user='foo@bar.com' \
> apigee_install_api_endpoint.pass='Secret@123!' \
> apigee_install_create_admin_user.firstname='Test' \
> apigee_install_create_admin_user.lastname='User' \
> apigee_install_create_admin_user.username='test.user@foobar.com' \
> apigee_install_create_admin_user.pass='Secret@123!' \
> apigee_install_create_admin_user.emailaddress='test.user@foobar.com' \
> --sites-subdir=default \
> --db-url='mysql://devportal:devportal@127.0.0.1:3306/devportal'


You are about to DROP all tables in your 'devportal' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option. [ok]
WD php: Warning: reset() expects parameter 1 to be array, boolean given in faq_insert() (line 242 of /var/www/html/profiles/apigee/modules/contrib/faq/faq.module). [warning]
WD php: Warning: reset() expects parameter 1 to be array, boolean given in faq_insert() (line 242 of /var/www/html/profiles/apigee/modules/contrib/faq/faq.module). [warning]
WD php: Warning: reset() expects parameter 1 to be array, boolean given in faq_insert() (line 242 of /var/www/html/profiles/apigee/modules/contrib/faq/faq.module). [warning]
WD php: Warning: reset() expects parameter 1 to be array, boolean given in faq_insert() (line 242 of /var/www/html/profiles/apigee/modules/contrib/faq/faq.module). [warning]
exception 'Exception' with message '<span style="color:red">Edge Endpoint responded with 401 Unauthorized. Check the username and password.</span>' in [error]
/var/www/html/includes/install.core.inc:415
Stack trace:
#0 /var/www/html/includes/install.core.inc(339): install_run_task(Array, Array)
#1 /var/www/html/includes/install.core.inc(77): install_run_tasks(Array)
#2 /usr/local/share/drush/includes/drush.inc(719): install_drupal(Array)
#3 /usr/local/share/drush/includes/drush.inc(705): drush_call_user_func_array('install_drupal', Array)
#4 /usr/local/share/drush/commands/core/drupal/site_install_7.inc(80): drush_op('install_drupal', Array)
#5 /usr/local/share/drush/commands/core/site_install.drush.inc(289): drush_core_site_install_version('apigee', Array)
#6 [internal function]: drush_core_site_install('apigee', 'apigee_install_...', 'apigee_install_...', 'apigee_install_...', 'apigee_install_...', 'apigee_install_...',
'apigee_install_...', 'apigee_install_...', 'apigee_install_...', 'apigee_install_...')
#7 /usr/local/share/drush/includes/command.inc(359): call_user_func_array('drush_core_site...', Array)



I am NOT sure why the authentication failed to Edge, as I can login to:

http://keng01-dev01-api01-gtw-dev.internal:9000/login

using: foo@bar.com / Secret@123!



Current status is that, I am able to get the home page of Devloper Portal, but NOT able to login using:

foo@bar.com / Secret@123!


OR

test.user@foobar.com / Secret@123!


Any pointers, how should I proceed?

Thanks, Daniel. That was the missing link in my Chef automation. It worked with Developer Services 4.16.01.

The networked-install.sh script does accept a response file on stdin. It was easy to create that with a Chef template.

There are several ways to ensure the DB connection configuration before running drush. The approach I took was to create /var/www/html/sites/default/settings.php with a Chef template.