My Wamp is bugging down? - wamp

I installed mysql and wamp 2.4 in my server . I made my wamp automatically start upon startup and also disabled wampmysqld so that it will not conflict with mysql.
Then i put my wamp online .
Last month I can smoothly access my server in my LAN network.
But sometimes this week, I cannot access my server's localhost page on my LAN network. I have to open wamp again and and restart all services and its annoying . There are days that wamp will work the whole day and sometimes you need to restart all services again what seems to be the problem and how to solve this?
I open apache logfile and find this error
[Fri Mar 11 13:45:36.654882 2016] [core:notice] [pid 3200:tid 492] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Fri Mar 11 13:45:36.655882 2016] [mpm_winnt:notice] [pid 3200:tid 492] AH00418: Parent: Created child process 3568
[Fri Mar 11 13:45:37.149910 2016] [mpm_winnt:notice] [pid 3568:tid 300] AH00354: Child: Starting 150 worker threads.

Related

Django project crashes server when admin backend is accessed

Problem
I am running apache2 on my local ubuntu server. I set up a Django project using django-admin startproject site and set up my virtual host to use a WSGI Daemon process to run the Django project. This worked and the site is accessible through its IP 192.168.1.3.
When I go to /admin, it allows me to log in and see the initial backend but loads for 5 minutes then goes to a 500 error when I click anything or reload, even when trying to access the non-admin index page. This persists until I run systemctl restart apache2 and completely restart apache or wait ~10-15 minutes until it fixes itself (only to break again immediately if I access /admin pages).
Versions
Django version 4.1.5
mod-wsgi version 4.9.4
My Attempts
If I run the project with python manage.py runserver, I can access it on 192.168.1.3:8000 and fully use the /admin backend, even creating new users, etc. I then thought it was the WSGI Daemon process somehow messing it up, so I followed the linked section of this page: https://pypi.org/project/mod-wsgi#using-mod-wsgi-express-with-django and ran the site with python manage.py runmodwsgi. The site completely works on 192.168.1.3:8000 along with the /admin, and I can create new users etc., which points to it having nothing to do with the WSGI setup (as well as the non-admin pages working fine on the virtual host WSGI).
I have fully deleted and restarted the Django project, as well as setting up new virtual host .conf files with the proper WSGI information, etc.
I read about an /admin loading issue back in Django 3.0, but I am on 4.1 so that is unrelated.
I am at a complete loss at what the issue could be at this point. Why won't my /admin section work on the virtual host??
EDIT:
The issue is actually definitely the WSGI somehow. I am getting this is my apache error log:
[Sun Jan 29 09:27:12.388714 2023] [wsgi:error] [pid 67623:tid 140212873184832] (70007)The timeout specified has expired: [client 192.168.1.10:63055] mod_wsgi (pid=67623): Failed to proxy response from daemon., referer: http://192.168.1.3/admin/
[Sun Jan 29 09:27:14.427470 2023] [wsgi:error] [pid 67624:tid 140211782657600] [client 192.168.1.10:63053] Timeout when reading response headers from daemon process 'Portfolio': /var/www/Portfolio/Portfolio/wsgi.py, referer: http://192.168.1.3/admin/auth/
[Sun Jan 29 09:27:14.949762 2023] [wsgi:error] [pid 67624:tid 140211279357504] [client 192.168.1.10:63056] Timeout when reading response headers from daemon process 'Portfolio': /var/www/Portfolio/Portfolio/wsgi.py, referer: http://192.168.1.3/admin/auth/
[Sun Jan 29 09:27:16.385674 2023] [wsgi:error] [pid 67623:tid 140212856399424] [client 192.168.1.10:63100] Truncated or oversized response headers received from daemon process 'Portfolio': /var/www/Portfolio/Portfolio/wsgi.py
I still do not know what the solution is, though.
https://forum.djangoproject.com/t/django-apache-deployment-not-working-as-intended/15800
I found the solution. Somehow during the whole setup, adding WSGIApplicationGroup %{GLOBAL} to the /etc/apache2/apache2.conf file was never recommended, at least not that I noticed, but it worked and all the admin functionality works on the virtual host through WSGI Daemon.
Hope this can help someone else.

Video Straming on raspberrypi using flask apche2and wsgi server

