After you’ve installed Seiden CommunityPlus+ PHP, use our siteadd tool to quickly create (or remove) a PHP web server instance. With one command, you can build an Apache HTTP instance from a template, with a proper FastCGI configuration. What’s more, an advanced option lets you create a second set of php
.ini files for testing multiple configurations.
Before you begin, make sure your profile has
*IOSYSCFG authority. Membership in a group with this authority isn’t enough.
1. Install siteadd from our repository. You can use the Access Client Solutions (ACS) Open Source Management Tool, or the following yum command:
yum install siteadd
2. After installing siteadd, run the command addsite, passing in the name of your site (subject to IBM i object naming rules) and the port number it should listen on. (To make sure this port isn’t used by any other applications, look up ports in use with the NETSTAT command.) For example, to create an Apache instance named SEIDENPHP that listens on port 8080, run this command:
addsite -n seidenphp -p 8080
The new site will be created with server root
/www/seidenphp and document root
/www/seidenphp/htdocs. You can now start the instance to see its default page. By default, the site is basically empty, so you likely want to copy files into its htdocs subdirectory.
Want to use a separate PHP configuration for this site? Just add the
-I flag; it will create a new directory (
phpconf) under the site’s server root, and will create a new configuration file from the template, merging any system extension settings in as needed. For example, the following command will create PHP .ini files into
/www/seidenphp/phpconf and set up your site to use them.
addsite -I -n seidenphp -p 8080
After using the
-I option, above, your new site will have its own set of PHP .ini files, located in
(CAUTION!) When you want to delete an Apache instance, stop the HTTP instance, then run:
The site will be unregistered from HTTP administration and (CAUTION!) all files in its directory deleted.
siteadd can use different templates to pre-populate the a site with different configuration. This can speed up making sites if you find yourself having to repeat the same steps over and over.
Templates are by default, located in
/QOpenSys/pkgs/share/siteadd, but you can specify a relative (with
./) or absolute path name to the template. Since database co-existence, there have been no additional templates other than the default. If you have a template, you can make a site with it like so (note that to create the site-specific PHP configuration the
-I flag must be used):
addsite -p 8080 -n testsite -I -T your-template-name-here
For those who wish to make their own templates, the template format is documented in the siteadd README shipped inside of the RPM.