Link-Love, Programming, SEO, Theory, Tools & Applications

Effective and Efficient ways to Mass Install Wordpress

Blah…commencement of pleasantries…..blah blah….witty charming banter….blaah….introduction to mass install wordpress..blaaah……more witty commentary….blah blah…..install this…ftp that…blah…incredibly complicated….blah..self aggrandizement….blah……

Situation:
Shared Host
CPanel
No SSH Access

Solution 1: FTP Transfer FolderĀ  to server, Mechanize/CURL Install
Process:

1) Collect variables: database, username, cpanel login, cpanel password, keywords

2) If necessary, create databases and users on CPanel host (using CURL, or Mechanize)

Here is a function I use to create CPanel DBs:
def self.create_db(base_url, cpanel_loc, cpanel_user, cpanel_pass, db, dbuser, dbpass)
agent = WWW::Mechanize.new
agent.user_agent_alias = $USER_AGENTS[rand($USER_AGENTS.length)]
agent.basic_auth(cpanel_user,cpanel_pass)
url = “http://#{base_url}#{cpanel_loc}/frontend/x/sql/”
agent.get(url)
agent.get(”#{url}adddb.html?db=#{db}”)
agent.get(”#{url}adduser.html?user=#{dbuser}&pass=#{dbpass}”)
agent.get(”#{url}addusertodb.html?user=#{cpanel_user}_#{dbuser}&db=#{cpanel_user}_#{db}&ALL=ALL”)
end

3) For each keyword in the keyword list, create a different blog

3a) Write local wordpress-config file with user entered data

3b) Pull a random theme from local theme library

3c) Pull required plugins from local plugin library

3d) Create local folder for blog, copy base wordpress install files, plus files from 3a,3b,3c

4) Begin FTP Transfer of files from master server to destination on install server (Thread this process to speed up)

5) Mechanize/CURL to appropriate Install URL, then Mechanize/CURL through management panel to activate theme selected in 3b and plugins selected in 3c

*Repeat step 3 for each keyword supplied to the function

NOTES: This method, when optimized and threaded, can install about one blog / 90 seconds. The major speed limiting factor is the FTP transferring. A base wordpress install already has a TON of files, and depending on how many plugins and how many themes you are including, the number of files really slows down the FTP transfer. I recommend creating a personal WP base install with ALL of the junk and cruft removed (ie: the management panel niceities like password strength checking etc..). Removing all non-essential files from a wordpress base install can really speed up FTP transfers. This is a good practice anyways, since we want to be as resource efficient as possible, since we’re going to cram this shared server with nothing but blogs.

Solution 2: FTP package file to server, extract through file manager, Mechanize/CURL Install
Process:

1) Collect variables: database, username, cpanel login, cpanel password, keywords

2) If necessary, create databases and users on CPanel host (using CURL, or Mechanize)

3) For each keyword in the keyword list, create a different blog

3a) Write local wordpress-config file with user entered data

3b) Pull a random theme from local theme library

3c) Pull required plugins from local plugin library

3d) Create local folder for blog, copy base wordpress install files, plus files from 3a,3b,3c

3e) Package folder

4) FTP Transfer Package from master server to destination on install server

5) Mechanize or CURL CPanel Filemanager to unzip file on server

6) Mechanize/CURL to appropriate Install URL, then Mechanize/CURL through management panel to activate theme selected in 3b and plugins selected in 3c

*Repeat step 3 for each keyword supplied to the function

NOTES: This method, when optimized and threaded, can install one in about 25 seconds. Once again, the major impediment to speed here is the FTP transfer. This is still a lot faster than Solution 1, and is perhaps the best solution for a situation where you can’t use SSH. I should note that you could also just create one central tarball and then mechanize/CURL the CPanel File Manager to copy and unzip it for each new install, but…I really hate to use that amount of screen automation. It just tends to break down so often.

Situation:
Shared / VPN Server
CPanel
SSH Access

Solution 1: Master Server Central Wordpress Install / Mechanize CURL Install
Process:
1) Upload base Wordpress install files, Theme Library, Plugin Library from master server to central location on install server
2) Create a deployment file that does the following:
2a) Copy base Wordpress install to destination folder using SSH
2b) Set up symbolic links between destination install themes & plugins, with the central libraries uploaded in step 1.
2c) If necessary, create databases and users
2d) Create Wordpress Config file based on information supplied by master server
3) Mechanize/CURL to appropriate Install URL, then Mechanize/CURL through management panel to activate desired theme & plugins.
* For each blog you wish to install, just upload a new deployment file

NOTES: Once you have installed the central libraries, this method is extremely fast.

CONCLUSIONS: At the end of the day, it is definitely faster and more space efficient if you have SSH access through which you can automate the install process. Unfortunately, many shared hosts don’t offer SSH access (some offer it only if you provide some form of government identification). Many people go for shared hosting situations because they are very cheap, low-risk and you can afford to buy many different hosting packages with different IP addresses. For people who are running more sophisticated networks and have greater resources, VPS situations (without CPanel) are preferable, since they are more stable with more available resources, and of course, SSH, which really makes automation a breeze.

Automating the deployment and install of Wordpress blogs can be a really frustrating process to wade through. That said, ..blah….blah…and…gratifying….blah…1000 blogs….blah blah…button click….bla
h…elite spammer…blah blah

some posts that may be related

6 Comments

speak up

Add your comment below.

Subscribe to these comments.

*Required Fields