Automated WordPress Installation Via Custom Virtualmin Script Installer

WordPress (or any other script) can automatically install during Virtualmin > Create Virtual Server.

Virtualmin automatically creates users, MySQL database, and installs WordPress in the public_html root, then gives a link to the WordPress Installer. You can even create a custom installer with a set of plugins and themes.

To create a custom script installer with plugins and themes:

  • Download http://wordpress.org/latest.zip & unzip
    •   add some themes and plugins folders in /wp-content/
    •   zip as copy-of-latest.zip
  • Create a copy of /usr/libexec/webmin/virtual-server/scripts/wordpress.pl
    •   edit copy-of-wordpress.pl to give a new name: script_wordpress_desc “Custom WordPress”
    •   link to your zip: ‘url’ => “file://localhost/path/to/copy-of-latest.zip”,
  • Put copy-of-wordpress.pl in /usr/libexec/webmin/virtual-server/scripts/
  • Virtualmin > System Settings > Server Templates > Default Settings > Default Script Installers
    • Custom WordPress

If you want to have the script archive download from a protected web directory, that is also possible:

'url' => "http://repo.server.com/file-ver.zip", 'nocache' => 1, 'user' => "username", 'pass' => "password"

Incoming search terms for the article:

About Chris Gilligan

I’ve been building websites since the early days of the world wide web. My background is in publishing, document management, graphic design, corporate training and video production.

Socialize

Connect with Chris on social media...

, ,

