Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th March 2006, 18:11
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,395
Thanks: 833
Thanked 5,490 Times in 4,322 Posts
Default How to build packages that can be installed with the ISPConfig update function.

The ISPConfig update manager installs packages with the .pkg file extension. These files are simple .zip files, they are named .pkg to prevent users from unpacking them before the upload.

The .zip files must be build with the option to not store path's (not even relative path's)!

Inside the .pkg package is a file named "package.ins". This text file contains the instructions for the installer.

The installer can perform the following actions

* Create and delete directories
* Copy and delete files
* Execute SQL commands
* Execute PHP and shell scripts


Commented example package.ins file:

Code:
################################################
#
# package.ins file
#
# Installation variables
#
# {app} ISPConfig Base directory.
# In ISPConfig 2.x this is always 
# /home/admispconfig/ispconfig
#
# {src} Contains the directory, where the installer
# has unpacked the contents of the .pkg file.
#
# {tmp} Temp folder
# In ISPConfig 2.x this is always 
# /home/admispconfig/ispconfig/temp
#
# {uninstall} Uninstall directory of the package
# This is not implemented yet!
#
################################################


################################################
# Most of the variables in this section ([setup])
# where not in use yet. They shall be used
# for a package database where you can select
# packages in a list inside ISPConfig and
# install them with onwe click.
################################################


[Setup]

MinVersion=2.0
AdminPrivilegesRequired=true
RequiredUser=admispconfig
AppName=ISPConfig
AppId=ISPConfig
AppType=patch
AppVersion=1.0
AppCopyright=Copyright © Projektfarm GmbH 2005
AppPublisher=projektfarm GmbH
AppPublisherURL=http://www.projektfarm.de/
CreateUninstall=true
UninstallFilesDir={uninstall}
Uninstallable=true
DefaultDirName={app}
DefaultDirTrenner=/
ServerRestart=no
ServicesRestart=apache,mysql
Compression=tgz
LicenseFile=license.txt

################################
# Create or delete Directories
################################

[Dirs]

# Make the directory: /home/www/xyweb.de/web/stats
MKDIR: "/home/www/xyweb.de/web/stats"

# Make the directory: /home/admispconfig/ispconfig/web/newmodule/lib
MKDIR: "{app}/web/newmodule/lib"

# Make the directory: /home/admispconfig/ispconfig/web/newmodule/lib/lang
MKDIR: "{app}/web/newmodule/lib/lang"

# Delete the directory: /home/admispconfig/ispconfig/web/oldmodule
RMDIR: "{app}/web/oldmodule"

################################
# Copy or delete files
################################

[Files]

# copy the file newfile.php which is inside the .pkg file to the directory /home/admispconfig/ispconfig/web/newmodule
# and make a chmod 555
CPFILE: "{src}/newfile.php"; DestDir: "{app}/web/newmodule"; DestName: "newfile.php"; Chmod: "555"

# copy the file tmp_de.lng which is inside the .pkg file to /home/admispconfig/ispconfig/web/newmodule/de.lng
# and make a chmod 555
CPFILE: "{src}/tmp_de.lng"; DestDir: "{app}/web/neuesmodul/lang"; DestName: "de.lng"; Chmod: "555"

# Delete the file /home/admispconfig/ispconfig/lib/de.lng
RMFILE: "{app}/lib/de.lng"


#################################################
# Execute SQL commands
#################################################

[SQL]
# Execute the SQL command: "UPDATE sys_user set X = Y" in the database "dbispconfig"
SQLEXEC: "UPDATE sys_user set X = Y"; Database: "dbispconfig"

# Execute the SQL commands that are stored in the file sqldump.sql that is inside
# the .pkg file in the database "dbispconfig"
SQLFILEEXEC: "sqldump.sql"; DATABASE: "dbispconfig"


#####################################################
# Execute bash or php scripts. All scripts are
# run with the priveliges of the user admispconfig
# even if you set the user to root
######################################################

[Run]
# Execute before the installation starts
RUNBEFOREINSTALL: "{src}/install.sh"; Parameters: "--silent --undelete" User: "admispconfig" Type: "shell"

# Execute after the installation has finished
RUNAFTERINSTALL: "{src}/install.php"; Parameters: "--silent --delete" User: "admispconfig" Type: "php"


#####################################################
# The uninstallation part has not been implemented yet.
# Any volunteers? :-)
######################################################

[UninstallRun]

# Run before uninstall
RUNBEFOREUNINSTALL: "{src}/install.sh"; Parameters: "--silent --undelete" User: "admispconfig" Type: "shell"

# Run after uninstall
RUNAFTERUNINSTALL: "{src}/install.php"; Parameters: "--silent --delete" User: "admispconfig" Type: "php"

[InstallDelete]
# Delete files after installation
RMFILE: "{app}/lib/de.lng"
RMDIR: "{app}/web/oldmodule"
If you want to see some real examples, download one of the existing packages, extract the contents with a zip extractor and have a look inside the package.ins file with a text editor.

http://www.ispconfig.org/downloads/webmail.pkg http://www.ispconfig.org/downloads/p...-2.6.4-pl3.pkg
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following 2 Users Say Thank You to till For This Useful Post:
AllanJ (5th August 2008), madmucho (19th February 2008)
Sponsored Links
  #2  
Old 18th February 2008, 13:00
calamidad calamidad is offline
Junior Member
 
Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Build packages for ISPConfig to install webapps??

I've just read the howto to build ISPConfig packages,

Looks nice, but I'm just wondering if it can be used to install webapps into a client domain, i.e. : install drupal onto the jonh doe's domain my-john-doe-example-domain.com

AFAIK at least a DOMAINDIR variable its needed, but unavailable.

Is there something that I'm missing ? Can this be accomplished with the actual 2.2.21 ?
Reply With Quote
  #3  
Old 18th February 2008, 13:05
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,395
Thanks: 833
Thanked 5,490 Times in 4,322 Posts
Default

The ispconfig pacake system is not meant to install software in client websites. It is meant to install or update softeare within the ispcinfig ssystem on port 81.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 18th February 2008, 13:10
calamidad calamidad is offline
Junior Member
 
Join Date: Feb 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you recommend something to do this in a ispconfig managed server ?

Thanks,
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Manager on ISPconfig techngo Installation/Configuration 12 17th December 2009 11:03
Updating ISPConfig via Update Manager viewport Installation/Configuration 3 9th September 2007 22:59
Ispconfig + FC4 + mail function vocoder General 15 10th March 2006 12:36
Logging in to isp config Jrdgames General 43 6th March 2006 19:04
ispconfig keep crashing on update ablc Installation/Configuration 2 2nd August 2005 09:06


All times are GMT +2. The time now is 05:21.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.