How to: Apache Directives in SME Server Virtual Web Hosting
Trick to use Apache Directive AllowOverride in SMEserver. This enables using .htaccess and thereby modifying web server configuration.
Sometimes, it is desired to use Apache directives to configure the web server for a specific domain. For example, I needed to use Rewrite engine and mod_rewrite. This was to be done on a SME Server using .htaccess file in the web root directory for that domain. This would have been possible if AllowOverride directive of Apache would have been set to All (to enble me use .htaccess)
The Problem was although the Mod Rewrite was loaded into global Apache configuration, it was not possible because by default, the Apache was configured to Not Allow Overrides.
Upon detailed inspection of config files of SME Server, I found a very simple way which was also in line with the elegent configuration mechanism of SME Server.
For example, we need to use Apache Overrides for a domain, which is mapped to an ibay called “ibay1″,
Step 1. Set a new property in smeserver configuration
smeserver database : accounts
key name: ibay1
property to be used: AllowOverride
value to be set: All
SME server has a nice mechanism of configuration. (refer to docs for details). At the moment, we are interested in the configuration database (of smeserver philosphy) named accounts (this holds the properties for all ibays) . The property of our interest is called “AllowOverRide” in smeserver lingo. This is *not set*by default. However, smeserver does consider, if the property is present. We just need to set it properly. This can be set by simple command
db accounts setprop ibay1 AllowOverride All
Our first and critical step is done.
Step 2. Regenerating Configuration and other files
The property setting has still not taken effect. For this, a complex and consistive chain of actions are to be done, like saving this value in database, regenerating whichever config files are necessary for system integrity, (esp. regenerate or expand the templates) for /etc/httpd/conf/httpd.conf (apache configuration file). Furtunately, SME server also has decent mechanism and all this is done in a single shot. Just give the command
signal-event ibay-modify ibay1
The ibay1 will now enable Apache AllowOverride to All and this in turn would enable us configure the Apache web server *just* for this ibay1 to use the .htaccess files to change configuration, as needed.
Note: This assumes default smeserver set up with version 7.3



[...] http://sysnotes.wordpress.com/2008/03/06/how-to-apache-directives-in-sme-server-virtual-web-hosting/ [...]
How to: Apache Directives in SME Server Virtual Web Hosting « Mr Redhead’s Weblog
October 22, 2008