Digital Base – Blog » apache

Directadmin + Custom Webroot (for symfony…)

As a we are using directadmin for our webhosting machines we previously had problems with custom webroots.

The problem

Directadmin rewrites all uses httpd.conf files when adding/updateing subdomains or domain settings leading to a default httpd.conf, resulting in a blank page for symfony projects. (symfony projects use the /web) webroot.

Previous solution

The previous solution told you to update the symfony webroot directory, this way you went with the directadmin default configuration. (public_html document root). The downside of this solution was that your domain directory (/home/user/domain/mydomain.com) was a mess with directories like public_html, private_html, logs….

The final solution

Now i just bumped into a better & easier solution. Apperently directadmin ‘custom httpd configuration’ accepts the following tokens :

|DOMAIN|,
|IP|,
|HOME|,
|ADMIN|,
|DOCROOT|,
|USER|,
|GROUP|,
|CERT|,
|KEY|, |HOSTNAME|,
|SAFE_MODE|,
|OPEN_BASEDIR|,
|CREATOR|,
|BANDWIDTH|,
|QUOTA|Â

So for all your symfony projects you could update the documentroot right there (no manual httpd.conf configuration or changing the symfony webroot). Just add these 2 lines into your ‘custom httpd.conf’ for the selected domain :

1
2
Alias /sf /usr/local/lib/php/data/symfony/web/sf
|?DOCROOT=/home/USERNAME/domains/DOMAIN/public_html/web|

In the above example you should replace DOMAIN & USER by the variables you can find in the ‘contents of the httpd.conf file’ just below the custom httpd.conf configuration.

SSPI Authentication module

One of our customers, where we had to build an Intranet system already had a Windows Network, including NT Servers and SQL databases. All the user credentials were stored in the local Active Directory. So, it would be nice to use all this information for the intranet, so Administrators and staff employees did not need to insert and maintain the same information twice. This is were SSPI comes in.

mod_auth_sspi is a module written for Apache webserver. It allows Microsoft Internet Explorer, and Windows clients to authenticate using any of the authentication protocols built into the Windows Security Support Provider Interface (SSPI), for example in combination with Active Directory and Windows Domains. So it allows an Apache/NT web server administrator to use the existing NT security infrastructure to authenticate users.

Mod_auth_sspi processes user access restrictions just like the rest of Apache. That is, you put a require directive into the appropriate .htaccess or configuration section, and authentication will be performed.

[code]sspi apache[/code]

Mod_auth_sspi is probably most useful in intranets. Authentication can happen transparently, using the user's current username and password – however, basic authentication is still supported.

SourceForge SSPI module website