I have used flask app for straming video via raspberrypi camera. The code i used for flask app is here:
https://blog.miguelgrinberg.com/post/video-streaming-with-flask
In local server it is doing video stream but not on my website.
I am using apache2 server having wsgi file below:
flaskapp2.wsgi
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/FlaskApp2/FlaskApp2")
from ashish import app as application
application.secret_key ='1233883'
The structure of file system is :
/var/www/FlaskApp2/
flskapp2.wsgi
FlaskApp2/
ashish.py
camera_pi.py
templates/index.html
The ashish.py is the flask app which is doing stream.
The error log file in apache is:
[Wed Nov 23 15:17:17.458803 2016] [mpm_prefork:notice] [pid 783] AH00163: Apache/2.4.10 (Raspbian) mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Wed Nov 23 15:17:17.459043 2016] [core:notice] [pid 783] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 23 15:17:14.278353 2016] [wsgi:warn] [pid 662] mod_wsgi: Compiled for Python/2.7.8.
[Wed Nov 23 15:17:14.279359 2016] [wsgi:warn] [pid 662] mod_wsgi: Runtime using Python/2.7.9.
[Wed Nov 23 15:17:14.305871 2016] [mpm_prefork:notice] [pid 662] AH00163: Apache/2.4.10 (Raspbian) mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Wed Nov 23 15:17:14.306169 2016] [core:notice] [pid 662] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 23 15:17:16.502484 2016] [wsgi:warn] [pid 670] mod_wsgi: Compiled for Python/2.7.8.
[Wed Nov 23 15:17:16.504897 2016] [wsgi:warn] [pid 670] mod_wsgi: Runtime using Python/2.7.9.
[Wed Nov 23 15:17:16.531217 2016] [mpm_prefork:notice] [pid 670] AH00163: Apache/2.4.10 (Raspbian) mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Wed Nov 23 15:17:16.531502 2016] [core:notice] [pid 670] AH00094: Command line: '/usr/sbin/apache2'
On localhost it is working but not on my website is there any mistake in wsgi file or i need to add something.
You have a few possible issues when getting a 404 Not Found.
If that VirtualHost is not the only one in the Apache configuration file, then it will never be used. This is because you have set ServerName incorrectly. The ServerName directory should be set to a host name. Not a URL, not an IP address. Thus using:
ServerName https://7a78657b7a.dataplicity.io
is incorrect. It should be:
ServerName 7a78657b7a.dataplicity.io
It has to be a host name as Apache relies on it for name base virtual host matching against the Host header in the request. If it is wrong, then Apache will not know which is the correct VirtualHost to use. When this occurs Apache will fall back to sending the requests to whatever was the first VirtualHost definition it found when reading the Apache configuration files. Thus if this is not the first VirtualHost definition, it will never be used. If there is no similar URL handler set up in the first VirtualHost, you will get a 404.
The second is your WSGI application entry point in the WSGI script file pointed at by the WSGIScriptAlias directive, is not called application you will get a 404. You do appear to have it being called application, so you should be fine on this point and it shouldn't be the issue. There would have been a distinctive error message in the Apache error logs of this was the issue anyway.
The third is that the URL path you are using doesn't map to a route in the Flask application. There are actually two part to this. Because you are mounting at a sub URL in Apache, the URL path must at least start with /flask2. With that value it means you need to have a route in your Flask application which matches the root of the site. Normally in Flask that would mean you have a route for #app.route('/') but am not sure whether that still works when you have mounted your Flask application at a sub URL in Apache. You don't show your route code, so can't see what you have. You might at least try instead using /flask2/ in the URL. If your video feed isn't at the root of the Flask application but a sub URL such as set up by #app.route('/video_feed') as given in the post you link, then you should be using /flask2/video_feed as URL path. If you don't use the correct URL you will get a 404.
My whole configuration of files were right but as i was running flask applications under apache server ,apache was not able to acess pi camera because it was not having root access to pi.so,on local server it was working but not on my website when it was running on apache.

Apache 2 process stopped

Today I made some changes, but only on fron-end side of my page and pushes those changes on the server. I checked if everything works under my domain and it was fine. But after about two hours I am getting only 500 Internal Server Error. I have such logs:
[Sun Jul 10 00:19:12 2016] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 10 00:19:12 2016] [notice] Digest: done
[Sun Jul 10 00:19:12 2016] [info] mod_fcgid: Process manager 3584465 started
[Sun Jul 10 00:19:12 2016] [notice] Apache/2.2.22 (Debian) mod_fcgid/2.3.6 configured -- resuming normal operations
[Sun Jul 10 00:19:12 2016] [info] Server built: Mar 31 2015 17:28:57
[Sun Jul 10 00:19:12 2016] [info] mod_fcgid: server myuser:/home/.../django.fcgi(3584772) started
[Sun Jul 10 00:24:20 2016] [info] removed PID file /home/xxx/admin/apache/run/apache.pid (pid=3584452)
[Sun Jul 10 00:24:20 2016] [notice] caught SIGWINCH, shutting down gracefully
[Sun Jul 10 00:24:21 2016] [info] mod_fcgid: process /home/.../django.fcgi(3584772) exit(shutting down), terminated by calling exit(), return code: 0
[Sun Jul 10 00:24:21 2016] [info] mod_fcgid: Process manager 3584465 stopped
Can anyone provide a solution or some suggestions of how to overcome this problem?
The problem is you're getting SIGWINCH which means window size has changed. Doesn't make much sense for a server though.
Okay, just found out SIGWINCH is misused by Apache to perform a graceful shutdown. Your question is a dup of this one

Elastic beanstalk / Django Cache intermittently displaying wrong value

