Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

SetEnv for addon domains and subdomains

Richard van Laak shared this idea 8 years ago
Open Discussion

cPanel should allow to add more custom Apache directives. We want to configure an environment variable to tell our application which config it should be loading. So please allow easy configuration of "SetEnv", so we can do:


SetEnv APP_ENV dev


Only thing I've found about this: https://forums.cpanel.net/threads/how-to-edit-virtualhost-setenv.162245/

Replies (3)

photo
2

Adding an interface to WHM is a definite possibility, but I wanted to mention that this can be accomplished manually through the use of vhost include files, as described in our documentation here:


https://documentation.cpanel.net/display/EA/Modify+Virtualhost+Containers+With+Include+Files

photo
1

More and more applications really depend on it, we need it urgently. The extra include files work, but are a hassle :(

photo
1

Can you give us a few of the applications that you have encountered that depend on it? That will give us some more context.

photo
1

It's very common for any symfony application to distinguish between prod and dev for example:


SetEnv SYMFONY__ENV "prod"

SetEnv SYMFONY_ENV "prod"


If we would set in .htaccess, we cannot have same app running in dev and prod at same time. When we put in htaccess we can set same public_html folder and run prod.example.org and dev.example.org with the same codebase if needed etc.

photo
1

To clarify this a bit, almost every SAAS (platform, CI, CD, and so on) strongly relies on environment parameters to get any kind of application running. The strongest argument is that it is not language specific, but environment specific.

photo
photo
1

Are you seeking the ability to define SetEnv parameters in cPanel, WHM, or both?

photo
1

The only way to properly implement this is by adding the ability to both cPanel and WHM, both users and admins should be able to manage their environment parameters.

photo
2

Well to my opinion at least in cPanel, because we need it on the virtual host level of certain cPanel accounts.

photo
Leave a Comment
 
Attach a file