N
N
ndbn2015-11-05 14:40:10
PHP
ndbn, 2015-11-05 14:40:10

How to make php-wrapper for CGI (WSGI) script?

Hello.
There is a folder on the server where the wsgi script is located, and as far as I understand, it starts with Apache and constantly hangs in memory (a feature of WSGI).
I want to place index.php in this folder, so that when it (folder) is accessed, it will first be executed and, say, require authorization, and if it is successful, then index.php would give work to the wsgi script, as if there is no php file.
Is it possible to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2015-11-05
@alex-saratov

The script is registered in vhost.conf and control is given to it automatically.
It is possible to register authorization there. Example:

<VirtualHost *:2000>
   ServerName www.server.com
   ServerAdmin email
   DocumentRoot /var/www/html
   ErrorLog logs/server.com-error_log
   <Location /var/www/html >
    AuthType Basic
    AuthName "TAP Surveillance"
    AuthUserFile /var/www/s2/.htpasswd-users
    Require valid-user
   </Location>
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question