I have a site deployed to Elastic Beanstalk -- I've written some data to a Django memory cache, and when retrieving it i get two different values.
It would seem to me that there are multiple instances, but looking at my control panel, there seems to only be one web instance running right now.
i output the value in a log message and i see there are multiple PIDs.
[Wed Oct 21 14:21:34.922493 2015] [:error] [pid 14335] WARNING:root:Cached: After tomorrow, Back to the Future will take place entirely in the past.
[Wed Oct 21 14:21:35.133714 2015] [:error] [pid 14337] WARNING:root:Cached: Bacon and eggs is a day's work for a chicken and a lifetime achievement for a pig.
[Wed Oct 21 14:21:35.319643 2015] [:error] [pid 14337] WARNING:root:Cached: Bacon and eggs is a day's work for a chicken and a lifetime achievement for a pig.
[Wed Oct 21 14:21:35.521985 2015] [:error] [pid 14335] WARNING:root:Cached: After tomorrow, Back to the Future will take place entirely in the past.
[Wed Oct 21 14:21:35.690560 2015] [:error] [pid 14336] WARNING:root:Cached: Bacon and eggs is a day's work for a chicken and a lifetime achievement for a pig.
It seems to randomly toggle between the two values/pids.
I'm sure there's only one web node running - is there some way there are multiple instances of the application running on a single node?
You have a single EC2 instance with a single webserver (Apache, by default). However, Apache will create more than one worker process, each of which will run a separate instance of your Django app. When you make a request to your server, either one of the worker processes may answer it, which is why you're seeing the two values arbitrarily.
If you need a single cache across your application, you'd be better suited looking at running Memcached or Redis locally (for a single EC2 node) or using Amazon's ElastiCache service.

Django / Apache / mod_wsgi - WEB Application Hangs - Fails to Launch

My Django WEB Application fails to launch all of a sudden and out of the blues.
It was working fine until yesterday in production.
I am not able to figure out where the problem is. It could apache or mod_wsgi or windows but at the moment I have no clue.
I have tried to reinstall all the python libraries/prerequisites etc. but the problem persists nevertheless.
I am serving the WEBApp at Apache Port 8999 and When I access the WEB App, the browser fails to show any error. It just keeps trying to open the page and in the status bar I just see the Waiting for message.
If I see the netstat results then I see the following
C:\Documents and Settings\admintemp>netstat -an | find "8999" TCP
0.0.0.0:8999 0.0.0.0:0 LISTENING TCP 172.18.148.156:8999 10.107.226.88:1826 ESTABLISHED
This connection remains established forever and nothing happens. Internet Browser just seems to try to keep opening the Web App and it appears as if it is waiting forever.
The only thing i see in Apache logs is this
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Fri Jun 21 18:34:32 2013] [notice] Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
[Fri Jun 21 18:34:32 2013] [notice] Server built: Jan 28 2012 11:16:39
[Fri Jun 21 18:34:32 2013] [notice] Parent: Created child process 3876
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Child process is running
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Acquired the start mutex.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Starting 64 worker threads.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Starting thread to listen on port 8999.
[Fri Jun 21 18:34:43 2013] [error] C:/Program Files/App_Logic/logic_apps/logic_apps\\..\\logic_apps
I also noticed in the Windows Event Viewer logs (Application Logs) the following message but I am not sure how (and if) this could be related to my problem at hand. This message seems to shows up once for everytime i access the Web App.
Application popup: Microsoft Visual C++ Runtime Library : Runtime
Error!
Program: C:\Progr...
R6034 An application has made an attempt to load the C runtime library
incorrectly. Please contact the application's support team for more
information.
Exact screenshot of above error message is at http://imgur.com/hijiKv8
Please note that as part of my analysis I have tried
Accesing the apache page at http://127.0.0.1:8999 does show me the It Works ! message
Running the WEB App using the Django Development server and it launches fine.
Changing the wsgi.py file and when I introduce errors in the file deliberately, accessing the web app does complain with the relevant.
The application is installed on Windows Server 2003 SP1 and there are no automatic updates schedules on this machine so I am not suspecting that a update would have caused this problem. I also saw the Windows Update log and there was nothing installed recently.
The application is based on following Python Libraries as prerequisites
httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
python-2.7.3
Django-1.4.3
psycopg2-2.4.6.win32-py2.7-pg9.2.2-release
cx_Oracle-5.1.2-10g.win32-py2.7
PIL-1.1.7.win32-py2.7
python-ldap-2.4.10.win32-py2.7
south-0.7.6
xlrd-0.9.0
xlwt-0.7.5
mod_wsgi.so
I have tried with the WSGIApplicationGroup %{GLOBAL} directive and setting the log level to debug and info but the resulting logs don't give any additional information.
I have posted apache debug level log at http://dpaste.com/1268653/
I have posted apache info level log at http://dpaste.com/1268660/
Both these logs were taken after a fresh restart of apache and then the application hanging and until I stopped apache and copied the logs.
I also tried running the Hello World Application as documented at https://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines and it worked fine.
I still remain clueless. Appreciate if you could guide me what else I could do to get more details of the issue.
Appreciate if someone could guide me with respect to what more I can do to solve this problem or get more information to get to the root of this.
I was able to solve this issue in the end.
The post at Runtime error R6034 in embedded Python application led me to a solution.
Thanks to Graham Dumpleton and others who were helping me offline to get this issue solved.
It was rather cheeky in the end, a conflicting version of msvcr90.dll
I removed the IBM Bit from the path and it works fine now.