|
From: Csere M. <cs...@gm...> - 2014-12-01 12:05:32
|
Hello, Is there a way to differentiate the apache template generation for SSL and plain virtualhosts? I would like to have different lines generated for the SSL and the plain apache virtualhosts. I have tried using the $SSL variable, but that's value is based on the virtual server feature, rather than the virtual server being generated. (So if the feature is enabled, then it is both "1" when the plain and when the SSL apache virtualhost is generated) If this is not possible, i would be able to survive with a random enough random int, to avoid collision. (Would it be possible to give a variable a value (maybe in Global Variables) from a perl/bash call to make random number? ) Thanks, cserem |
|
From: Jamie C. <jca...@we...> - 2014-12-02 01:34:28
|
On 01/Dec/2014 04:05 Csere M�ty�s <cs...@gm...> wrote .. > Hello, > > Is there a way to differentiate the apache template generation for SSL > and plain virtualhosts? > I would like to have different lines generated for the SSL and the plain > apache virtualhosts. > > I have tried using the $SSL variable, but that's value is based on the > virtual server feature, rather > than the virtual server being generated. (So if the feature is enabled, > then it is both "1" when the plain and when the SSL apache > virtualhost is generated) > > If this is not possible, i would be able to survive with a random enough > random int, to avoid collision. > (Would it be possible to give a variable a value (maybe in Global > Variables) from a perl/bash call to make random number? ) Right now, there is no way to do this - Virtualmin always copies all directives from the non-SSL virtualhost to the SSL version so that they remain in sync. What settings do you want to vary exactly? |
|
From: Csere M. <cs...@gm...> - 2014-12-02 15:31:57
|
2014.12.02. 2:32 keltezéssel, Jamie Cameron írta:
> Right now, there is no way to do this - Virtualmin always copies all directives
> from the non-SSL virtualhost to the SSL version so that they remain in sync.
>
> What settings do you want to vary exactly?
I am using php-fpm with apache(2.2) FastCgiExternalServer.
For it to work I need to have something like this in my vhosts:
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /home/vhost/public_html/some-unique-name-all-trough-apache
FastCgiExternalServer
/home/vhost/public_html/some-unique-name-all-trough-apache -socket
/path/to/phpfpm-socket.
</IfModule>
Adding an SSL vhost compromises my path of
"/home/vhost/public_html/some-unique-name-all-trough-apache"
and apache fails to start with "FastCgiExternalServer: redefinition of
previously defined class
/home/vhost/public_html/some-unique-name-all-trough-apache"
Speaking of templates:
Since I am not using virutalmin's pre-set of php enviroments (in
virtualmin I have it set to mod_php), I would like to give my users an
opportunity
to choose between php versions.
So far I have got to the point where I have a Custom Field Menu, with
PHP versions in it, then generate the FastCgiExternalServer line's
socket path accordingly,
inside apache template (-socket
/path/to/php-fpm/socket/${FIELD_PHP}/php5-fpm.sock-${UID}, with PHP
having values 52,53,54)
This almost works as i want it to: when I change the field value the web
feature needs to be disabled/enabled so the vhost would update its file.
What solution would you suggest for this problem (let users choose
between my custom php versions automatically)?
Perhaps I need to write (if possible) a new feature plugin to handle all
this?
|
|
From: Jamie C. <jca...@we...> - 2014-12-03 02:32:41
|
On 02/Dec/2014 07:31 Csere M�ty�s <cs...@gm...> wrote ..
>
> 2014.12.02. 2:32 keltez�ssel, Jamie Cameron �rta:
> > Right now, there is no way to do this - Virtualmin always copies all directives
> > from the non-SSL virtualhost to the SSL version so that they remain in sync.
> >
> > What settings do you want to vary exactly?
> I am using php-fpm with apache(2.2) FastCgiExternalServer.
> For it to work I need to have something like this in my vhosts:
> <IfModule mod_fastcgi.c>
> AddHandler php5-fcgi .php
> Action php5-fcgi /php5-fcgi
> Alias /php5-fcgi /home/vhost/public_html/some-unique-name-all-trough-apache
> FastCgiExternalServer
> /home/vhost/public_html/some-unique-name-all-trough-apache -socket
> /path/to/phpfpm-socket.
> </IfModule>
>
> Adding an SSL vhost compromises my path of
> "/home/vhost/public_html/some-unique-name-all-trough-apache"
> and apache fails to start with "FastCgiExternalServer: redefinition of
> previously defined class
> /home/vhost/public_html/some-unique-name-all-trough-apache"
Oh, I see... I wonder if instead you could use the <If...> block that only
matches for the SSL virtualhost?
> Speaking of templates:
> Since I am not using virutalmin's pre-set of php enviroments (in
> virtualmin I have it set to mod_php), I would like to give my users an
> opportunity
> to choose between php versions.
> So far I have got to the point where I have a Custom Field Menu, with
> PHP versions in it, then generate the FastCgiExternalServer line's
> socket path accordingly,
> inside apache template (-socket
> /path/to/php-fpm/socket/${FIELD_PHP}/php5-fpm.sock-${UID}, with PHP
> having values 52,53,54)
> This almost works as i want it to: when I change the field value the web
> feature needs to be disabled/enabled so the vhost would update its file.
> What solution would you suggest for this problem (let users choose
> between my custom php versions automatically)?
> Perhaps I need to write (if possible) a new feature plugin to handle all
> this?
I think you'd need a new plugin for this, which adds a new left-menu item.
Changing custom fields can't update the Apache config currently.
|
|
From: Csere M. <cs...@gm...> - 2014-12-03 15:21:34
|
2014.12.03. 3:31 keltezéssel, Jamie Cameron írta: > On 02/Dec/2014 07:31 Csere M�ty�s <cs...@gm...> wrote .. >> 2014.12.02. 2:32 keltez�ssel, Jamie Cameron �rta: >>> Right now, there is no way to do this - Virtualmin always copies all directives >>> from the non-SSL virtualhost to the SSL version so that they remain in sync. >>> >>> What settings do you want to vary exactly? >> I am using php-fpm with apache(2.2) FastCgiExternalServer. >> For it to work I need to have something like this in my vhosts: >> <IfModule mod_fastcgi.c> >> AddHandler php5-fcgi .php >> Action php5-fcgi /php5-fcgi >> Alias /php5-fcgi /home/vhost/public_html/some-unique-name-all-trough-apache >> FastCgiExternalServer >> /home/vhost/public_html/some-unique-name-all-trough-apache -socket >> /path/to/phpfpm-socket. >> </IfModule> >> >> Adding an SSL vhost compromises my path of >> "/home/vhost/public_html/some-unique-name-all-trough-apache" >> and apache fails to start with "FastCgiExternalServer: redefinition of >> previously defined class >> /home/vhost/public_html/some-unique-name-all-trough-apache" > Oh, I see... I wonder if instead you could use the <If...> block that only > matches for the SSL virtualhost? I don't understand your idea. According to http://httpd.apache.org/docs/2.2/mod/directives.html the only <IF....>'s are <ifdefine>, <ifmodule>, and <ifversion> >> Speaking of templates: >> Since I am not using virutalmin's pre-set of php enviroments (in >> virtualmin I have it set to mod_php), I would like to give my users an >> opportunity >> to choose between php versions. >> So far I have got to the point where I have a Custom Field Menu, with >> PHP versions in it, then generate the FastCgiExternalServer line's >> socket path accordingly, >> inside apache template (-socket >> /path/to/php-fpm/socket/${FIELD_PHP}/php5-fpm.sock-${UID}, with PHP >> having values 52,53,54) >> This almost works as i want it to: when I change the field value the web >> feature needs to be disabled/enabled so the vhost would update its file. >> What solution would you suggest for this problem (let users choose >> between my custom php versions automatically)? >> Perhaps I need to write (if possible) a new feature plugin to handle all >> this? > I think you'd need a new plugin for this, which adds a new left-menu item. > Changing custom fields can't update the Apache config currently. > For this you would suggest reading through http://doxfer.webmin.com/Webmin/ModuleDevelopment and then https://www.virtualmin.com/documentation/developer/plugins right? :) |
|
From: Andrey R. <anr...@fr...> - 2014-12-03 21:50:13
|
Greetings, Csere Mátyás! >> Oh, I see... I wonder if instead you could use the <If...> block that only >> matches for the SSL virtualhost? > I don't understand your idea. > According to http://httpd.apache.org/docs/2.2/mod/directives.html the > only <IF....>'s are > <ifdefine> This is the one you need. You can do nearly anything with it. -- WBR, Andrey Repin (anr...@fr...) 04.12.2014, <00:39> Sorry for my terrible english... |
|
From: Csere M. <cs...@gm...> - 2014-12-03 22:10:35
|
If I understand <ifdefined> correctly, all it does is processes parts of the httpd.conf based on a passed start up value. How is that supposed to help with the duplicated entries? On December 3, 2014 10:39:56 PM CET, Andrey Repin <anr...@fr...> wrote: >Greetings, Csere Mátyás! > >>> Oh, I see... I wonder if instead you could use the <If...> block >that only >>> matches for the SSL virtualhost? >> I don't understand your idea. >> According to http://httpd.apache.org/docs/2.2/mod/directives.html the > >> only <IF....>'s are >> <ifdefine> > >This is the one you need. >You can do nearly anything with it. > > >-- >WBR, >Andrey Repin (anr...@fr...) 04.12.2014, <00:39> > >Sorry for my terrible english... >------------------------------------------------------------------------------ >Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >from Actuate! Instantly Supercharge Your Business Reports and >Dashboards >with Interactivity, Sharing, Native Excel Exports, App Integration & >more >Get technology previously reserved for billion-dollar corporations, >FREE >http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >- >Forwarded by the Webmin mailing list at >web...@li... >To remove yourself from this list, go to >http://lists.sourceforge.net/lists/listinfo/webadmin-list |
|
From: Jamie C. <jca...@we...> - 2014-12-04 00:43:40
|
On 03/Dec/2014 07:21 Csere Mátyás <cs...@gm...> wrote .. > > 2014.12.03. 3:31 keltezéssel, Jamie Cameron írta: > > On 02/Dec/2014 07:31 Csere M�ty�s <cs...@gm...> wrote .. > >> 2014.12.02. 2:32 keltez�ssel, Jamie Cameron �rta: > >>> Right now, there is no way to do this - Virtualmin always copies all directives > >>> from the non-SSL virtualhost to the SSL version so that they remain in sync. > >>> > >>> What settings do you want to vary exactly? > >> I am using php-fpm with apache(2.2) FastCgiExternalServer. > >> For it to work I need to have something like this in my vhosts: > >> <IfModule mod_fastcgi.c> > >> AddHandler php5-fcgi .php > >> Action php5-fcgi /php5-fcgi > >> Alias /php5-fcgi /home/vhost/public_html/some-unique-name-all-trough-apache > >> FastCgiExternalServer > >> /home/vhost/public_html/some-unique-name-all-trough-apache -socket > >> /path/to/phpfpm-socket. > >> </IfModule> > >> > >> Adding an SSL vhost compromises my path of > >> "/home/vhost/public_html/some-unique-name-all-trough-apache" > >> and apache fails to start with "FastCgiExternalServer: redefinition of > >> previously defined class > >> /home/vhost/public_html/some-unique-name-all-trough-apache" > > Oh, I see... I wonder if instead you could use the <If...> block that only > > matches for the SSL virtualhost? > I don't understand your idea. > According to http://httpd.apache.org/docs/2.2/mod/directives.html the > only <IF....>'s are > <ifdefine>, <ifmodule>, and <ifversion> My mistake, there isn't actually any <if> statement that can be used to do what you want. > >> Speaking of templates: > >> Since I am not using virutalmin's pre-set of php enviroments (in > >> virtualmin I have it set to mod_php), I would like to give my users an > >> opportunity > >> to choose between php versions. > >> So far I have got to the point where I have a Custom Field Menu, with > >> PHP versions in it, then generate the FastCgiExternalServer line's > >> socket path accordingly, > >> inside apache template (-socket > >> /path/to/php-fpm/socket/${FIELD_PHP}/php5-fpm.sock-${UID}, with PHP > >> having values 52,53,54) > >> This almost works as i want it to: when I change the field value the web > >> feature needs to be disabled/enabled so the vhost would update its file. > >> What solution would you suggest for this problem (let users choose > >> between my custom php versions automatically)? > >> Perhaps I need to write (if possible) a new feature plugin to handle all > >> this? > > I think you'd need a new plugin for this, which adds a new left-menu item. > > Changing custom fields can't update the Apache config currently. > > > For this you would suggest reading through > http://doxfer.webmin.com/Webmin/ModuleDevelopment and then > https://www.virtualmin.com/documentation/developer/plugins > right? :) Yes, that explains it. A plugin could also make the fastcgi directive changes you want, as Virtualmin only syncs the VirtualHost blocks at creation time. |