Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-13 Thread Graham Dumpleton
Since Python is embedded inside of Apache by mod_wsgi, ie., the Python library is linked into the process and the CLI Python is not run/used, all virtual environments you use with it must be created from the same version/directory installation of Python as mod_wsgi was compiled for. So it is

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-13 Thread A McBain
On Sun, May 12, 2024 at 11:37 PM A McBain wrote: > > On Sun, May 12, 2024 at 11:19 PM Graham Dumpleton > wrote: > > > > The mod_wsgi.so specified by LoadFile is what dictates version (and in what > > location) of Python is being used. > > > > Right now you are using one under your home

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-13 Thread A McBain
On Sun, May 12, 2024 at 11:19 PM Graham Dumpleton wrote: > > The mod_wsgi.so specified by LoadFile is what dictates version (and in what > location) of Python is being used. > > Right now you are using one under your home directory. I would not be > surprised if it is compiled for the version

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-13 Thread Graham Dumpleton
The mod_wsgi.so specified by LoadFile is what dictates version (and in what location) of Python is being used. Right now you are using one under your home directory. I would not be surprised if it is compiled for the version of Python you built yourself from source code

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-13 Thread A McBain
On Sun, May 12, 2024 at 11:08 PM A McBain wrote: > > > > On Sun, May 12, 2024 at 10:57 PM Graham Dumpleton > wrote: > > > > Ensure you do a complete stop and start of Apache and not just reload or > > restart in case Apache had cached a reference to a broken Python library > > variant from

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-13 Thread A McBain
On Sun, May 12, 2024 at 10:57 PM Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > Ensure you do a complete stop and start of Apache and not just reload or restart in case Apache had cached a reference to a broken Python library variant from your self compiled build. > > If going to build

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread Graham Dumpleton
Ensure you do a complete stop and start of Apache and not just reload or restart in case Apache had cached a reference to a broken Python library variant from your self compiled build. If going to build your own Python from source code ensure you read. A bit dated, but still relevant. Ignore

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread A McBain
On Sun, May 12, 2024 at 10:22 PM A McBain wrote: > > On Sun, May 12, 2024 at 10:05 PM A McBain wrote: > > > > On Sun, May 12, 2024 at 9:47 PM Graham Dumpleton > > wrote: > > > > > > > > > > > > On 13 May 2024, at 2:33 PM, A McBain wrote: > > > > > > The old one is running on the same physical

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread A McBain
On Sun, May 12, 2024 at 10:05 PM A McBain wrote: > > On Sun, May 12, 2024 at 9:47 PM Graham Dumpleton > wrote: > > > > > > > > On 13 May 2024, at 2:33 PM, A McBain wrote: > > > > The old one is running on the same physical server, just with its own > > Apache config and own subdomain. As to

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread A McBain
On Sun, May 12, 2024 at 9:47 PM Graham Dumpleton wrote: > > > > On 13 May 2024, at 2:33 PM, A McBain wrote: > > The old one is running on the same physical server, just with its own Apache > config and own subdomain. As to having multiple things running, that's why I > set WSGIApplicationGroup

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread Graham Dumpleton
> On 13 May 2024, at 2:33 PM, A McBain wrote: > > The old one is running on the same physical server, just with its own Apache > config and own subdomain. As to having multiple things running, that's why I > set WSGIApplicationGroup to %{SERVER} but just in case I changed it > explicitly to

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread A McBain
Apologies, I noticed a small issue with the previously attached config. Unfortunately I don't get to be so lucky as to have that solve my problem.  (I'd asked to load wsgi.py instead of wsgi.prod.py while only granting access to the latter.) On Sun, May 12, 2024 at 9:03 PM A McBain wrote: >

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread A McBain
The old one is running on the same physical server, just with its own Apache config and own subdomain. As to having multiple things running, that's why I set WSGIApplicationGroup to %{SERVER} but just in case I changed it explicitly to "enfilade.asmcbain.net" (no effect, but shouldn't hurt

Re: [modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread Graham Dumpleton
On 13 May 2024, at 2:02 PM, A McBain wrote: > > Hi, I looked at previous messages and others on StackOverflow but none seem > to solve my issue. > > I have an app I wrote working perfectly fine under Python 3.11 with mod_wsgi > and Apache 2. > > I did a bunch of development on the app

[modwsgi] mod_wsgi fails on import, using system Python not venv

2024-05-12 Thread A McBain
Hi, I looked at previous messages and others on StackOverflow but none seem to solve my issue. I have an app I wrote working perfectly fine under Python 3.11 with mod_wsgi and Apache 2. I did a bunch of development on the app (upgraded django, new features), and set up a new checkout of that

Re: [modwsgi] Multiple flask projects not running using mod_wsgi

2024-05-11 Thread Graham Dumpleton
As per the message it seems you are using a Python module that is not designed to be used in multiple sub interpreters of the same process and even has an explicit check to stop you from trying. Not really much you can do about it as Apache on Windows doesn’t support multi process.Hat is the

[modwsgi] Multiple flask projects not running using mod_wsgi

2024-05-11 Thread Pooja Shastri
We have windows apache server , and we want to host parallelly 3 python-flask projects using differrent ports and same server name. Project 1 uses numpy and lxml which needs WSGIApplicationGroup %{GLOBAL} for c extensions. Project 2 and 3 does not need %{GLOBAL}% The issue is in httpd.conf file

Re: [modwsgi] pip can not install mod_wsgi

2024-03-27 Thread Bashaar Dhoot
Hi Graham, Yes upgrading python has helped! Did not realise you can have multiple python versions on the machine. its seems it was pointing to: /Users/bashaar/anaconda3/bin/python, which had a python 3.9 version and deactivating conda solved the issue Thanks again, Bashaar On Tuesday 26

Re: [modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2024-03-26 Thread Graham Dumpleton
Not sure what you are asking for at this point. The workers talked about for the MPM are the Apache child worker processes, which when using mod_wsgi daemon mode only serve as proxies for proxying requests through to the mod_wsgi daemon processes. This is explained in the videos I linked. It

Re: [modwsgi] pip can not install mod_wsgi

2024-03-26 Thread Graham Dumpleton
You do not want to be installing Python/Apache from source code on macOS. The Apache source distributions will not even build on macOS still as far as I know. People who package it up for distributions such as Homebrew need to patch the sources to get it to compile. Getting Python to install

Re: [modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2024-03-26 Thread Manu Itutur
Any chance to have some help on this ? Thanks in advance. Manu On Friday, February 9, 2024 at 1:06:11 PM UTC+1 Manu Itutur wrote: > Hello Graham, > > Thanks for your answer. Here is the full apache configuration > > > Servername redacted.io > RewriteEngine On > WSGIPassAuthorization on >

Re: [modwsgi] pip can not install mod_wsgi

2024-03-26 Thread Bashaar Dhoot
Hi Graham, I have been reading the requirements and the only thing I could think of is to make sure I have a complete installation of Apache, which I think I have. Other wise would a direct installation into python work? Or would it be the same problem? I am not sure which distribution

Re: [modwsgi] pip can not install mod_wsgi

2024-03-26 Thread Graham Dumpleton
Whose Python and Apache distributions are they? On macOS you shouldn't have an issue with Homebrew packages, but Fink packages have been a problem in the past and I gave up using them myself a very long time ago. Or have you built Python and Apache yourself from source code somehow? Graham On

Re: [modwsgi] pip can not install mod_wsgi

2024-03-26 Thread Bashaar Dhoot
Hi Graham, Thanks so much for the reply. I will look into the requirements needed and have a read! This is the complete output: pip install mod_wsgi DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no

Re: [modwsgi] pip can not install mod_wsgi

2024-03-26 Thread Graham Dumpleton
You need to provide the complete output from pip, not just the last message otherwise I can't tell what the problem is. Most likely you are either missing the Python dev package, missing a compiler, or missing system Apache runtime and/or dev package. The requirements for what you need are

[modwsgi] pip can not install mod_wsgi

2024-03-26 Thread Bashaar Dhoot
Hi, I been having a problem installing mod_wsgi and mod_wsgi-standalone on terminal. I am getting error messages like: error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [623 lines of output] and python

Re: [modwsgi] mod_wsgi script encodings (and other issues with mod_wsgi script loading)

2024-03-23 Thread Lucas Thode
The handling you're after was indeed refactored extensively around Python 2.3 or so with the introduction of the PEP 302 import hooks, so you're right that the way mod_wsgi does it is a legacy of very early Python (1.x most likely). Modern Pythons (recent 2.x versions and all 3.x versions)

Re: [modwsgi] mod_wsgi script encodings (and other issues with mod_wsgi script loading)

2024-03-21 Thread Graham Dumpleton
A WSGI script file is not a __main__ module which is how a script file given as an argument to command line Python is treated. From memory the code related to importing that script file as the __main__ module and all the special treatment related to it is very convoluted and not something that can

Re: [modwsgi] mod_wsgi script encodings (and other issues with mod_wsgi script loading)

2024-03-21 Thread Lucas Thode
The problem with your statement that "As to the initial WSGI script file, it is not a module import and so any special language encoding definition in a magic header of the file is ignored and it should just use whatever the Python lang/locale is set to." is that the CPython interpreter itself

Re: [modwsgi] mod_wsgi script encodings (and other issues with mod_wsgi script loading)

2024-03-21 Thread Graham Dumpleton
Depends a little bit on whether you are using embedded mode or daemon mode of mod_wsgi, or whether using mod_wsgi-express. The Python embedded in Apache when not using mod_wsgi-express should by default inherit the system default locale. This is often the C or POSIX locale from memory and not any

[modwsgi] mod_wsgi script encodings (and other issues with mod_wsgi script loading)

2024-03-21 Thread Lucas Thode
What determines which encoding mod_wsgi uses when it reads WSGI scripts: Apache's configured locale (which for me is en_us.UTF8), or something else? (I ask about this because mod_wsgi appears to do low-level manual hackery when reading wsgi script files instead of going through importlib or

Re: [modwsgi] Django site doesn't run after machine rebuild using 4.9.0

2024-03-02 Thread Graham Dumpleton
Keep in mind that if you have a WSGI file in at the location: /data/www/wikidataDiscovery/wikidataDiscovery/wsgi.py it is not sufficient that the file /data/www/wikidataDiscovery/wikidataDiscovery/wsgi.py be readable. It is also necessary that all the parent directories down to that location are

[modwsgi] Django site doesn't run after machine rebuild using 4.9.0

2024-03-02 Thread Andre Hulet
I run one of my Django sites on my local machine for testing. I recently had to rebuild the machine, and now my site doesn't run (403-you don't have permission to access this resource) even though .conf file settings and file system permissions appear identical. I have a hello world wsgi app

Re: [modwsgi] print() output not appearing in apache error.log with Python 3

2024-02-29 Thread Graham Dumpleton
Have you tried just a WSGI hello world with print() statements in it to make sure nothing about any framework used is interfering. import sys def application(environ, start_response): status = '200 OK' output = b'Hello World!' print("Hi there!") print("Send to stdout

[modwsgi] print() output not appearing in apache error.log with Python 3

2024-02-29 Thread YKdvd
I've got a Flask wsgi app, where there are print statements in the myapp.wsgi, which take advantage of the "send unhandled print stuff out through the apache error log". This was working fine with Python 2.7/Ubuntu 16.04, and the output appeared in the apache error.log as expected. But after

[modwsgi] [solved]Re: Source code change not taken into account

2024-02-21 Thread Anthony Sanchez
Solved the issue. I just had to reorganise my wsgi entry file like this : import sys path = '/var/www/mysite.fr/mysite' if path not in sys.path: sys.path.insert(0, path) from app import create_app application = create_app() with app.py located within the same directory as the wsgi entry file

[modwsgi] Source code change not taken into account

2024-02-21 Thread Anthony Sanchez
Hi all, I am facing a small issue regarding the reload of my source code change with mod_wsgi in embeded mode. I made some changes in my code source, but those changes are not taken into account when I restart apache. I did the following with no result : - applied a minor change in the

Re: [modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2024-02-09 Thread Manu Itutur
Hello Graham, Thanks for your answer. Here is the full apache configuration Servername redacted.io RewriteEngine On WSGIPassAuthorization on # Block access for all IPs in /etc/apache2/ipblacklist.conf RewriteMap hosts-deny "txt:/etc/apache2/ipblacklist.conf" RewriteCond

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-02-08 Thread Greg Popp
I have found that the tcp stack is causing these disconnects. I'm getting into a state where the sending socket's buffer is full, as is the receiving socket's and tcp begins to do retransmission attempts. Once it hits the system max the connection is terminated. In the immortal words of the

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-02-07 Thread Greg Popp
I forgot - one other thing I tried was the file wrapper. The file wrapper does NOT experience the disconnects. On Wednesday, February 7, 2024 at 2:54:47 PM UTC-6 Greg Popp wrote: > I'm still struggling with disconnects with my slow readers. Here is all > that I have experimented with: > > I

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-02-07 Thread Greg Popp
I'm still struggling with disconnects with my slow readers. Here is all that I have experimented with: I downloaded the latest version of mod_wsgi source (5.0.0) and built it on my Centos7 system. This all seemed to work well and I am now running that version. I modified my app to return an

Re: [modwsgi] How to tell which version of mod_wsgi Apache is using?

2024-02-05 Thread Olof S
Fantastic -- it does indeed show up in the error log. Thank you! On Monday, February 5, 2024 at 1:33:22 AM UTC+1 Graham Dumpleton wrote: > > Sorry, read too quickly. > > The Apache error logs when it starts up should show the mod_wsgi version. > > If a new enough mod_wsgi version you can also

Re: [modwsgi] How to tell which version of mod_wsgi Apache is using?

2024-02-04 Thread Graham Dumpleton
Sorry, read too quickly. The Apache error logs when it starts up should show the mod_wsgi version. If a new enough mod_wsgi version you can also import mod_wsgi module and print out version. https://modwsgi.readthedocs.io/en/master/user-guides/assorted-tips-and-tricks.html Know whether

Re: [modwsgi] How to tell which version of mod_wsgi Apache is using?

2024-02-04 Thread Olof S
If I understand that documentation correctly, that tells me about the python version. I'm instead after seeing which version of mod_wsgi I'm using. What am I missing? On Sun, Feb 4, 2024, 20:24 Graham Dumpleton wrote: > See documentation at: > > Checking Your Installation — mod_wsgi 5.0.0

Re: [modwsgi] How to tell which version of mod_wsgi Apache is using?

2024-02-04 Thread Graham Dumpleton
See documentation at: https://modwsgi.readthedocs.io/en/master/user-guides/checking-your-installation.html#python-installation-in-use > On 4 Feb 2024, at 10:59 pm, Olof S wrote: > > Thank you so much for mod_wsgi! > > How can I tell which version of mod_wsgi is in use? Someone else set up

[modwsgi] How to tell which version of mod_wsgi Apache is using?

2024-02-04 Thread Olof S
Thank you so much for mod_wsgi! How can I tell which version of mod_wsgi is in use? Someone else set up the server ages ago, and I don't know if Apache is using the version of mod_wsgi from the system package manager, or if it's using some version built from source, and if so which. Is there a

Re: [modwsgi] running 5.0.0 on Rocky Linux 9

2024-01-25 Thread Graham Dumpleton
Looks about normal for RH based Linux variants. The compiler development tool suite may well have got installed automatically when installed python3-devel as should have been a dependency on it. > On 26 Jan 2024, at 6:41 am, Steve Grubb wrote: > > Today I was able to stand up apache with

[modwsgi] running 5.0.0 on Rocky Linux 9

2024-01-25 Thread Steve Grubb
Today I was able to stand up apache with mod_wsgi on Rocky Linux 9 python3.9 is native ... so the basic steps were: sudo dnf update sudo dnf install httpd sudo dnf install httpd-devel sudo dnf groupinstall development(not sure if necessary) sudo dnf install python3-devel

Re: [modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Graham Dumpleton
You can use any recent Python 3.X version. Right now it is picking some Python 3.7 installation you have and not Python 3.11 as you expected. All I can tell you is that you have probably installed multiple versions of Python at different times but in some cases have installed it just for your

Re: [modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Ananth Mandli
i don't know what's wrong i did C:\Apache24\bin>pip install mod_wsgi==4.5.24 Collecting mod_wsgi==4.5.24 Using cached mod_wsgi-4.5.24.tar.gz (2.6 MB) Preparing metadata (setup.py) ... done Building wheels for collected packages: mod_wsgi Building wheel for mod_wsgi (setup.py) ... error

Re: [modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Ananth Mandli
please help me which version i have to use On Sat, 20 Jan 2024 at 11:09, Ananth Mandli wrote: > I don't know What's wrong i did > > > Collecting mod_wsgi==4.5.24 > Using cached mod_wsgi-4.5.24.tar.gz (2.6 MB) > Preparing metadata (setup.py) ... done > Building wheels for collected

Re: [modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Graham Dumpleton
There is something broken about your Python installation if you think you are using Python 3.11. The compiler output shows: -Ic:\users\91915\appdata\local\programs\python\python37-32\include -Ic:\users\91915\appdata\local\programs\python\python37-32\Include As you can see it is trying to

Re: [modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Ananth Mandli
I don't know What's wrong i did Collecting mod_wsgi==4.5.24 Using cached mod_wsgi-4.5.24.tar.gz (2.6 MB) Preparing metadata (setup.py) ... done Building wheels for collected packages: mod_wsgi Building wheel for mod_wsgi (setup.py) ... error error: subprocess-exited-with-error ×

Re: [modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Ananth Mandli
I am using ==> Python 3.11.1 ==>Apache24 ==>Microsoft visual c++ 2015-2022 redistributable On Sat, 20 Jan 2024 at 01:29, Graham Dumpleton wrote: > This error generally indicates you have the wrong version or a badly > installed version of the Microsoft Visual Studio build tools. > > Try

Re: [modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Graham Dumpleton
This error generally indicates you have the wrong version or a badly installed version of the Microsoft Visual Studio build tools. Try reinstalling Visual Studio Build Tools, making sure it is the correct version for the version of Python you are using. Since you are using an older version of

[modwsgi] I am unable to install mod_wsgi in windows 11

2024-01-19 Thread Ananth Mandli
Building wheel for mod_wsgi (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [375 lines of output] creating build\temp.win32-cpython-37\Release\src\server "C:\Program Files (x86)\Microsoft

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-01-12 Thread Greg Popp
Thank you again! The data IS in a file, but it requires an application to extract the requested salient pieces. I will look at the file wrapper extension. After more testing, I now think that I can fix my problem just by using your second suggestion of increasing the Timeout configuration

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-01-11 Thread Graham Dumpleton
If using the file_wrapper feature, make sure you also add: WSGIEnableSendfile On to mod_wsgi configuration as not on by default: https://modwsgi.readthedocs.io/en/master/release-notes/version-4.1.0.html#features-changed The file_wrapper mechanism would still have worked, but to use kernel

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-01-11 Thread Graham Dumpleton
Also not sure whether it will help or not, but if the data you are sending is stored in a file and not generated on demand, then you might consider using the WSGI file_wrapper extension instead. https://modwsgi.readthedocs.io/en/master/user-guides/file-wrapper-extension.html I don't know how

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-01-11 Thread Greg Popp
Thank you very much! This is most helpful, though I don't think any of them will actually solve my issues, for many of the reasons you mentioned. I was thinking that perhaps the mod_wsgi interface had access to the file descriptor for the network socket used by Apache and could call "select" to

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-01-10 Thread Graham Dumpleton
So what you are encountering is limitations in the socket buffer size enforced by the operating system, in combination with Apache httpd applying a socket timeout. In other words what happens is that the HTTP client isn't reading data and so the operating system level socket buffer fills up.

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-01-10 Thread Greg Popp
embedded On Wednesday, January 10, 2024 at 1:32:52 PM UTC-6 Graham Dumpleton wrote: > Are you using mod_wsgi embedded mode or daemon mode? > > Graham > > On 11 Jan 2024, at 2:44 am, Greg Popp wrote: > > Hello! > > My version of mod_wsgi is running on a Centos-7 system and is at version > 3.4,

Re: [modwsgi] Using write with large amounts of data causing disconnects

2024-01-10 Thread Graham Dumpleton
Are you using mod_wsgi embedded mode or daemon mode? Graham > On 11 Jan 2024, at 2:44 am, Greg Popp wrote: > > Hello! > > My version of mod_wsgi is running on a Centos-7 system and is at version 3.4, > (I know - very old) with python 2.7 > > I have been using mod_wsgi for a python

[modwsgi] Using write with large amounts of data causing disconnects

2024-01-10 Thread Greg Popp
Hello! My version of mod_wsgi is running on a Centos-7 system and is at version 3.4, (I know - very old) with python 2.7 I have been using mod_wsgi for a python application that runs a command-line program and marshals the output of the command line program back to an http client. The data

Re: [modwsgi] mod_wsgi-express: command not found

2023-12-14 Thread Graham Dumpleton
See comments below. > On 14 Dec 2023, at 10:41 pm, yoshitaka okada > wrote: > > This is the apache configuration. It was working before I updated python to > 3.11. > > ``` > > # The ServerName directive sets the request scheme, hostname and port > that > # the server uses

Re: [modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2023-12-14 Thread Graham Dumpleton
The issue with the process-group option you have is that it doesn't match the name of the process group. You have "custom" instead of "ipt". To be honest I even missed you had the process-group option in there. Since didn't match you should actually have got an error. So maybe you do have it

Re: [modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2023-12-14 Thread Manu Itutur
Thanks for your answer, In my file I use absolute path, I remove some "sensitive" data, therefore it's then a relative path, sorry for the confusion. I already watched both video couple of days ago, but I guess I missed something. I will check process-group option in WSGIScriptAlias, hope

Re: [modwsgi] mod_wsgi-express: command not found

2023-12-14 Thread yoshitaka okada
This is the apache configuration. It was working before I updated python to 3.11. ``` # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of

Re: [modwsgi] mod_wsgi-express: command not found

2023-12-14 Thread Graham Dumpleton
> On 14 Dec 2023, at 9:42 pm, Graham Dumpleton > wrote: > > If using pip install version of mod_wsgi, make sure that you haven't > installed operating system package for mod_wsgi and have configuration using > that still laying around. In other words, you should also have line: Mean to say

Re: [modwsgi] mod_wsgi-express: command not found

2023-12-14 Thread Graham Dumpleton
If using pip install version of mod_wsgi, make sure that you haven't installed operating system package for mod_wsgi and have configuration using that still laying around. In other words, you should also have line: LoadModule wsgi_module modules/mod_wsgi.so That should be

Re: [modwsgi] mod_wsgi-express: command not found

2023-12-14 Thread yoshitaka okada
Thank you master :) The command now works. ``` (venv) rootik1-336-28225:/home/ubuntu# mod_wsgi-express module-config LoadModule wsgi_module "/var/www/html/venv/lib/python3.11/site-packages/mod_wsgi/server/mod_wsgi-py311.cpython-311-x86_64-linux-gnu.so" ``` I replaced LOAD_MODULE with...

Re: [modwsgi] mod_wsgi-express: command not found

2023-12-14 Thread Graham Dumpleton
The mod_wsgi-express command is available when installing mod_wsgi using pip. See: https://pypi.org/project/mod-wsgi/ mod-wsgi pypi.org and watch: https://www.youtube.com/watch?v=CPz0s1CQsTE=5s Graham Dumpleton - Secrets of a WSGI master. - PyCon 2018 youtube.com If you want to use

[modwsgi] mod_wsgi-express: command not found

2023-12-14 Thread yoshitaka okada
hello :) I am trying to upgrade a Django project on ubuntu. However, now I am getting an Internal Server Error. My environment is as follows ``` (venv) ubuntu@ik1-336-28225:/usr/src$ cat /etc/issue Ubuntu 20.04.3 LTS \n \l ``` ``` apachectl -v Server version: Apache/2.4.41 (Ubuntu) Server

Re: [modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2023-12-13 Thread Graham Dumpleton
BTW the location given in python-path, second argument to WSGIScriptAlias and argument to Directory directive are supposed to be absolute paths, not relative. Use of a relative path might cause incorrect results. For a virtual environment you should not use python-path like that anyway.

Re: [modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2023-12-13 Thread Graham Dumpleton
You are missing WSGIProcessGroup directive or process-group option to WSGIScriptAlias, so you aren't even delegating requests to be handled by the mod_wsgi daemon process group. That will be in part why things are not making sense. For more background go watch:

[modwsgi] Correlation between mod_wsgi Daemon Processes and apache mpm_worker

2023-12-13 Thread Manu Itutur
Hello, I'm having an hard time understanding the correlation between mod_wsgi Daemon Processes and apache mpm_worker (if there is any). I'm running a Django application on an Ubuntu 22.04 Apache Server, and I would like to optimise the CPU / RAM usage of it, as it looks like when there is a

Re: [modwsgi] Inquiry about Possible Cache Mechanism or Issue in mod_wsgi with ApacheServer and Django

2023-12-05 Thread Graham Dumpleton
Since you are on Windows there would be only one process. So long as you aren't defining multiple VirtualHost definitions with separate WSGIScriptAlias for each, then all requests for the Django app should be in same interpreter context and data is common. So not a problem with requests being

Re: [modwsgi] Inquiry about Possible Cache Mechanism or Issue in mod_wsgi with ApacheServer and Django

2023-12-05 Thread 王省三
My project is on Windows, and the relevant configuration in httpd.conf is as follows: LoadFile "C:\Program Files\myproject\Python\python37.dll" LoadModule wsgi_module "C:\Program Files\myproject\Python\lib\site-packages\mod_wsgi\server\mod_wsgi.cp37-win32.pyd" WSGIPythonHome "C:\Program

Re: [modwsgi] Inquiry about Possible Cache Mechanism or Issue in mod_wsgi with ApacheServer and Django

2023-12-04 Thread Graham Dumpleton
There may not be only a single object because of how you have configured Apache/mod_wsgi. Read: * https://modwsgi.readthedocs.io/en/master/user-guides/processes-and-threading.html Then post your configuration so can see whether you are using embedded mode or daemon mode of mod_wsgi, and if

[modwsgi] Inquiry about Possible Cache Mechanism or Issue in mod_wsgi with ApacheServer and Django

2023-12-04 Thread 王省三
Dear mod_wsgi community, I hope this message finds you well. I am encountering an issue in my project setup, which involves ApacheServer, mod_wsgi, and Django. Specifically, when accessing the project from both the company's internal network and external network, it appears that different

Re: [modwsgi] Trac

2023-11-30 Thread Graham Dumpleton
An update to the TracInstall page would be helpful. https://trac.edgewall.org/wiki/TracInstall On Friday, 1 December 2023 at 07:56:40 UTC+11 jun...@gmail.com wrote: > Python 3.5+ is supported since Trac 1.6. > > See https://trac.edgewall.org/wiki/TracDev/ReleaseNotes/1.6 > > On Fri, Dec 1, 2023

Re: [modwsgi] Trac

2023-11-30 Thread Jun Omae
Python 3.5+ is supported since Trac 1.6. See https://trac.edgewall.org/wiki/TracDev/ReleaseNotes/1.6 On Fri, Dec 1, 2023 at 5:42 Graham Dumpleton wrote: > You should not use mod_wsgi-standalone package. You should use the > standard mod_wsgi package and ensure that system Apache development

Re: [modwsgi] Trac

2023-11-30 Thread Graham Dumpleton
You should not use mod_wsgi-standalone package. You should use the standard mod_wsgi package and ensure that system Apache development package is installed so that mod_wsgi is compiled against and uses it instead. Next is that Trac provides only instructions for integrating with system Apache

[modwsgi] Trac

2023-11-30 Thread Doug Epling
I am determined to get this working. The thing is developers write copious documentation, without revision dates, and technology does not stand still. I am down to one virtual environment with mod_wsgi-standalone in lib64/ with Python site-packages and with Trac in lib/ with site-packages.

Re: [modwsgi] Apache mod_wsgi python server is giving 503

2023-10-18 Thread Graham Dumpleton
Can you supply the full log messages below from Apache error log with any prefixes so I can identify what output them. The mod_wsgi code does emit a message "Python has shutdown", but doesn't emit a message "Connection closed to child with abortive shutdown". So is important that can see the

[modwsgi] Apache mod_wsgi python server is giving 503

2023-10-18 Thread Darshan Patil
Hi, I have my apache server where I am using mod_wsgi to run python endpoints which serve images from the server. There are lot of requests hitting the server and I started seeing errors like following: Python has shutdown. Connection closed to child with abortive shutdown. Resource

Re: [modwsgi] Timeout when reading response headers from daemon process. mod_wsgi, python, flask, apache, centos

2023-10-18 Thread Darshan Patil
Hi, Did you got this resolved, I am having somewhat similar issues. Darshan On Monday, 29 March 2021 at 14:55:20 UTC-7 ramiro rodriguez wrote: > Ok, i was adding the sentence inside the VirtualHost. I set it outside, > and apache works. I will try if this solves the problem. > > Thanks

Re: [modwsgi] How to authenticate against Django’s user database from Apache

2023-09-07 Thread Marcel Müller
And when I keep the default /wsgi.py but follow the documentation with etc, I get the following apache error: mod_wsgi (pid=6277): Target WSGI user authentication script '/var/www/solutions/mysite/mysite/wsgi.py' does not provide 'Basic' auth provider., referer:

Re: [modwsgi] How to authenticate against Django’s user database from Apache

2023-09-07 Thread Marcel Müller
Hi Graham, you're right. Here are parts of the following files: 1. */apache.conf* 2. */000-default.conf* 3. */wsgi.py* #default 4. */wsgi.py* #with code from documentation 5. *Error message* #when I use code from 4.

Re: [modwsgi] How to authenticate against Django’s user database from Apache

2023-09-06 Thread Graham Dumpleton
What errors are logged to the Apache error log? What does the Python code you have added look like? What does the Apache configuration you have added look like? Without more information it is hard to guess what the issue may be. Graham > On 7 Sep 2023, at 2:21 am, Marcel Müller wrote: > >

[modwsgi] How to authenticate against Django’s user database from Apache

2023-09-06 Thread Marcel Müller
Hi, when I follow the documentation I get an 500 Internal Server Error. I want to protect images (uploads by the user) from the public and other users. Everything works until I get to the part like in the subject described. When I follow the documentation like "*Finally, edit your WSGI

Re: [modwsgi] modwsgi installation in python 2.7

2023-08-10 Thread Graham Dumpleton
The Apache distribution you are using is either not 64bit, or is not packaged up to include the bits that would allow compilation of Apache extensions modules. The latter is quite common with xampp distributions of Apache. It is strongly recommended you use the Apache Lounge distribution of

[modwsgi] modwsgi installation in python 2.7

2023-08-10 Thread krishna personal
ERROR: Command errored out with exit status 1: command: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\userid\\appdata\\local\\temp\\4\\pip-install-ufntlw\\mod-wsgi\\setup.py'"'"';

Re: [modwsgi] Https for flask deployment

2023-05-15 Thread Graham Dumpleton
That port 5000 is mentioned makes it look like the HTML code of the page requesting the image is hardwiring port 5000. Apache/mod_wsgi shouldn't be generating that since it isn't set up to use that port. That or the Flask config mentions port 5000 somewhere and that is used in generating URLs.

Re: [modwsgi] Need help on mod_wsgi module installation in Oracle HTTP Server

2023-05-05 Thread Graham Dumpleton
General documentation for mod_wsgi can be found at: https://modwsgi.readthedocs.io/en/master/ Details of using pip to install mod_wsgi can be found at: https://pypi.org/project/mod-wsgi/ mod-wsgi pypi.org Django specific instructions can be found at:

[modwsgi] Need help on mod_wsgi module installation in Oracle HTTP Server

2023-05-05 Thread ramesh pasham
Hi Team, I would like to deploy a django application on Oracle HTTP Server using mod_wsgi module. I need installation steps how to configure mod_wsgi module in Oracle HTTP Server Please help me. Thanks, Ramesh -- You received this message because you are subscribed to the Google Groups

Re: [modwsgi] Timeout error for flask app

2023-04-29 Thread Aash
I see, thank you Graham for the explanation. Regards, Ash On Saturday, April 29, 2023 at 9:34:52 PM UTC-7 Graham Dumpleton wrote: > Having to set these timeouts to be very large values is generally > indicative of a poor design. > > For these sorts of long running operations you are usually

Re: [modwsgi] Timeout error for flask app

2023-04-29 Thread Graham Dumpleton
Having to set these timeouts to be very large values is generally indicative of a poor design. For these sorts of long running operations you are usually better of using a background task queuing system like Celery to handle running of the job. Your front end then just queues the job and polls

Re: [modwsgi] Timeout error for flask app

2023-04-29 Thread Aash
I never changed it. It shows 300. Should I make it to 600? On Saturday, April 29, 2023 at 9:21:15 PM UTC-7 Graham Dumpleton wrote: > What is the Timeout directive set to in your main Apache configuration? > > On 30 Apr 2023, at 2:18 pm, Aash wrote: > > Hello Graham, Thanks for the quick

Re: [modwsgi] Timeout error for flask app

2023-04-29 Thread Graham Dumpleton
What is the Timeout directive set to in your main Apache configuration? > On 30 Apr 2023, at 2:18 pm, Aash wrote: > > Hello Graham, Thanks for the quick response. > > The API response depends on how many items are sent in a batch so for a long > list it can take a long time (It is taking a

  1   2   3   4   5   6   7   8   9   10   >