What is the significance of the name argument to WSGIDaemonProcess? - mod-wsgi

The first argument to WSGIDaemonProcess is name like so:
WSGIDaemonProcess name [ options ]
But what does that name map to or affect? Does it matter what it is? If so, to what does it matter?

The name doesn't map to anything else, but other things map to that name.
In particular, if you don't actually have WSGIProcessGroup or process-group options on appropriate configuration directives with that name, then nothing will be delegated to use that set of processes for running the WSGI application. The need to use WSGIProcessGroup is mentioned in the documentation you refer to.
As to the value of name, that is up to you.

Related

DBT dynamic config

I have a generic test and need it to be always saved under a particular name for the given table it is running on, e.g. on table report_revenue the generated generic test name will always be diff_check_report_revenue. Right now the default dbt naming behavior for generic tests is kinda messy (it sets the test name based on the test config, which is a great idea for most cases, but unfortunately not for my particular one).
According to the docs it looks like the [alias]https://docs.getdbt.com/reference/resource-configs/alias is exactly what I need. However, I also need to set the name dynamically based on the table that is tested. I know it can be set in the yml config by setting the field alias, but I hope there might be a more elegant solution.
When I try the following:
{{
config({
"severity": 'warn',
"tags": ["diff_check"],
"alias": 'diff_check_' + {{ model | replace("XXXXXXX") | trim }}
})
}}
It just doesn't work and dbt completely ignores the alias property. model is the relation on which the test is running. It's probably just my own wrong syntax, but I'm stuck and humbly asking for advice. Thanks a lot in advance!
The docs are super confusing on test config, since they group together generic tests and singular tests, and the behavior is different.
You can use a config() block inside the definition for a generic test to configure it, and some keys (e.g., severity) work fine, but alias is not one of them.
I think alias is meant for singular tests only. To give generic tests a unique identifier (only possible since v1.1), you are supposed to use the name property (not config). Docs. Does this make sense? No. Does it make it easy for you to do what you want to do? Also no.
I'll point out that the default naming convention for a generic test includes the name of the test followed by the name of the model, but assuming that isn't good enough, your only option will be to add a name property to every test, where you define the test in the properties (fka schema.yml) file. And it looks like the name property doesn't jinja-template its value (so you can't use jinja to populate the test name). So you'll have to do a lot of this:
models:
- name: my_model
tests:
- diff_check:
name: diff_check_my_model
You could fork dbt-core. The relevant code is here.

apache second alias does'nt work

I have an alias on apache like this: Alias “/images” “/home/user1/data” Now I want to have a second alias like this: Alias “/images/charts” “/home/user1/meta/output”
But it isn't working. How can I do this?
From the Documentation
(...) the Aliases and Redirects are processed in the order they appear in
the configuration files, with the first match taking precedence.
For this reason, when two or more of these directives apply to the
same sub-path, you must list the most specific path first in order for
all the directives to have an effect. For example, the following
configuration will work as expected:
Alias "/foo/bar" "/baz"
Alias "/foo" "/gaq"

Apache httpd 2.2 - How to transform value of a variable to remove part of the string

I have a variable coming in to Apache called "MELLON_NAME_ID" as part of mod_auth_mellon for SSO. It populates the variable with "DOMAIN\Username", and I need to populate the REMOTE_USER variable with just the "Username" portion of that. Is this possible?
Edit: It's also populating REMOTE_USER with the same value, so all I really need is to remove the "DOMAIN\" portion.
Thanks!

Apache: How can I sort a directory listing numerically?

I've got a website with a large directory tree. At some levels there are numerically-named directories, such as 123,45, 67,8 and 67,21. I'd like to sort these such that 123,45 comes after 67,*. Ideally, 67,8 would come before 67,21 as well:
67,8
67,21
123,45
(Note: ',' could as easily be '.', '-', etc.)
Is there a simple way to accomplish this within Apache (either directly or by creating a small plugin for it), or am I going to have to turn the site into some kind of CGI-based thing to make it sort numerically?
Just need add V=1 parameter, then directory will be displayed in version sorting mode.
example:
http://www.yoursite.com/?V=1
There are more detail information about parameters of apache autoindex module in http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#page-header.

Pretty URL & SEO-friendly URL?

I'm currently using Apache 2.2
I can do simple things like
RewriteRule ^/news$ /page/news.php [L]
RewriteRule ^/news/(.*)$ /page/news.php?id=$1 [L]
but what if I want to send 2 parameters like this
http://www.example.com/link/param1/param1_value/param2/param2_value
Lastly, I want to also know implementing SEO friendly URL like stackoverflow
though I can get access to a page with URL like
http://www.example.com/doc_no/
Just decorating that URL with
http://www.example.com/doc_no/this-is-the-article
Give me some suggestion with example snippets.
I know that the PHP symfony framework allows you to do that.
How does it work :
In apache config, use mod_rewrite to redirect ALL incoming resquest to a single entry point (in symfony this is called the "front controller")
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
In this front controller you are going to create a "Request" object which holds all the informations provided by the URL.
For example you could say that the first thing after the "/" is the name of the PHP file to call and everything else are parameters and values so that :
http://example.com/file/id/2 will call file.php with id=2
To do that, just use some reg exp and design you "Request" class carefully. For the example above the "Request" class should provide both getRequestedAction() and getParameter(string parameter) methods. The getRequestedAction() method will be used when the "Request" object is fully populated in order to call the correct file/action/method.
if you choose to populate the parameter array of the request object with both reg exp on the URL and a parsing of the _GET array, you may get to the point where :
http://example.com/file/id/2 is the same as http://example.com/file?id=2
(and both can work)
you can choose to ignore extensions (http://example.com/file.html is the same as http://example.com/file), or not.
Finally, for some URL, you can choose to just ignore everything that goes after the last '/'. So that : http://example.com/question/3/where-is-khadafi is the same as http://example.com/question/3/is-linux-better-than-windows
In the different file.php, just use $request->getParameter('id') to get the value of the "id" parameter, instead of using the _GET or _POST arrays.
The whole point is to
Redirect all incoming traffic to a single "front controller"
In that file, create a "Request" object that contains all the informations needed to run the site
Call the correct action (php file) based on the informations contained in that "Request" object
Inside the actions, use this request object to fetch the parameters contained in the URL
Hope this helps
Note Google have stated that they prefer news.php?id=$1 instead of news/$1 because it is easier for them to detect the variable. This is more pertinent when increasing the number of variables as just looking at your first example is a bit confusing:
http://www.example.com/link/param1/param1_value/param2/param2_value
You can always combine the two if one parameter is generic like a category:
http://www.example.com/param1/?id=param2_value
One should really reevaluate the design if more than one parameter is required and it is not a temporary search.