SSL Certificate Config & Custom HTTPD Config

schirpich

Verified User
Joined
Jun 20, 2011
Messages
7
If I recall correctly, when a user (virtualhost) adds a SSL certificate they are presented with an option to choose between a sym link to their existing public_html folder or to create a duplicate folder under domains. (Correct me if I am wrong on that)

This user in particular has an SSL certificate installed and configured using the symlink method. However if I try to configure some custom HTTPD settings via the admin panel I am only given/provided a single place to add any custom httpd configurations. Those configurations are then replicated for the two virtualhosts (80 and 443).

Now, granted I am tweaked to use PHP5.3.6 FPM via mod_fastcgi. So I understand that DA is confused a bit.

When I add my custom directives, Apache freaks out about FastCgiExternalServer being defined twice and will not start.

PHP:
FastCgiExternalServer: redefinition of previously defined class

In a future update, is it possible to add a second "Custom HTTPD Configuration" form when SSL is enabled for a particular domain. One form for custom httpd config's for the port 80 virtual host. And an additional yet separate form for custom port 443 virtual hosts. That way any conflicting settings or directives can be added or removed accordingly.

Unless of course there is already a method in place that I am not aware of. I know I can just manually remove it from the config while ssh'd into the server. But I'd rather try and stick "within the boundaries" when possible.
 
Hello,

You might want to use a custom tocken within httpd templates.

Show me your directives with the help of which you enable Fast CGI, so I could help you here. Or contact me for a paid service out of the forums.
 
Hello,

1) If you're trying to figure out if a VH is using SSL or not, the simplest would be to use this guide:
http://help.directadmin.com/item.php?id=2

and only copy:
virtual_host2_secure.conf
virtual_host2_secure_sub.conf

to the custom directory.

2) At the top of these 2 copied files, add:
Code:
|?USING_SSL=yes|
3) Then when using:Admin Level -> Custom Httpd Config -> domain.com

you can reference that variable, eg:
Code:
|*if USING_SSL="yes"|
httpd.conf code for ssl
|*else|
code for non-ssl
|*endif|
where you don't need to have the |*else| part if you don't need it.

More info on template if-then-else:
http://www.directadmin.com/features.php?id=430


On a side note, if you want to get very creative, the virtual_host*.conf template also support embedded scripting so you can use any script you want to generate their contents (eg: php with a database if you want)
http://www.directadmin.com/features.php?id=756

John
 
ok, so here's what I'm doing...

I am running Debian 6 AMD64 within a Proxmox OpenVZ Container with the 2.6.32-4-pve kernel.

I followed http://www.bxtra.net/articles/2011-...-modfcgid-on-php-52-53-and-modfastcgi-php-fpm in order to get the different php methods working together. That tutorial was originally written for Cent/RedHat I believe so I had to make some minor adjustments to get everything in order. But over all it works good enough for my intended use of DA.

I simply just removed the "FastCgiExternalServer" option/directive from the vhost_secure* templates. This gets defined within the virtual_host2.conf. Once defined there the secure/SSL conf files don't need it. Leaving it defined in secure conf files was the cause of the problem.
 
Back
Top