SlideShare a Scribd company logo
1 of 18
Drupal, Memcached
and Solr on Windows
           Alessandro Pilotti
              @alexpilotti
          MVP ASP.NET / IIS




   MCSD, MCAD, MCSE, MCDBA, MCT
      Red Hat Certified Engineer
Why Memcached?
 It’s a very popular object caching system
 To speed up web sites by offloading work from the
  DBMS

 Simple key / value store with cache invalidation
 Low CPU usage
 Half client / half server
 Servers are unaware of each other (no sync)
Memcached on Windows
   Memcached supports *nix daemon mode

   Ports for Windows exist
     Most binaries available on the web are old (1.2.x)

   The official git repository contains a Windows compatible branch
     git clone --branch engine-pu https://github.com/memcached/memcached.git
     Currently version 1.6.0 beta

   Older version 1.3.3 available here:
     https://github.com/trondn/memcached.git

   Building Memcached on Windows is not difficult:
     http://trondn.blogspot.de/2010/03/building-memcached-windows.html

   Build x64 version if you need more than 4GB of memory per instance

   Prebuilt binaries:
     http://www.cloudbasesolutions.com/downloads/memcached_x86_1_3_3.zip
     http://www.cloudbasesolutions.com/downloads/memcached_x86_1_6_0_beta1.zip
Installing Memcached on
              Windows
 The best way is to run it as a service
 We can use e.g. Apache Procrun to wrap it
   http://www.apache.org/dist/commons/daemon/binaries/windows
     /

 For security reasons don’t use an account like Administrator
  or System to run it!
 Open the required firewall port(s)
   Default: 11211
 Limit the client IP range as a best practice
 If possible use SASL for authentication
Script 1/2
 Create user:
   net user memcached yourpassword /add
   wmic path Win32_UserAccount where
     Name='memcached' set PasswordExpires=false

 Set service rights
   note: using free Windows 2003 Resource Kit
   ntrights –u memcached +r SeServiceLogonRight
   ntrights –u memcached +r SeBatchLogonRight
Script 2/2
 Create Windows service using Apache Procrun
  prunsrv install memcached --Startup=auto --StartMode=exe
  --StartImage="c:memcachedmemcached.exe"
  ++StartParams=-p;11211;-m;256;-l;127.0.0.1
  --ServiceUser=.memcached --ServicePassword=yourpassword

 For remote host access
   Remove “–l 127.0.0.1”
   Open firewall port
      netsh advfirewall firewall add rule name="memcached" dir=in
       action=allow protocol=TCP localport=11211

 Start service
   net start memcached
Memcached and PHP
 It requires a PECL extension, two are available:
   Memcache
     Win32 binary: http://downloads.php.net/pierre/
   Memcached
     More advanced

 Drupal works with both
Memcached protocol
 Memcache can use an ascii (default) or binary protocol
  (faster)
 Binary protocol supported from version 1.3
 Memcache PECL extension:
   PHP.INI
     memcache.protocol = binary
 Memcached PECL extension:
   Drupal settings.php
     $conf['memcache_options'] = array(
      Memcached::OPT_BINARY_PROTOCOL => TRUE,
     );
Memcached and Drupal 7
 drush @Drupal7 dl memcache
 In “sitesallmodulesmemcachedmemcache.inc”:
    comment //drupal_set_message(t('You must enable the PECL memcached
      or memcache extension to use memcache.inc.'), 'error');

 drush @Drupal7 -y en memcache_admin
 In settings.php
    $conf['cache_backends'][] =
     'sites/all/modules/memcache/memcache.inc';
    $conf['cache_default_class'] = 'MemCacheDrupal';
    $conf['memcache_key_prefix'] = 'drupal7';

 You can now setup separate bins and servers
    Examples: http://drupal.org/node/1131468
Apache Solr
 Open source search platform
   Full text search
   Optimized for high volume web traffic
   Based on Apache Lucene
 Download version 3.5.0 from:
   http://www.apache.org/dyn/closer.cgi/lucene/solr
Solr, Windows and Drupal 7
 Drupal
   drush @Drupal7 dl apachesolr

 Expand the content of “example” in                     “apache-
  solr-3.5.0.zip“ to e.g. c:Solr

 Move c:SolrSolrConf folder to c:SolrConf
   Replace solrconfig.xml and schema.xml and
     protwords.txt with copies from:
      <drupal site>sitesallmodulesapachesolrsolr-conf
        Version 3.x: solrconfig-solr3x.xml schema-solr3x.xml
Create Windows Solr user
 net user solr yourpassword /add
 wmic path Win32_UserAccount where Name='solr'
  set PasswordExpires=false

 ntrights -u solr +r SeServiceLogonRight
 ntrights -u solr +r SeBatchLogonRight
 Set proper folder permissions
   icacls c:solr /inheritance:d /grant solr:(OI)(CI)(F)
    /remove Users
Create Windows service
 Download and install Java JRE 7
      http://www.oracle.com/technetwork/java/javase/downloads/index.html

 Using Apache Procrun x64:
 prunsrv install solr --Startup=auto --StartMode=jvm ++JvmOptions=-
   Dsolr.solr.home=C:/solr/;-Djetty.home=C:/solr/;-Djetty.logs=C:/solr/logs/ -
   -ServiceUser=.solr –ServicePassword=yourpassword --
   Classpath=C:/solr/lib/*.jar;C:/solr/start.jar --
   StartClass=org.mortbay.start.Main

 Start service
      Net start solr

 Open firewall port if remote access is required
      netsh advfirewall firewall add rule name="solr" dir=in action=allow protocol=TCP
       localport=8983
Setup Drupal 7 Solr search
 Enable solr search module:
   drush @drupal7 en –y apachesolr_search
 http://yourdrupalsite/admin/config/search/settings
   Set Apache Solr Search as the only active search module
   Set Apache Solr Search as the default search module
 http://drupal7/admin/config/search/apachesolr/settings
   Set your Solr url, e.g.: http://solrserver:8983/solr
Autocommit maxTime
 Default settings is 120s
 In Drupal, this means that after your data changes are
    received by Solr, your search results will not be
    updated for 2 minutes

 To have a shorter delay (e.g. 20s) change maxTime in
    solrconfig.xml (in ms):

       <maxTime>20000</maxTime>
Drupal cron
 Drupal sends data to Solr for indexing using cron
   This might provide big delays between data changes
 Download elysia_cron module
   drush @drupal7 dl elysia_cron
   drush @drupal7 en elysia_cron –y
 Set cron scheduling as:
   Never / Use external crontab
 Set apachesolr_cron settings to (e.g. every 2’)
   */2 * * * *
“crontab” on Windows
 Windows uses scheduled tasks instead of crontab
 To create a scheduled task for Drupal elysia_cron to run e.g. every
   2’:

 schtasks.exe /create /tn drupal7_cron /tr "wget -O - -q -t 1
   http://drupal7/sites/all/modules/elysia_cron/cron.php?cron_ke
   y=yourcronkey" /sc MINUTE /mo 2 /ru solr /rp
    put wget.exe in the path
    Get your cron key from:
          http://yourdrupalsite/admin/config/system/cron/settings

 To run the task once (troubleshooting, etc):
   schtasks.exe /run /tn drupal7_cron
 To delete the task:
   schtasks.exe /delete /tn drupal7_cron
Drush integration

 drush @drupal7 solr-search something
 drush @drupal7 solr-index
 drush @drupal7 solr-reindex
 drush @drupal7 solr-delete-index

More Related Content

What's hot

linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624Johan De Wit
 
PuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, Puppet
PuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, PuppetPuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, Puppet
PuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, PuppetPuppet
 
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitPrivileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitVishal Kumar
 
Step by step_linux_guide
Step by step_linux_guideStep by step_linux_guide
Step by step_linux_guidevinod31dec
 
Making the secure communication between Server and Client with https protocol
Making the secure communication between Server and Client with https protocolMaking the secure communication between Server and Client with https protocol
Making the secure communication between Server and Client with https protocolArmenuhi Abramyan
 
Auditing System Password Using L0phtcrack
Auditing System Password Using L0phtcrackAuditing System Password Using L0phtcrack
Auditing System Password Using L0phtcrackVishal Kumar
 
Contoh Soal LKS IT Network 2014 Di Palembang Modul 3
Contoh Soal LKS IT Network 2014 Di Palembang Modul 3Contoh Soal LKS IT Network 2014 Di Palembang Modul 3
Contoh Soal LKS IT Network 2014 Di Palembang Modul 3Vanidlesky Onibala
 
Dumping and Cracking SAM Hashes to Extract Plaintext Passwords
Dumping and Cracking SAM Hashes to Extract Plaintext PasswordsDumping and Cracking SAM Hashes to Extract Plaintext Passwords
Dumping and Cracking SAM Hashes to Extract Plaintext PasswordsVishal Kumar
 
55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines55 best linux tips, tricks and command lines
55 best linux tips, tricks and command linesArif Wahyudi
 

What's hot (16)

Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014
 
Samba tutorial
Samba tutorialSamba tutorial
Samba tutorial
 
Oracle on Solaris
Oracle on SolarisOracle on Solaris
Oracle on Solaris
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624
 
PuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, Puppet
PuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, PuppetPuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, Puppet
PuppetConf 2016: Puppet 4.x: The Low WAT-tage Edition – Nick Fagerlund, Puppet
 
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using MetasploitPrivileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
 
Changes
ChangesChanges
Changes
 
Step by step_linux_guide
Step by step_linux_guideStep by step_linux_guide
Step by step_linux_guide
 
Making the secure communication between Server and Client with https protocol
Making the secure communication between Server and Client with https protocolMaking the secure communication between Server and Client with https protocol
Making the secure communication between Server and Client with https protocol
 
Auditing System Password Using L0phtcrack
Auditing System Password Using L0phtcrackAuditing System Password Using L0phtcrack
Auditing System Password Using L0phtcrack
 
Contoh Soal LKS IT Network 2014 Di Palembang Modul 3
Contoh Soal LKS IT Network 2014 Di Palembang Modul 3Contoh Soal LKS IT Network 2014 Di Palembang Modul 3
Contoh Soal LKS IT Network 2014 Di Palembang Modul 3
 
Dumping and Cracking SAM Hashes to Extract Plaintext Passwords
Dumping and Cracking SAM Hashes to Extract Plaintext PasswordsDumping and Cracking SAM Hashes to Extract Plaintext Passwords
Dumping and Cracking SAM Hashes to Extract Plaintext Passwords
 
Refcard en-a4
Refcard en-a4Refcard en-a4
Refcard en-a4
 
55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines
 
Wissbi osdc pdf
Wissbi osdc pdfWissbi osdc pdf
Wissbi osdc pdf
 

Viewers also liked

[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal ConsoleSrijan Technologies
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationAmeex Technologies
 
Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013Jon Peck
 
Getting started with Drupal 8
Getting started with Drupal 8Getting started with Drupal 8
Getting started with Drupal 8Hector Iribarne
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилPVasili
 
Managing Drupal on Windows with Drush
Managing Drupal on Windows with DrushManaging Drupal on Windows with Drush
Managing Drupal on Windows with DrushAlessandro Pilotti
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptPromet Source
 
Drush Presentation
Drush PresentationDrush Presentation
Drush Presentationperceptum
 
Drush workshop
Drush workshopDrush workshop
Drush workshopJuampy NR
 
Drush installation guide
Drush installation guideDrush installation guide
Drush installation guideThierno Fall
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalPantheon
 
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)Francisco José Seva Mora
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistranolibsys
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8nagpalprachi
 
Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Alex S
 
[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8DrupalDay
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Developmentjcarrig
 

Viewers also liked (17)

[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 Migration
 
Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013Drush for humans - SANDcamp 2013
Drush for humans - SANDcamp 2013
 
Getting started with Drupal 8
Getting started with Drupal 8Getting started with Drupal 8
Getting started with Drupal 8
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
 
Managing Drupal on Windows with Drush
Managing Drupal on Windows with DrushManaging Drupal on Windows with Drush
Managing Drupal on Windows with Drush
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.ppt
 
Drush Presentation
Drush PresentationDrush Presentation
Drush Presentation
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
 
Drush installation guide
Drush installation guideDrush installation guide
Drush installation guide
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for Drupal
 
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistrano
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
 
Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014
 
[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8[drupalday2017] - DevOps: strumenti di automazione per Drupal8
[drupalday2017] - DevOps: strumenti di automazione per Drupal8
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
 

Similar to Drupal, Memcached and Solr on Windows

Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Ben Hall
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guideSeungmin Shin
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsManuel Vega
 
How to create a secured cloudera cluster
How to create a secured cloudera clusterHow to create a secured cloudera cluster
How to create a secured cloudera clusterTiago Simões
 
Mitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptxMitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptxwaizuq
 
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012Scott Sutherland
 
Lab Manual Managed Database Basics
Lab Manual Managed Database BasicsLab Manual Managed Database Basics
Lab Manual Managed Database BasicsAmazon Web Services
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila
 
Building a Gateway Server
Building a Gateway ServerBuilding a Gateway Server
Building a Gateway ServerDashamir Hoxha
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker皓鈞 張
 
Docker security
Docker securityDocker security
Docker securityJanos Suto
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linuxVicent Selfa
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context ConstraintsAlessandro Arrichiello
 
Prosit google-cloud
Prosit google-cloudProsit google-cloud
Prosit google-cloudUC Davis
 
CCCEU15 run cloudstack in docker
CCCEU15 run cloudstack in dockerCCCEU15 run cloudstack in docker
CCCEU15 run cloudstack in dockerPierre-Luc Dion
 
CloudStack Collab Conference 2015 Run CloudStack in Docker
CloudStack Collab Conference 2015 Run CloudStack in DockerCloudStack Collab Conference 2015 Run CloudStack in Docker
CloudStack Collab Conference 2015 Run CloudStack in DockerCloudOps2005
 
Docker Security Paradigm
Docker Security ParadigmDocker Security Paradigm
Docker Security ParadigmAnis LARGUEM
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 

Similar to Drupal, Memcached and Solr on Windows (20)

Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
 
How to create a secured cloudera cluster
How to create a secured cloudera clusterHow to create a secured cloudera cluster
How to create a secured cloudera cluster
 
Mitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptxMitre Attack - Credential Dumping - updated.pptx
Mitre Attack - Credential Dumping - updated.pptx
 
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
 
Lab Manual Managed Database Basics
Lab Manual Managed Database BasicsLab Manual Managed Database Basics
Lab Manual Managed Database Basics
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)
 
Building a Gateway Server
Building a Gateway ServerBuilding a Gateway Server
Building a Gateway Server
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker security
Docker securityDocker security
Docker security
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
Prosit google-cloud
Prosit google-cloudProsit google-cloud
Prosit google-cloud
 
CCCEU15 run cloudstack in docker
CCCEU15 run cloudstack in dockerCCCEU15 run cloudstack in docker
CCCEU15 run cloudstack in docker
 
CloudStack Collab Conference 2015 Run CloudStack in Docker
CloudStack Collab Conference 2015 Run CloudStack in DockerCloudStack Collab Conference 2015 Run CloudStack in Docker
CloudStack Collab Conference 2015 Run CloudStack in Docker
 
Docker Security Paradigm
Docker Security ParadigmDocker Security Paradigm
Docker Security Paradigm
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
TO Hack an ASP .NET website?
TO Hack an ASP .NET website?  TO Hack an ASP .NET website?
TO Hack an ASP .NET website?
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 

More from Alessandro Pilotti

OpenStack and Windows - What's new in Ocata
OpenStack and Windows - What's new in OcataOpenStack and Windows - What's new in Ocata
OpenStack and Windows - What's new in OcataAlessandro Pilotti
 
Strategies for migrating workloads from VMware to OpenStack
Strategies for migrating workloads from VMware to OpenStackStrategies for migrating workloads from VMware to OpenStack
Strategies for migrating workloads from VMware to OpenStackAlessandro Pilotti
 
OpenStack + Nano Server + Hyper-V + S2D
OpenStack + Nano Server + Hyper-V + S2DOpenStack + Nano Server + Hyper-V + S2D
OpenStack + Nano Server + Hyper-V + S2DAlessandro Pilotti
 
Building a Microsoft cloud with open technologies
Building a Microsoft cloud with open technologiesBuilding a Microsoft cloud with open technologies
Building a Microsoft cloud with open technologiesAlessandro Pilotti
 
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsOpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsAlessandro Pilotti
 
Interoperable OpenStack guest provisioning with Cloudbase-Init
Interoperable OpenStack guest provisioning with Cloudbase-InitInteroperable OpenStack guest provisioning with Cloudbase-Init
Interoperable OpenStack guest provisioning with Cloudbase-InitAlessandro Pilotti
 
An HTML5 client to connect to the Hyper-V console
An HTML5 client to connect to the Hyper-V consoleAn HTML5 client to connect to the Hyper-V console
An HTML5 client to connect to the Hyper-V consoleAlessandro Pilotti
 
Hyper-V OpenStack Nova Compute
Hyper-V OpenStack Nova ComputeHyper-V OpenStack Nova Compute
Hyper-V OpenStack Nova ComputeAlessandro Pilotti
 
PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsPHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsAlessandro Pilotti
 
Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1Alessandro Pilotti
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalAlessandro Pilotti
 

More from Alessandro Pilotti (14)

OpenStack and Windows - What's new in Ocata
OpenStack and Windows - What's new in OcataOpenStack and Windows - What's new in Ocata
OpenStack and Windows - What's new in Ocata
 
Strategies for migrating workloads from VMware to OpenStack
Strategies for migrating workloads from VMware to OpenStackStrategies for migrating workloads from VMware to OpenStack
Strategies for migrating workloads from VMware to OpenStack
 
Puppet + Windows Nano Server
Puppet + Windows Nano ServerPuppet + Windows Nano Server
Puppet + Windows Nano Server
 
OpenStack + Nano Server + Hyper-V + S2D
OpenStack + Nano Server + Hyper-V + S2DOpenStack + Nano Server + Hyper-V + S2D
OpenStack + Nano Server + Hyper-V + S2D
 
Building a Microsoft cloud with open technologies
Building a Microsoft cloud with open technologiesBuilding a Microsoft cloud with open technologies
Building a Microsoft cloud with open technologies
 
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and WindowsOpenStack Summit 2013 Hong Kong - OpenStack and Windows
OpenStack Summit 2013 Hong Kong - OpenStack and Windows
 
Interoperable OpenStack guest provisioning with Cloudbase-Init
Interoperable OpenStack guest provisioning with Cloudbase-InitInteroperable OpenStack guest provisioning with Cloudbase-Init
Interoperable OpenStack guest provisioning with Cloudbase-Init
 
OpenStack and Windows
OpenStack and WindowsOpenStack and Windows
OpenStack and Windows
 
An HTML5 client to connect to the Hyper-V console
An HTML5 client to connect to the Hyper-V consoleAn HTML5 client to connect to the Hyper-V console
An HTML5 client to connect to the Hyper-V console
 
Hyper-V OpenStack Nova Compute
Hyper-V OpenStack Nova ComputeHyper-V OpenStack Nova Compute
Hyper-V OpenStack Nova Compute
 
PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsPHP and FastCGI Performance Optimizations
PHP and FastCGI Performance Optimizations
 
Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1Building drupal web farms with IIS - part 1
Building drupal web farms with IIS - part 1
 
Windows Loves drupal
Windows Loves drupalWindows Loves drupal
Windows Loves drupal
 
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignalBuilding modern web sites with ASP .Net Web API, WebSockets and RSignal
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Drupal, Memcached and Solr on Windows

  • 1. Drupal, Memcached and Solr on Windows Alessandro Pilotti @alexpilotti MVP ASP.NET / IIS MCSD, MCAD, MCSE, MCDBA, MCT Red Hat Certified Engineer
  • 2. Why Memcached?  It’s a very popular object caching system  To speed up web sites by offloading work from the DBMS  Simple key / value store with cache invalidation  Low CPU usage  Half client / half server  Servers are unaware of each other (no sync)
  • 3. Memcached on Windows  Memcached supports *nix daemon mode  Ports for Windows exist  Most binaries available on the web are old (1.2.x)  The official git repository contains a Windows compatible branch  git clone --branch engine-pu https://github.com/memcached/memcached.git  Currently version 1.6.0 beta  Older version 1.3.3 available here:  https://github.com/trondn/memcached.git  Building Memcached on Windows is not difficult:  http://trondn.blogspot.de/2010/03/building-memcached-windows.html  Build x64 version if you need more than 4GB of memory per instance  Prebuilt binaries:  http://www.cloudbasesolutions.com/downloads/memcached_x86_1_3_3.zip  http://www.cloudbasesolutions.com/downloads/memcached_x86_1_6_0_beta1.zip
  • 4. Installing Memcached on Windows  The best way is to run it as a service  We can use e.g. Apache Procrun to wrap it  http://www.apache.org/dist/commons/daemon/binaries/windows /  For security reasons don’t use an account like Administrator or System to run it!  Open the required firewall port(s)  Default: 11211  Limit the client IP range as a best practice  If possible use SASL for authentication
  • 5. Script 1/2  Create user:  net user memcached yourpassword /add  wmic path Win32_UserAccount where Name='memcached' set PasswordExpires=false  Set service rights  note: using free Windows 2003 Resource Kit  ntrights –u memcached +r SeServiceLogonRight  ntrights –u memcached +r SeBatchLogonRight
  • 6. Script 2/2  Create Windows service using Apache Procrun prunsrv install memcached --Startup=auto --StartMode=exe --StartImage="c:memcachedmemcached.exe" ++StartParams=-p;11211;-m;256;-l;127.0.0.1 --ServiceUser=.memcached --ServicePassword=yourpassword  For remote host access  Remove “–l 127.0.0.1”  Open firewall port  netsh advfirewall firewall add rule name="memcached" dir=in action=allow protocol=TCP localport=11211  Start service  net start memcached
  • 7. Memcached and PHP  It requires a PECL extension, two are available:  Memcache  Win32 binary: http://downloads.php.net/pierre/  Memcached  More advanced  Drupal works with both
  • 8. Memcached protocol  Memcache can use an ascii (default) or binary protocol (faster)  Binary protocol supported from version 1.3  Memcache PECL extension:  PHP.INI  memcache.protocol = binary  Memcached PECL extension:  Drupal settings.php $conf['memcache_options'] = array( Memcached::OPT_BINARY_PROTOCOL => TRUE, );
  • 9. Memcached and Drupal 7  drush @Drupal7 dl memcache  In “sitesallmodulesmemcachedmemcache.inc”:  comment //drupal_set_message(t('You must enable the PECL memcached or memcache extension to use memcache.inc.'), 'error');  drush @Drupal7 -y en memcache_admin  In settings.php  $conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';  $conf['cache_default_class'] = 'MemCacheDrupal';  $conf['memcache_key_prefix'] = 'drupal7';  You can now setup separate bins and servers  Examples: http://drupal.org/node/1131468
  • 10. Apache Solr  Open source search platform  Full text search  Optimized for high volume web traffic  Based on Apache Lucene  Download version 3.5.0 from:  http://www.apache.org/dyn/closer.cgi/lucene/solr
  • 11. Solr, Windows and Drupal 7  Drupal  drush @Drupal7 dl apachesolr  Expand the content of “example” in “apache- solr-3.5.0.zip“ to e.g. c:Solr  Move c:SolrSolrConf folder to c:SolrConf  Replace solrconfig.xml and schema.xml and protwords.txt with copies from:  <drupal site>sitesallmodulesapachesolrsolr-conf  Version 3.x: solrconfig-solr3x.xml schema-solr3x.xml
  • 12. Create Windows Solr user  net user solr yourpassword /add  wmic path Win32_UserAccount where Name='solr' set PasswordExpires=false  ntrights -u solr +r SeServiceLogonRight  ntrights -u solr +r SeBatchLogonRight  Set proper folder permissions  icacls c:solr /inheritance:d /grant solr:(OI)(CI)(F) /remove Users
  • 13. Create Windows service  Download and install Java JRE 7  http://www.oracle.com/technetwork/java/javase/downloads/index.html  Using Apache Procrun x64:  prunsrv install solr --Startup=auto --StartMode=jvm ++JvmOptions=- Dsolr.solr.home=C:/solr/;-Djetty.home=C:/solr/;-Djetty.logs=C:/solr/logs/ - -ServiceUser=.solr –ServicePassword=yourpassword -- Classpath=C:/solr/lib/*.jar;C:/solr/start.jar -- StartClass=org.mortbay.start.Main  Start service  Net start solr  Open firewall port if remote access is required  netsh advfirewall firewall add rule name="solr" dir=in action=allow protocol=TCP localport=8983
  • 14. Setup Drupal 7 Solr search  Enable solr search module:  drush @drupal7 en –y apachesolr_search  http://yourdrupalsite/admin/config/search/settings  Set Apache Solr Search as the only active search module  Set Apache Solr Search as the default search module  http://drupal7/admin/config/search/apachesolr/settings  Set your Solr url, e.g.: http://solrserver:8983/solr
  • 15. Autocommit maxTime  Default settings is 120s  In Drupal, this means that after your data changes are received by Solr, your search results will not be updated for 2 minutes  To have a shorter delay (e.g. 20s) change maxTime in solrconfig.xml (in ms):  <maxTime>20000</maxTime>
  • 16. Drupal cron  Drupal sends data to Solr for indexing using cron  This might provide big delays between data changes  Download elysia_cron module  drush @drupal7 dl elysia_cron  drush @drupal7 en elysia_cron –y  Set cron scheduling as:  Never / Use external crontab  Set apachesolr_cron settings to (e.g. every 2’)  */2 * * * *
  • 17. “crontab” on Windows  Windows uses scheduled tasks instead of crontab  To create a scheduled task for Drupal elysia_cron to run e.g. every 2’:  schtasks.exe /create /tn drupal7_cron /tr "wget -O - -q -t 1 http://drupal7/sites/all/modules/elysia_cron/cron.php?cron_ke y=yourcronkey" /sc MINUTE /mo 2 /ru solr /rp  put wget.exe in the path  Get your cron key from:  http://yourdrupalsite/admin/config/system/cron/settings  To run the task once (troubleshooting, etc):  schtasks.exe /run /tn drupal7_cron  To delete the task:  schtasks.exe /delete /tn drupal7_cron
  • 18. Drush integration  drush @drupal7 solr-search something  drush @drupal7 solr-index  drush @drupal7 solr-reindex  drush @drupal7 solr-delete-index