Charles2008
Just to clarify for you, in this case you do not need to add a custom template for the PHPBaseDir setting, as suitable code exists in sme server to allow db entries to be used to set this.
So follow the generic instructions here (& as similarly mentioned many times in these forums).
http://wiki.contribs.org/PHP#Modifying_the_PHPBaseDir_setting_for_an_ibayNote that you do need to manually create the actual ibay /tmp folder (if not already existing), ie create a /tmp subfolder in the location that you specify with the db command.
You cannot just specify a non existent folder as the tmp folder.
If your webapp is in
/home/e-smith/files/ibays/accountingwebapp/html/
then create a folder
/home/e-smith/files/ibays/accountingwebapp/html/tmp
Do not use or specify the common system /tmp folder or a seperately created common system /temp folder for all web apps, to avoid cross site hacking.
Always create seperate ..../tmp folders for each app, only within the folder structure for that web application.
Re the issues of installing to /opt or to an ibay, there is no significant practical difference.
If you use /opt/webapp then you need to create custom template fragments to point domains or aliases (eg mydomain.com/mywebapp) to the /opt/webapp folder & so on.
Usually a contrib rpm will do that for you, but if you are doing manual installs of less popular webapps for which no contrib rpm has been released, then you will need to manually do this, which if you do not know how can be a stumbling block to get that webapp to be accessible from the web.
Study how other webapps with contribs do this ie install a contrib & look at the template fragments that get added, and also seperately look at what the smesitemaker contrib does.
Installing to an ibay is quite OK & usually easier to setup. Web access is controlled using server manager settings for the ibay, as is the ability to run php or other "dynamic" type content.
The Domains panel in server manager can also forward domain type URL requests to a specified ibay, so that for a certain domain name, content in a certain ibay is used.
So many of the manual "behind the scenes" setting up requirements that are needed for /opt installations, are handled by the server manager GUI interface for ibay installations, much easier for you.
Note too that all ibay content is automatically included in default backups, or backups that conform to sme standards, whereas content in /opt is not included in backups, so you need to manaully add /opt to any backup routine.
Note for installs to either /opt or an ibay you will still need to set the PHPBaseDir setting using a db command.
The reason the PHPBaseDir setting is not automatically created is for security, the less access that is granted to folders & ibays as a default, then the less chance of hacking etc.
So the sme developers have wisely allowed users to specify which folder(s) or ibay(s) they want to individually enable the PHPBaseDir setting for.
The need for setting individual per app PHPBaseDir settings, is not to make life harder for you, but to make it safer.
It's just something that seems to catch many users out & cause them some initial difficulty when setting up webapps.
The important thing to note about using ibays is that they are multi purpose "storage containers", and end users on your network (ie LAN) can have direct access to ALL the ibays if configured that way in server manager, which many less knowledgable sysadmins may do inadvertantly by default.
You should only typically allow end users on the LAN to have Windows file sharing access to ibays that contain user changeable data & files.
End users should not (usually) have access to ibays that contain webapps like Wordpress, Joomla, accounting programs & so on.
These should only be accessible by the administrator or responsible end user(s) who are in charge of updating content on those webapp sites.
You can control local (LAN) file sharing access using sme server Groups.
Where you you have multiple users & multiple webapps in ibays (meaning more than one of each), then create a Group for every ibay webapp, and only allow a certain user or sysadmin to be a member of a group or groups that require access to certain ibays. Some users may have access to some webapp ibays that other users do not have access to etc. This concept prevents unauthorized users from inadvertantly changing web content or changing permissions on files within the webapp ibay & from uploading inappropriate or insecure web content, & so on.
The above issues are one of the reasons why there is a suggestion to use /opt, as no user automatically has access to /opt, and a sysadmin will have to provide access to any authorized user, thus forcing the issue of security & user access to webapp content be dealt with.
Hope that helps you clarify things.