How to rename processes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Consider following apache config:

WSGIDaemonProcess testwsgi display-name=wsgi_testproject user=testproject group=testproject processes=4 threads=1
WSGIDaemonProcess cache    display-name=cache_testproject  user=testproject group=testproject processes=1 threads=1

WSGIScriptAlias / /home/testproject/testwsgi.py process-group=testwsgi application-group=%{GLOBAL}
WSGIImportScript /home/testproject/runcache.py process-group=cache application-group=%{GLOBAL}


Rename apache2 binary:

$ mv /usr/sbin/apache2 /usr/sbin/apache2-bin

Create wrapper apache2 and make it executable:

$ vi /usr/sbin/apache2
#!/bin/bash
exec -a apache2_testproject /usr/sbin/apache2-bin $@

Done

$ ps faxu | grep testproject

root      3846  0.0  0.2  94252  4532 ?        Ss   13:21   0:00 apache2_testproject -k start
testproject  3854  0.0  0.3 120220  5780 ?        Sl   13:21   0:00  \_ wsgi_testproject    -k start
testproject  3855  0.0  0.3 120220  5760 ?        Sl   13:21   0:00  \_ wsgi_testproject    -k start
testproject  3856  0.0  0.3 120220  5760 ?        Sl   13:21   0:00  \_ wsgi_testproject    -k start
testproject  3857  0.0  0.3 120220  5760 ?        Sl   13:21   0:00  \_ wsgi_testproject    -k start
testproject  3858  0.0  0.3  96188  6584 ?        S    13:21   0:00  \_ cache_testproject   -k start
www-data  3859  0.0  0.1  93480  2864 ?        S    13:21   0:00  \_ apache2_testproject -k start
www-data  3860  0.0  0.3 319280  6268 ?        Sl   13:21   0:00  \_ apache2_testproject -k start
www-data  3861  0.0  0.3 319280  6280 ?        Sl   13:21   0:00  \_ apache2_testproject -k start

More like this

  1. Apache X-sendfile with permissions checking by h0axify 2 years ago
  2. django under apache / mod_fcgid by mike_45 5 years, 2 months ago
  3. Log Django exceptions to Apache error log in mod_wsgi by simon 4 years, 7 months ago
  4. X-Sendfile static file serve view by dokterbob 3 years, 6 months ago
  5. Python fixup handler for Apache by ofalk 4 years, 10 months ago

Comments

(Forgotten your password?)