• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Automate WordPress Installation With Puppet (Ubuntu, Rackspace Cloud Server)

By Abhishek Ghosh October 25, 2014 8:29 am Updated on October 25, 2014

Automate WordPress Installation With Puppet (Ubuntu, Rackspace Cloud Server)

Advertisement

We can automate WordPress installation with Puppet running on Ubuntu instance on Rackspace Cloud Server for our own multiple WordPress sites. In the age of cloud automation and for this scenario, lesser need of abstraction makes the idea near ideal depending upon the number of websites.

 

Why Automate WordPress Installation With Puppet on Rackspace Cloud Server?

 

Why automate WordPress Installation with Puppet on Rackspace Cloud Server when OpenStack Heat Template Exists? Because OpenStack Heat can not give you the fine granular control for your personalized need? No. Puppet and OpenStack Heat Template, can not be compared so bravely. OpenStack Heat Template is an orchestration tool for managing stacks or applications deployed on Rackspace cloud. Packaging can also be installed via OpenStack Heat Templates to do things like deploying a stack and make it a 4 node WordPress cluster.
Puppet is client-server based. Puppetmaster and Puppet Clients. Declarative Language for write once deploy many. Puppet has open-source Openstack Packages for on-demand Openstack Delivery/Configuration Version control. Deployment of monitoring tools, security tools all possible within private cloud.

That is said, but you can, in many cases should, use both types of tools together. There are also valid strategies for deploying some applications using Heat alone.

Advertisement

---

Automate WordPress Installation With Puppet (Ubuntu, Rackspace Cloud Server)

 

Why Automate WordPress Installation With Puppet on Rackspace Cloud Server?

 

It is not acceptable to think that you are a newbie to install WordPress from Command Line. In this tutorial we will create a Puppet module that can install Apache, MySQL; add a database and a database user on MySQL for WordPress and configure WordPress. It is a kind o template for your need.

We can not downgrade from a server Image – this must be understood. If we could easily use one VHD image optimized for 2 GB instance for 512 MB device, we would never need it. So, this kind of setup is only required when multiple 512, 1 GB, 2 GB to 512 GB Bare Metal installation is needed. Otherwise, the amount of work will not give significant advantage.

First step is to download and install Puppet :

Vim
1
2
3
4
5
6
mkdir -p ~/Downloads && cd ~/Downloads
wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
sudo dpkg -i puppetlabs-release-trusty.deb
apt-get update -y && apt-get install puppet
puppet --version
# output

Next we need to set the configuration file to install the components needed to run WordPress :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
nano /etc/puppet/puppet.conf
*** This Should Look Like This ***
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
 
[master]
 
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
*** Example Ends Above This ***

Now install MySQL and Apache :

Vim
1
2
3
4
puppet module install puppetlabs-apache
puppet module install puppetlabs-mysql
# check the list of stuffs
puppet module list

Add modules for WordPress :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
mkdir -p ~/MyModules && cd ~/MyModules
puppet module generate do-wordpress --skip-interview
# do-wordpress is just a name
# if you do not include `--skip-interview`
# you'll face interactive mode
# do-wordpress is a directory, you can cd and do ls to check
# it
nano ~/MyModules/do-wordpress/metadata.json
*** It Should Look Like This ***
{
  "name": "do-wordpress",
  "version": "0.1.0",
  "author": "do",
  "summary": null,
  "license": "Apache 2.0",
  "source": "",
  "project_page": null,
  "issues_url": null,
  "dependencies": [
    {"name":"puppetlabs/stdlib","version_requirement":">= 1.0.0"}
  ]
}
*** Example Ends Above This Line ***
# we will use prefork
nano ~/MyModules/do-wordpress/manifests/web.pp
*** It Should Look Like This ***
class wordpress::web {
    class {'apache':
        mpm_module => 'prefork'
    }
 
    class {'::apache::mod::php': }
}
# configuration for php and apache2
*** Example Ends Above This Line ***
# we will modify the .conf
nano ~/MyModules/do-wordpress/manifests/conf.pp
*** It Should Look Like This But Values Should Be Changed ***
class wordpress::conf {
    # You can change the values of these variables
    # according to your preferences
 
    $root_password = 'password'
    $db_name = 'wordpress'
    $db_user = 'wordpressuser'
    $db_user_password = 'password'
    $db_host = 'localhost'
    $db_user_host = "${db_user}@${db_host}"
 
    # notice the .*
    $db_user_host_db = "${db_user}@${db_host}/${db_name}.*"
}
*** Example Ends Above This Line ***
# same for MySQL
nano ~/MyModules/do-wordpress/manifests/db.pp
*** It Should Look Like This But Values Should Be Changed ***
class wordpress::db {
 
    class { '::mysql::server':
 
        # we are defining => password, user, privileges and bind
 
        root_password => $wordpress::conf::root_password,
 
        databases => {
            "${wordpress::conf::db_name}" => {
                ensure => 'present',
                charset => 'utf8'
            }
        },
        users => {
            "${wordpress::conf::db_user_host}" => {
                ensure => present,
                password_hash => mysql_password("${wordpress::conf::db_user_password}")
            }
        },
        grants => {
            "${wordpress::conf::db_user_host_db}" => {
                ensure     => 'present',
                options    => ['GRANT'],
                privileges => ['ALL'],
                table      => "${wordpress::conf::db_name}.*",
                user       => "${wordpress::conf::db_user_host}",
            }
        },
    }
 
