How to: Apache Directives in SME Server Virtual Web Hosting

Posted on March 6, 2008. Filed under: sme server, smeserver, virtual hosting, web hosting | Tags: , , , , , , |

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

Make a Comment

Make a Comment: ( 1 so far )

blockquote and a tags work here.

One Response to “How to: Apache Directives in SME Server Virtual Web Hosting”

RSS Feed for Sys Notes Comments RSS Feed


Where's The Comment Form?

    About

    Technical information. My tech notes and references

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...