22 Responses to Automated WordPress Installation Via Custom Virtualmin Script Installer

  1. Ken Reidy May 31, 2012 at 6:51 am #

    Hi Chris, thanks for sharing this short article. I Will try this tips since it’s look more easier than what I usually do on my vps server and my local testing server. I usually download WordPress latest.tar.gz and extract it into ‘etc/skel/wordpress/public_html’.

    I just know your blog and I think you have many posts that I can learned to improve my skill.

    BTW, sorry if my English isn’t good. I’m Indonesian.

  2. imam June 13, 2012 at 7:04 pm #

    It’s very interesting, we are usually manual install in Webmin-Virtualmin.
    Thanks

  3. Xray June 30, 2012 at 9:00 pm #

    I have the script installed and it is working with the exception of getting my custom wordpress.zip file. for some reason the script continues do download from scripts.virtualmin.com… How do I force the script to download from a local site or directory?

    • Chris Gilligan July 7, 2012 at 9:24 am #

      Try changing line 151 to:
      'url' => "file://localhost/path/to/mycustomwordpress.zip",
      You may want to read more about file URI scheme.

  4. Steve Wyman August 22, 2012 at 10:30 am #

    Hi

    neat for use on a virtual server environment.

    Could i also use this approach on a shared hosted environment such as hostgator.com?

    Im not a coder but understand systems well.

  5. Steve Wyman August 25, 2012 at 8:28 am #

    Hi Chris, thanks for letting me know.

    A shame :-(

    • Chris Gilligan August 25, 2012 at 8:58 am #

      That brings up an interesting point: why pay for a control panel when you can use Virtuamin GPL for free. You should look into getting your own inexpensive VPS, installing Virtualmin GPL and learning more about Linux Systems Administration. If you want a very inexpensive and reliable VPS provider, try SemoWeb. Load up a supported 64-bit OS, then install Virtualmin GPL.

      You will be surprised how easy it is to get up and running with Virtualmin, and if you have any questions, the Virtualmin forum is very helpful.

      I have a couple of Pro licenses, so I have access to all of the script installers, so I like to copy and customize the script installers, which work even on Virtualmin GPL, which includes a few… like WHMCS and phpMyAdmin.

    • Chris Gilligan August 30, 2012 at 12:23 pm #

      Steve, you would need to look into creating a customized Softaculous script for Cpanel… I do admin on a few Cpanel servers, but don’t really like them for several reasons… so have not yet done a custom Softaculous script… but it should be possible.

  6. Kevin Richard September 11, 2012 at 5:05 pm #

    Hi,

    Is this available only with Virtualmin Pro ?

    Thanks

    • Chris Gilligan September 11, 2012 at 5:24 pm #

      Script installers work with GPL as well. However, GPL only ships with a few scripts. But you can put any number of scripts in the installer folder, and copy and customize them if you like. The WordPress script is very handy indeed, I use it nearly every day.

      I sort of cheat the system with Virtualmin… I have 2 Pro licenses, but I install a ton of GPL servers for my clients. So if they need script installers, I will install Pro, then downgrade it to GPL. Or just copy the necessary scripts from Pro to GPL.

  7. Tony G November 8, 2012 at 5:43 am #

    Hi Chris,

    Do you know of a place to download scripts for GPL users without a pro license? :)

    Thanks,
    TG

    • Chris Gilligan November 14, 2012 at 11:25 am #

      There’s no easy way to get the Pro script installers for free… buying a VM Pro license for 10 domains is pretty cheap and will get you all of the installers, which you can drop into GPL.

      If you do a lot of server deployments, it’s well worth having at least 1 Pro license. Sometimes it’s easiest to install Pro, then downgrade to GPL so you get the benefit of more supported OS’s and the script installers. Doing this is unrestricted. Jamie & Joe probably would not approve, but there’s no technical roadblock to prevent you from using the Pro software keys this way.

  8. Darnell March 16, 2013 at 1:36 pm #

    Hi there would you mind letting me know which
    webhost you are using? I’ve loaded your blog page in 2 completely different internet browsers and I have to say this web loads a lot quicker then most. Can you recommend a good hosting provider at a reasonable price? Thank you, I appreciate it! Please also excuse if my english is not good enough.

    • Chris Gilligan March 16, 2013 at 10:33 pm #

      This site is self-hosted on Amazon Web Services.

  9. kindnation March 21, 2013 at 2:42 pm #

    I did everything as you described and ran the script to install wordpress, and it results in:

    WordPress installation complete. It can be accessed at http://example.com/wordpress/wp-admin/install.php (example.com is the domain I’m running the script for).

    When I try to click on the link above, it results in a 404 Not Found, The requested URL /wordpress/wp-admin/install.php was not found on this server, even though I see wordpress has been installed in public_html.

    Any reason why I it doesn’t the wordpress install?

    • Chris Gilligan March 21, 2013 at 7:05 pm #
      1. Did you modify the WordPress installer script in any way, or did you use the one linked from this post, as-is? (if not, try the stock version and see if it works)
      2. What OS is your server?
      3. What web server are you running?
      4. Does /home/[domain-owner-username]/public_html/wordpress/wp-admin/install.php actually exist on your server?
      5. Create a hello-world.html file in /public_html/hello.html –> Does it load?

      On Monday, I helped co-worker set up a VPS with CentOS 6, Virtualmin GPL, and Apache, installed this script, and had a wordpress site running, all in less than 30 minutes… so it’s not the script that’s at fault. Most likely, if you modified the script, you may have mis-typed something. Check your code changes? Let me know if I have mis-typed something?

      • Chris Gilligan March 21, 2013 at 7:08 pm #

        Also, file://localhost/path/to/copy-of-latest.zip needs to use your own proper pathing (and point to an actual, valid WordPress installation file). See reply to X-ray, above, and accompanying link.

        • Chris Gilligan March 21, 2013 at 7:13 pm #

          …and if you can’t get file://localhost… to work for you, try http://domain.tld.com/my.zip and see if it works. If that does not work, try linking to the zip file linked from this post… it will work (though it installs WP 3.4.x).

        • Chris Gilligan March 21, 2013 at 7:19 pm #

          …and be sure if/when you zip up your customized wordpress installer, you zip -r (recursive), and check to be sure you have the proper folder structure in your zip file.

  10. manny April 12, 2013 at 1:49 am #

    Hi Chris,

    Thank you for sharing the script, it works for me. Do you have similar .pl file for Drupal? Can you share it with us all, please?

Trackbacks/Pingbacks

  1. Getting your hands dirty in a geeky way - February 8, 2013

    [...] Fantastico is not around, I had to scour the web for an install script that would automatically install WordPress for Virtualmin. I had to manually install phpMyAdmin and configure the mySQL [...]

Leave a Reply