    # we can toggle binding at my.cnf
    class { '::mysql::client':
        require => Class['::mysql::server'],
        bindings_enable => true
    }
}
*** Example Ends Above This Line ***

Backend is ready, we can install WordPress now :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
mkdir -p ~/MyModules/do-wordpress/files && cd ~/MyModules/do-wordpress/files
mkdir -p ~/MyModules/do-wordpress/templates && cd /tmp
tar -xvzf ~/MyModules/do-wordpress/files/latest.tar.gz && cp /tmp/wordpress/wp-config-sample.php ~/MyModules/do-wordpress/templates/wp-config.php.erb
rm -rf /tmp/wordpress* latest* && nano ~/MyModules/do-wordpress/templates/wp-config.php.erb
# copy paste this gist and write out with ^ + O
https://gist.github.com/AbhishekGhosh/85dd163c5d70a78f8d7e
# here is the raw
https://gist.githubusercontent.com/AbhishekGhosh/85dd163c5d70a78f8d7e/raw/6ad6531ef9c82bac7a017c1dd6191821e45498fb/puppet-wordpress-multi.php
# edit the wordpress specific file
nano ~/MyModules/do-wordpress/manifests/wp.pp
*** Example Starts Below This Line ***
class wordpress::wp {
    file { '/tmp/latest.tar.gz':
        ensure => present,
        source => "puppet:///modules/wordpress/latest.tar.gz"
    }
    exec { 'extract':
        cwd => "/tmp",
        command => "tar -xvzf latest.tar.gz",
        require => File['/tmp/latest.tar.gz'],
        path => ['/bin'],
    }
    exec { 'copy':
        command => "cp -r /tmp/wordpress/* /var/www/",
        require => Exec['extract'],
        path => ['/bin'],
    }
    file { '/var/www/wp-config.php':
        ensure => present,
        require => Exec['copy'],
        content => template("wordpress/wp-config.php.erb")
    }
}
*** Example Ends Above This Line ***

Do not worry ! this is the last step :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
nano ~/MyModules/do-wordpress/manifests/init.pp
*** Example Starts Below This Line ***
 
class wordpress {
    class { 'wordpress::conf': }
    class { 'wordpress::web': }
    class { 'wordpress::db': }
    class { 'wordpress::wp':
        require => Notify['Apache Installation Done']
    }
    notify { 'MySQL Installation Done':
        require => Class['wordpress::db']
    }
    notify { 'Apache Installation Done':
        require => Class['wordpress::web']
    }
    notify { 'Wordpress Installation Done':
        require => Class['wordpress::wp']
    }
}
 
*** Example Ends Above This Line ***

Now build your package :

Vim
1
cd ~/MyModules && puppet module build do-wordpress

Now you can use it to install easily. To check the right name, cd to pkg directory :

Vim
1
2
3
4
5
6
7
8
9
10
cd ~/MyModules/do-wordpress/pkg/ && ls -al
# example command to install WordPress
puppet module install ~/MyModules/do-wordpress/pkg/do-wordpress-0.1.0.tar.gz
nano /tmp/install-wp.pp
# add this
class { 'wordpress':
}
# thats it
sudo puppet apply /tmp/install-wp.pp
# point to domain name or bare IP on browser

It is tested on Rackspace PVHVM 2 GB instance. It takes a bit time (~15 minutes) to get the custom setup installed.

Tagged With automate installation wordpress ubuntu , automate wp installation , installation of wordpress on puppet , wordpress pupet ubuntu

This Article Has Been Shared 905 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Automate WordPress Installation With Puppet (Ubuntu, Rackspace Cloud Server)

  • Rackspace Cloud Hosting Review : Suits Everyone’s Wallet

    Rackspace Cloud Hosting Review is intended for the users who are seeking a reliable Cloud Computing Platform or a reliance elegant managed Cloud Hosting.

  • Theoretical Foundations of Big Data : Part 2

    Theoretical Foundations of Big Data is second part of our series of articles. We have talked about data privacy & basics of data warehouse.

  • How Google Cloud Platform is Compared to IBM, OVH, DO, Linode?

    How Google Cloud Platform is When Compared to Other Cloud Webhosts IBM, OVH, DO, Linode? Not surprisingly not cost effective in terms of bench-marking.

  • Developer’s Guide : IBM Cloud’s Call for Code for Natural Disaster (Last Date : June 18, 2018)

    IBM invested huge $30 Million for Natural Disaster with prize. Here is some matters discussed around IBM Cloud’s Call for Code for the developers.

  • How to Install Apache Tika on Ubuntu Server

    Apache Tika is a Content Analysis Framework Which Can Be Configure With Web Software Like WordPress For Metadata Extraction of PDF, doc. Here is How to Install Apache Tika on Ubuntu Server.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023
  • Advantages of Cloud Server Over Dedicated Server for Hosting WordPress March 26, 2023
  • Get Audiophile-Grade Music on Your Smartphone March 25, 2023
  • Simple Windows Security and Privacy Checklist for 2023 March 24, 2023
  • 7 Best Artificial Intelligence (AI) Software March 24, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Automate WordPress Installation With Puppet (Ubuntu, Rackspace Cloud Server)," in The Customize Windows, October 25, 2014, March 28, 2023, https://thecustomizewindows.com/2014/10/automate-wordpress-installation-puppet-ubuntu-rackspace-cloud-server/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT