On 5 Sep 2016, at 6:31 AM, Roger Wayne <perve...@gmail.com> wrote:I have. What I do is put the pre-compiled mod_wsgi.so file in the modules folder. Then I edit the hhtpd.conf file with the LoadModule line and the lines that add it to the directory, and XAMPP complains about how apache can not start for whatever reason. I tried multiple mod_wsgi.so files I found (even the one on the main github page). While I have not tried them all because I know there is a lot, I feel like maybe the problem isn't with files themselves. I am not sure what is going on, but if you or anyone could lead me in the right direction, that would be very much appreciated.
On 5 Sep 2016, at 5:05 PM, Roger Wayne <perve...@gmail.com> wrote:
How did you extract the mod_wsgi.so file from the .whl files from:I used the pip tool and it gave an error saying "Could not find a version that satisfies
the requirement mod_wsgi (from version: ) No matching distribution found for mod_wsgi”
It is not the .so file itself, but a zip file that needs to be unpacked.Which of those files provided there did you use? What was the name?So I downloaded the zipped file and unpacked it. Form other sources, there are already complied mod_wsgi.so files but not in this folder so I figured I I had to compile and build it through the use of the makefiles in the win32 folder. So I modified the common-VC10.mk file and used the ap24-py34-VC10.mk file and ran into some trouble as stated before.
Those binaries are also compiled for Apache form the Apache Lounge site. If you use a different Apache binary distribution it may not work.It is important that you know whether your Apache is 32 bit or 64 bit. The Python version you have must be same architecture, ie., 32 bit or 64 bit, you cannot mix.What architecture are you using, 32 bit or 64 bit and are you certain both Apache and Python are for that?What version of Python are you using? Do you have more than one Python version installed?Both my Apache and Python are 32-bit. I do have two version of Python, Python 3.5 and 3.4. I tried it with 3.5 at first but I download 3.4 thinking it would work somehow.
What was the actual error message in the Apache error logs you get when it fails to start up?A good bit of it was "server certificate does NOT include an ID which matches the server name", but later on when I tried other stuff, it was telling me my one of my python scripts had a syntax error. Which is weird because it definitely did not and I ran it through the compiler to make sure. I attached the error log if you want to check it out. It is quite lengthy though as I did try many times.
I know there is definitely easier ways to doing all this but I am quite new to server-side Python scripting and just web development in general so if you can bear with me, that would be awesome.Thanks
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.
<error.log>
On 6 Sep 2016, at 4:56 AM, Roger Wayne <perve...@gmail.com> wrote:What was the exact pip command you used? Want to know whether you used the URL location from the Internet, or copied the file to local disk and tried to install it from there. Provide the actual command can so see."pip install mod_wsgi" I downloaded it to my hard drive and tried to install it from there.
The .whl file is a zip file is what I meant. So download from pythonlibs site and change extension from .whl to .zip if necessary and then unpack it.You really want to avoid trying to compile it yourself as getting the right compiler is a pain. For Python 3.5 there are no instructions for how to get the corresponding compiler. They use different compiler to what 3.4 and before used.But what mod_wsgi binaries were you using? That is why I think I already asked which you downloaded. That is, what was the actual name of package pulled down. They have architecture and version information in names. You have to use the correct one."mod_wsgi-4.4.23+ap24vc10-cp34-cp34m-win32.whl" but I also tried "mod_wsgi-4.4.23+ap24vc14-cp35-cp35m-win32.whl" on Python 3.5 . Also I went to the main github page and downloaded the zipped file mod_wsgi-4.5.5 I believe.
Am really surprised you would be using 32 bit. You would generally want to be using 64 bit these days.The errors in log are because you are trying to run stuff as CGI scripts and also because you are using Python 2 code and not Python 3 code. The way that ‘print()’ is used differs.Xampp was only available in 32-bit (for Windows) and as you stated before, everything has to be 32 or 64 bit. I tried out Wamp (it is available in 64-bit) but Xampp was more user friendly to me. Do you really think it is a good idea to be using 64 bit? I would say performance-wise, it would make a great deal of a difference but I don't know how much that difference would be.This is where I am confused. My code in the CGI scrips is Python 3 code. I ran it through the compiler for Python, and I only have version 3. I was definitely lost when i saw that error because my compiler was saying that my code was good to go yet the error log said I had a syntax error. But now that you brought it up, Python 2 uses print without parenthesis. It still is strange because everything I have gotten so far were versions for Python 3, so Python 2 shouldn't even be a factor. At least I don't think. I attached the code that it was complaining about in case you wanted to check it out for yourself. But you are saying the extension should be .py instead of .cgi, , right? I thought it did not matter what the extension was but having the .py extension would make sense.Thanks for sticking with me so far.
--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.
<tasteful.cgi>
I see. So Docker can provide somewhat of a all-in-one package so I don't have to worry about configuring anything? Well either way, it seems that maybe would be a simpler solution. I will try to tinker with what I have a bit more to see if I can get it to work. I feel like I am close. If I do succeed, I will post it here so in case anyone runs into the same problem, they can check it out. If not then the solutions you provided would be the next best thing.
On 8 Sep 2016, at 7:01 AM, Roger Wayne <perve...@gmail.com> wrote:Good gravy, I finally got it working! Well at least I can print out "Hello World!".So what worked for me is getting the corresponding .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi and changing the extenzion to .zip and unpacking it. Once that is done, fine the mod_wsgi.so and put it in the modules folder for Apache. Now here was the part that was tripping me up all this time. When editing the httpd.conf file, I tried doing what most others seem to have done and put in"LoadModule wsgi_module modules/mod_wsgi.soWSGIScriptAlias /<yourfoldername>"C:/xampp/htdocs/<yourfoldername>/"
<Directory "C:/xampp/htdocs/<yourfoldername>">
Order allow,deny
Allow from all
</Directory>"My Apache would not even start up when I put that in there, but I noticed it would at least start up if I left theLoadModule line in there, so it was finding mod_wsgi.so fine. My next assumption was maybe the syntax was wrong for my Apache even though it seems to have worked for so many other people. What worked for me was"LoadModule wsgi_module modules/mod_wsgi.soWSGIScriptAlias /<folder_name> "C:/xampp/htdocs/<folder_name>/<file_name>.py/wsgi"AddHandler wsgi-script .wsgi
<Directory "C:/xampp/htdocs/<folder_name>">Order allow,denyAllow from all</Directory>"The filename extension can be either .wsgi or .py but NOT .cgi, so be careful there. After that I was still running into trouble trying to get an example script running and the Apache error logs main fuss was about the variable that would contain my "Hello World!" was returning a str (sting) instead of a bit string. If you can not get that example script running, or any script really, because you get an error like then I suggest looking here. After all that was done, I was able to print out "Hello World!" finally. I do still get some warnings in the error log saying something about certificate not matching but I assume it is not that big of a deal. I hope this helps anyone in the situation I was in.Cheers
On 24 Sep 2016, at 9:56 AM, Roger Wayne <perve...@gmail.com> wrote:Thank you. I would have never came to that conclusion. If that is the case, would you happen to know when referencing the program, what do I actually refer to? The program itself (the file) or where it is running on your localhost? I mean this in a way towards using POST requests with AJAX in a JavaScript.
--