2

I currently have an installer that works, but I have to repackage the open source apps and hack things together to get the installer to install them. I want to be able to use the apps installation method without having to hack and repackage. So I am thinking about rewriting it.

It will allow a user with little to no tech experience install open source apps (ie. WordPress, Joomla, Drupal, et.al.). There are a few requirements I want to meet:

  • The installation should run the scripts install process to make sure the database is setup correctly and the passwords use the apps default password encryption processes.
  • Ability to track the progress and report back any errors.
  • Ability to run upgrades for future releases.
  • Ability to remove the application if someone decides they do not want it any longer.
  • The only access I will for sure have to the users remote server is via FTP.

I have thought about using Selenium. However, if you were challenged to hand spin the code in PHP, how would you do it?

UPDATE FOR CLARIFICATION:

The installer will collect the scripts settings from a form in the browser filled out by the end user. The installation process (that runs in the background and connects over FTP to the users server) will then process the installation. (i.e. SimpleScripts, Installatron, Softaculous, Fantastico, WebPub, etc.) I am trying to figure out how you would design the cleanest simplest install process possible. It needs to create databases, install the application using the scripts install method (as if the user was running it manually), etc. I hope that clarifies the challenge.

Chuck Burgess
  • 386
  • 4
  • 7
  • See also the Microsoft Web Platform Installer (http://www.microsoft.com/web/downloads/platform.aspx), which is very close to what you describe. Sadly, it's not open source, so you can't see how is it done internally, but still may give you some ideas. – Arseni Mourzenko Feb 06 '12 at 17:56
  • Aren't YUM and RPM exactly what you're looking for? – S.Lott Feb 06 '12 at 18:09
  • YUM and RPM are great if you are tech savvy enough to use them. Keep in mind this is intended to be a web application that someone with `little to no tech experience` can use to install their scripts. Most of them will think you are telling them to be quiet if you even mention sh. – Chuck Burgess Feb 06 '12 at 18:55
  • 3
    There are no circumstances under which an ignorant end user could conceivably install WordPress, Joomla, Drupal or similar things. Ignorant end users click on an app-store icon on their iPad and use that. I'm not sure that your question is completely consistent. – S.Lott Feb 06 '12 at 19:02
  • Only if you are taking it to the extremes. But we can prompt a user to fill out a form. Even the ignorant user can do that. What they will not be able to do is log into a host and setup a mysql database and then fill out the form with the credentials of said database. – Chuck Burgess Feb 06 '12 at 19:28
  • I still can't see how something as technical as WordPress, Joomla, Drupal can possibly be installed by someone who can't enter a one-line YUM command. Can you provide anything other than vague hints that there is a class of user too ignorant to run YUM, yet, empowered to install large, complex pieces of application software like WordPress, Joomla, Drupal? It just doesn't seem sensible to allow someone who can't run YUM to install these things. Can you provide any more specific use cases or examples? – S.Lott Feb 06 '12 at 19:31
  • how does your idea compare to http://bitnami.org/ – DXM Feb 06 '12 at 19:32
  • DMX, it would be similar to bitnami. @S.Lott, I am not trying to argue with you. But if I told my wife to ssh into a box and do the install via YUM, she would need to be walked through every step with someone sitting beside her. In addition, a user with a hosting account does not always have access to YUM permissions. The challenge stands, if you had to do a web based install, how would you chose to do it? The WHY does not matter for this question. If it is too difficult for you to answer, then just ignore it. – Chuck Burgess Feb 06 '12 at 19:54
  • You're saying that someone who cannot type a YUM command actually has a need to install WordPress, Joomla, Drupal. I'm shocked that they would try such a thing. I can only hope they have no access to any server I am using. And I wonder what they think they are going to accomplish. I cannot conceive of the situation. But you have insisted repeatedly that there really is a time when someone who can't type YUM will attempt to install WordPress, Joomla, Drupal. I must concede that such a thing really exists. Even though it seems to have EPIC FAIL attached to it. – S.Lott Feb 06 '12 at 19:59
  • 1
    Wow. I didn't realizing asking questions on here would cause such an uprising. I thought this would be a great place to collaborate and get feedback. It turns out if you happen to think outside the box and try to come up with processes that don't conform to existing processes, it's not the place to do it. I apologize for asking the question. – Chuck Burgess Feb 06 '12 at 20:35
  • "Uprising"? I don't understand the question. That's not an "uprising". That's just me. "collaborate and get feedback". Um. We are collaborating. You are getting feedback. I can't understand your use case. That seems like feedback to me. How is it not feedback? I can't agree or show any support for something I can't understand. Don't apologize. Clarify. Explain. Focus. – S.Lott Feb 06 '12 at 22:15
  • @cdburgess: don't get too discouraged. Overall, this is a great community, although some members can be a little more abrasive than others. Remember: we, software engineers, are not generally known for being social. – DXM Feb 06 '12 at 22:38
  • My apologies @S.Lott. I reread what I wrote and it appears I was assuming too much. I have updated the description with a clarification / requirements. Please let me know if more clarification is needed. – Chuck Burgess Feb 07 '12 at 16:05
  • Please **update** the question with your explanation for why YUM doesn't work. – S.Lott Feb 07 '12 at 17:19
  • I think it is clear in the update. This needs to be a GUI in a web browser that installs to the users remote box via FTP. As far as I know, you cannot run a YUM command using FTP. In addition, the user may not have permissions to YUM. – Chuck Burgess Feb 08 '12 at 17:53

2 Answers2

2

You're not going to have the ability to execute scripts via FTP, obviously.

But, you can upload a .PHP file into the user's web directory, and then remotely execute that PHP file (or whatever language you pick). Thats why we dont give world writable rights to directories where scripts are stored! :-)

So, an approach one might take could be:

  • Gather application parameters (what programs, where to store them, database information)
  • Generate a big .PHP file that scripts the installation of the applications. Upload that via FTP into the domain's root directory.
  • Execute it remotely (and ensure the php file cant be executed more than once).

Practical problems:

  • The user the web server is operating as may not have the necessary rights to create directories where you need them. Presumably the user does, so these might be creatable via FTP.
  • The db user that the user provides may not have the rights to create a new database, so they may have to create that via whatever tool their ISP provides.
  • The amount of information required ahead of time might be very large, and require a certain level of familiarity with the server's directory structures... and if the user has that, then the utility of the service is deminished since most apps have their own similar installers.
  • If there are missing libraries or PHP extensions, for example a PHP app that requires cUrl and its missing, you're out of luck.
GrandmasterB
  • 37,990
  • 7
  • 78
  • 131
  • 1
    +1 very thorough answer. It looks like you thought in dept about the install process. Love the ideas you address here. – Chuck Burgess Feb 13 '12 at 16:03
1

You're probably thinking about something similar to Installatron. They offer a free and easy way to remotely install the most popular web applications. You just need to fill out the form with DB, FTP and application settings, select the version of the application you want and click install.

NOTE: I'm not affiliated with Installatron in any way. My only association with them is that my hosting provider uses their plugin.

UPDATE:

PHP is a good choice for dynamically building scripts. As GrandmasterB already suggested you can't execute scripts via FTP so the easiest solution is to make an installation script, upload it to the target server and execute.

You're probably want to support a lot of different applications so I would make a system very configurable. Basically every action that needs to be executed to install an application should be written in a configuration. The configuration can be stored as a file or in a database (RDBMS or even NoSQL). That way you can make adjustments to the installation procedure easily without changing the code. This will also allow you to easily support multiple operating systems and allow others to write install procedures for their application.

You can encounter a lot of problems when installing the application on server - e.g. you don't have the sufficient permissions to write/execute or the application you're installing requires a higher version of PHP / MySQL / some library etc.

In case of a failure application should be able to rollback all the changes that are made so the target system remains in the same state before the installation began.

You're targeting users that have minimal or no tech skills so I would make the UI as simpler as I can. But no matter how simple the interface you can't hide some technical details from them i.e. they will need to know their FTP and database credentials. For some users that will also be a problem but the only thing you can do about that is to write some sort of help or wizard that will guide them through the process.

Christian P
  • 1,954
  • 2
  • 19
  • 24
  • So how would you design something like that? I know about many of those applications. I am trying to determine the best method of automated installation for a user from a point and click interface from the browser. – Chuck Burgess Feb 07 '12 at 15:58