HTTP ERROR 500 - domain is unable to handle this request - yii2

I am running my application on my local using Laragon. Upon running my app, it says HTTP ERROR 500 - domain is unable to handle this request. Now, this error is too generic so I've checked my apache error log file but there is nothing substantial with the message:
[Wed Dec 29 11:09:19.659652 2021] [core:warn] [pid 15608:tid 640] AH00098: pid file C:/laragon/bin/apache/httpd-2.4.47-win64-VS16/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Dec 29 11:09:19.662662 2021] [mpm_winnt:notice] [pid 15608:tid 640] AH00455: Apache/2.4.47 (Win64) OpenSSL/1.1.1k mod_fcgid/2.3.10-dev configured -- resuming normal operations
[Wed Dec 29 11:09:19.662662 2021] [mpm_winnt:notice] [pid 15608:tid 640] AH00456: Apache Lounge VS16 Server built: Apr 24 2021 11:08:47
[Wed Dec 29 11:09:19.662662 2021] [core:notice] [pid 15608:tid 640] AH00094: Command line: 'C:\\laragon\\bin\\apache\\httpd-2.4.47-win64-VS16\\bin\\httpd -d C:/laragon/bin/apache/httpd-2.4.47-win64-VS16'
[Wed Dec 29 11:09:19.664662 2021] [mpm_winnt:notice] [pid 15608:tid 640] AH00418: Parent: Created child process 11520
[Wed Dec 29 11:09:20.146271 2021] [mpm_winnt:notice] [pid 11520:tid 572] AH00354: Child: Starting 64 worker threads.
On my ht.access:
Options -Indexes
# Deny accessing below extensions
<Files ~ "(.json|.lock|.git|.key)">
Order allow,deny
Deny from all
</Files>
# Deny accessing dot files
RewriteRule (^\.|/\.) - [F]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) http://%{SERVER_NAME}/$1 [R,L]
I've looked through many solutions here but it does not solve my problem. I found a workaround that is to add error_reporting(0) to my index.php that solves this problem and the app will run normally although I don't think this is an ideal solution.
Is there any possible way I could dig more to find the cause of this issue other than turning off the error reporting?

Related

Django problems with apache2 mod_wsgi, _sql import error

I'm struggling to run an apache2 server for django. I wanted to try gunicorn, but as I expect apache to be installed in in workplaces more frequently, so I'll stick to it.
Problem currently lies (I think) in an Import Error visible in the excerpt from apache error.log. I've tried quite a lot of possible configs, and before it didn't even import django. I'm using virtual env. The developer server from django works just fine both for the app and database.
1 [Sun Apr 02 20:58:52.082706 2017] [wsgi:warn] [pid 13495] mod_wsgi: Compiled for Python/3.4.2rc1+.
2 [Sun Apr 02 20:58:52.082907 2017] [wsgi:warn] [pid 13495] mod_wsgi: Runtime using Python/3.4.2.
3 [Sun Apr 02 20:58:52.104626 2017] [mpm_prefork:notice] [pid 13495] AH00163: Apache/2.4.10 (Raspbian) mod_wsgi/4.3.0 Python/3.4.2 configu red -- resuming normal operations
4 [Sun Apr 02 20:58:52.104798 2017] [core:notice] [pid 13495] AH00094: Command line: '/usr/sbin/apache2'
5 [Sun Apr 02 21:00:18.727276 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] mod_wsgi (pid=13499): Target WSGI script '/home/pi/d jangoProjects/pidjay/pidjay/wsgi.py' cannot be loaded as Python module.
6 [Sun Apr 02 21:00:18.727660 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] mod_wsgi (pid=13499): Exception occurred processing WSGI script '/home/pi/djangoProjects/pidjay/pidjay/wsgi.py'.
7 [Sun Apr 02 21:00:18.727938 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] Traceback (most recent call last):
8 [Sun Apr 02 21:00:18.729807 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] File "/home/pi/djangoProjects/pidjay/venv/lib/pyth on3.5/site-packages/django/db/backends/mysql/base.py", line 25, in <module>
9 [Sun Apr 02 21:00:18.729866 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] import MySQLdb as Database
10 [Sun Apr 02 21:00:18.730794 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] File "/home/pi/djangoProjects/pidjay/venv/lib/pyth on3.5/site-packages/MySQLdb/__init__.py", line 19, in <module>
11 [Sun Apr 02 21:00:18.730848 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] import _mysql
12 [Sun Apr 02 21:00:18.731024 2017] [wsgi:error] [pid 13499] [remote 192.168.1.106:0] ImportError: No module named '_mysql'
Now the config from sites-available folder:
<Directory /home/pi/djangoProjects/pidjay/pidjay>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess pidjay python-path=/home/pi/djangoProjects/pidjay:/home/pi/djangoProjects/pidjay/venv/lib/python3.5/site-packages
WSGIProcessGroup pidjay
WSGIScriptAlias / /home/pi/djangoProjects/pidjay/pidjay/wsgi.py
As You can see I specified the virtual env folder with a colon, other ways resulted in django being impossible to import. The python in the environment is ver 3.5 (checked twice), with sqlclient and django installed. When I try to import "_mysql" in python interpreter inside venv (activated) it works just fine.
This is databases setting from project's settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': "pidjay",
"USER": "user",
"PASSWORD": "password"
}}
And as I said it works on development server. Please help me with this and great thank You in advance! I will be happy to provide any additional info!
As pointed out above, this is one way to do it.
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.5.14.tar.gz
tar -zxvf 4.5.14.tar.gz
cd mod_wsgi-4.5.14
./configure --with-python=/usr/bin/python3.5
make
make install
chmod 755 /usr/lib64/httpd/modules/mod_wsgi.so
The problem lied in version mismatch as Graham kindly pointed out. After compiling mod_wsgi for python 3.5 with with the help of official docs and loading it into apache it worked as expected.

XAMPP: mysql shuts down every day or two, Needs to restart xampp every time

Everything was working fine, but now I get error in browser while visiting my websites "error establishing database connection". Error gets solved after restarting xampp, and what I observe every time that mysql module of xampp stops running.
Few months ago this error was coming every 15 days, and I always solved this issue by restarting xampp, but now it occurs very frequently(everyday or in 2 days).
I also tried one solution "deleting the file ibdata1" that helped me for 3-4 days, and problem started again.
here is my error log:
[Mon Dec 05 14:36:21.001921 2016] [ssl:warn] [pid 7479] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Dec 05 14:36:21.001985 2016] [ssl:warn] [pid 7479] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Dec 05 14:36:21.002084 2016] [suexec:notice] [pid 7479] AH01232: suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Mon Dec 05 14:36:21.050579 2016] [auth_digest:notice] [pid 7480] AH01757: generating secret for digest authentication ...
[Mon Dec 05 14:36:22.001567 2016] [ssl:warn] [pid 7480] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Dec 05 14:36:22.001605 2016] [ssl:warn] [pid 7480] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Dec 05 14:36:22.001713 2016] [lbmethod_heartbeat:notice] [pid 7480] AH02282: No slotmem from mod_heartmonitor
[Mon Dec 05 14:36:22.019204 2016] [mpm_prefork:notice] [pid 7480] AH00163: Apache/2.4.10 (Unix) OpenSSL/1.0.1i PHP/5.5.15 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Mon Dec 05 14:36:22.019244 2016] [core:notice] [pid 7480] AH00094: Command line: '/opt/lampp/bin/httpd -E /opt/lampp/logs/error_log -D SSL -D PHP'
[Tue Dec 06 05:25:35.571290 2016] [mpm_prefork:notice] [pid 7480] AH00169: caught SIGTERM, shutting down
It is big problem to me as well as visitors of my websites.
Please guys, If any one of you know how to solve this issue, do reply.
Thanks in advance !!
I got the same error on my website.
In my case it was the cron upgrade proces which gave an MySQL error. After fixing this no restarts where needed anymore.

Creation of additional Authentication at phpmyadmin

I am following this tutorial in creating phpmyadmin.
The last section is to create secure authentication.
I followed exactly. I have .htaccess file inside
/usr/share/phpmyadmin/.htaccess
I have .htpasswd file inside /etc/phpmyadmin/.htpasswd.
When I look inside .htpasswd file, I saw username:password line inside the file. Those are credentials I have given.
I used the same user name as in the original credential to phpmyadmin.
But when I login to my phpmyadmin, that additional login window doesn't appear.
Why it doesn't appear?
Thanks
EDIT:
When I checked the error log file at /var/log/apache2/error.log, I have the following messages.
[Sun Nov 06 06:25:01.489916 2016] [mpm_prefork:notice] [pid 2087] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Nov 06 06:25:01.489943 2016] [core:notice] [pid 2087] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 06 14:00:18.944623 2016] [mpm_prefork:notice] [pid 2087] AH00169: caught SIGTERM, shutting down
[Sun Nov 06 14:00:19.996901 2016] [mpm_prefork:notice] [pid 4204] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Nov 06 14:00:19.996963 2016] [core:notice] [pid 4204] AH00094: Command line: '/usr/sbin/apache2'
EDIT 2:
phpmyadmin.conf file inside /etc/dbconfig-common/phpmyadmin.conf has
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
</Directory>
/usr/share/phpmyadmin/.htaccess has
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user
Try this inside .htaccess:
Deny from all
AuthType Basic
AuthName "Restricted Files"
AuthBasicProvider file
AuthUserFile /etc/phpmyadmin/.htpasswd
Satisfy Any
Require valid-user

Wamp server on windows 10 Icon Red and I can't left or right click on it either

OK: Not only is my WAMP Icon Red but I can't get anything to appear if I right or left click on it. Hovering over the icon I get "None of 2 services running - server off line".
I have
Installed VC C++ Redist from 2008 - 2015.
Uninstalled Skype.
Disabled World Wide Web Publishing Services.
Made sure my Host file had "127.0.0.1 localhost" and "::1 localhost" enabled.
Installed 32bit version of WAMP.
I would given changing the listening Ports a crack but not being able to click on the WAMP icon I wasn't confident enough to change the files in the folders (Eg. Found multiple copies of httpd.conf). Would have thought steps 2 and 3 would have made this unnecessary anyway.
If in Services, I manually start wampapache and wampmysql I can access localhost/phpmyadmin and localhost/domainfolder, set up databases, install wordpress, etc. Clearly something is going wrong and I'm sure it's destined to give me furthur grief. Any Ideas? I have included my error logs and a screen shot below with my system info.
"Apache_error_log"
[Thu May 05 13:17:27.453022 2016] [auth_digest:notice] [pid 8056:tid 120] AH01757: generating secret for digest authentication ...
[Thu May 05 13:17:27.484243 2016] [mpm_winnt:notice] [pid 8056:tid 120] AH00455: Apache/2.4.17 (Win32) PHP/5.6.15 configured -- resuming normal operations
[Thu May 05 13:17:27.484243 2016] [mpm_winnt:notice] [pid 8056:tid 120] AH00456: Apache Lounge VC14 Server built: Oct 11 2015 16:06:02
[Thu May 05 13:17:27.484243 2016] [core:notice] [pid 8056:tid 120] AH00094: Command line: 'C:\wamp\bin\apache\apache2.4.17\bin\httpd.exe -d C:/wamp/bin/apache/apache2.4.17'
[Thu May 05 13:17:27.484243 2016] [mpm_winnt:notice] [pid 8056:tid 120] AH00418: Parent: Created child process 6692
[Thu May 05 13:17:27.874894 2016] [auth_digest:notice] [pid 6692:tid 428] AH01757: generating secret for digest authentication ...
[Thu May 05 13:17:27.890536 2016] [mpm_winnt:notice] [pid 6692:tid 428] AH00354: Child: Starting 64 worker threads.
[Thu May 05 14:14:30.816395 2016] [authz_core:error] [pid 6692:tid 1100] [client 192.168.0.166:2569] AH01630: client denied by server configuration: C:/wamp/www/
[Thu May 05 14:30:49.331784 2016] [mpm_winnt:notice] [pid 8056:tid 120] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Thu May 05 14:30:51.363140 2016] [mpm_winnt:notice] [pid 6692:tid 428] AH00364: Child: All worker threads have exited.
[Thu May 05 14:30:53.144329 2016] [mpm_winnt:notice] [pid 8056:tid 120] AH00430: Parent: Child process 6692 exited successfully.
[Thu May 05 15:01:43.930134 2016] [auth_digest:notice] [pid 7168:tid 592] AH01757: generating secret for digest authentication ...
[Thu May 05 15:01:44.273944 2016] [mpm_winnt:notice] [pid 7168:tid 592] AH00455: Apache/2.4.17 (Win32) PHP/5.6.15 configured -- resuming normal operations
[Thu May 05 15:01:44.273944 2016] [mpm_winnt:notice] [pid 7168:tid 592] AH00456: Apache Lounge VC14 Server built: Oct 11 2015 16:06:02
[Thu May 05 15:01:44.273944 2016] [core:notice] [pid 7168:tid 592] AH00094: Command line: 'C:\wamp\bin\apache\apache2.4.17\bin\httpd.exe -d C:/wamp/bin/apache/apache2.4.17'
[Thu May 05 15:01:44.273944 2016] [mpm_winnt:notice] [pid 7168:tid 592] AH00418: Parent: Created child process 628
[Thu May 05 15:01:44.711410 2016] [auth_digest:notice] [pid 628:tid 492] AH01757: generating secret for digest authentication ...
[Thu May 05 15:01:44.805095 2016] [mpm_winnt:notice] [pid 628:tid 492] AH00354: Child: Starting 64 worker threads.
"Last 10 lines of PHP_error_log"
[05-May-2016 05:14:53 UTC] PHP Warning: fopen(C:/wamp/bin/apache/apache2.4.17/conf/httpd.conf): failed to open stream: Permission denied in C:\wamp\scripts\wampserver.lib.php on line 307
[05-May-2016 05:14:53 UTC] PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\wamp\scripts\wampserver.lib.php on line 308
[05-May-2016 05:14:53 UTC] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in C:\wamp\scripts\wampserver.lib.php on line 309
[05-May-2016 05:14:54 UTC] PHP Warning: fopen(../wampmanager.ini): failed to open stream: Permission denied in C:\wamp\scripts\refresh.php on line 1205 [05-May-2016 05:14:54 UTC] PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\wamp\scripts\refresh.php on line 1206
[05-May-2016 05:14:54 UTC] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in C:\wamp\scripts\refresh.php on line 1207 [05-May-2016 05:14:54 UTC] PHP Warning: unlink(C:/wamp/bin/apache/apache2.4.17/bin/icudt54.dll): Permission denied in C:\wamp\scripts\wampserver.lib.php on line 78
[05-May-2016 05:14:54 UTC] PHP Warning: symlink(): Cannot create symlink, error code(1314) in C:\wamp\scripts\wampserver.lib.php on line 81 [05-May-2016 05:14:54 UTC] PHP Warning: unlink(C:/wamp/bin/apache/apache2.4.17/bin/icuin54.dll): Permission denied in C:\wamp\scripts\wampserver.lib.php on line 78
[05-May-2016 05:14:54 UTC] PHP Warning: symlink(): Cannot create symlink, error code(1314) in C:\wamp\scripts\wampserver.lib.php on line 81 [05-May-2016 05:14:54 UTC] PHP Warning: unlink(C:/wamp/bin/apache/apache2.4.17/bin/icuio54.dll): Permission denied in C:\wamp\scripts\wampserver.lib.php on line 78
[05-May-2016 05:14:54 UTC] PHP Warning: symlink(): Cannot create symlink, error code(1314) in C:\wamp\scripts\wampserver.lib.php on line 81 [05-May-2016 05:14:54 UTC] PHP Warning: unlink(C:/wamp/bin/apache/apache2.4.17/bin/icule54.dll): Permission denied in C:\wamp\scripts\wampserver.lib.php on line 78
System Info
Did you install WAMPServer 3 as an Administrator, using the "Run as Administrator" as instructed in the install instructions.
The installer must be run "as an administrator"
If you did not, uninstall WAMPServer and then reinstall it doing this:
Right click on the installer .exe and select "Run as Administrator"
did you have any missing DLLs while installing wampserver?
I had the same problem and the solution was
close the wampserver tray (from task manager)
go Here and download the Visual C++ Redistributable for Visual Studio and install it.
now open Wamp as administrator
the problem should be gone by now (at least that was the solution for me)

xampp: apache start for 1 sec and shutdwon

Apache not running :
My xampp configuration for apache is changed to :
apache prot: 80 > 81
apache ssl port : 443 > 1378
apache run as administrator
before run xampp i'm stop IIS services and disable startup
MySQL is running but apache run in 1 sec and shutdown !!!
that is xampp log :
15:10:36 [Apache] Attempting to start Apache app...
15:10:36 [Apache] Status change detected: running
15:10:37 [Apache] Status change detected: stopped
15:10:37 [Apache] Error: Apache shutdown unexpectedly.
15:10:37 [Apache] This may be due to a blocked port, missing dependencies,
15:10:37 [Apache] improper privileges, a crash, or a shutdown by another method.
15:10:37 [Apache] Press the Logs button to view error logs and check
15:10:37 [Apache] the Windows Event Viewer for more clues
15:10:37 [Apache] If you need more help, copy and post this
15:10:37 [Apache] entire log window on the forums
and that's apache logs :
[Fri Mar 11 15:04:13.976216 2016] [ssl:warn] [pid 4052:tid 384] AH01909: www.example.com:1378:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 11 15:04:14.085597 2016] [ssl:warn] [pid 4052:tid 384] AH01909: www.example.com:1378:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 11 15:04:14.116853 2016] [mpm_winnt:notice] [pid 4052:tid 384] AH00455: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.4 configured -- resuming normal operations
[Fri Mar 11 15:04:14.116853 2016] [mpm_winnt:notice] [pid 4052:tid 384] AH00456: Apache Lounge VC14 Server built: Dec 9 2015 10:17:39
[Fri Mar 11 15:04:14.116853 2016] [core:notice] [pid 4052:tid 384] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Fri Mar 11 15:04:14.116853 2016] [mpm_winnt:notice] [pid 4052:tid 384] AH00418: Parent: Created child process 4088
[Fri Mar 11 15:04:14.601248 2016] [ssl:warn] [pid 3280:tid 376] AH01909: www.example.com:1378:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 11 15:04:14.710628 2016] [ssl:warn] [pid 3280:tid 376] AH01909: www.example.com:1378:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 11 15:04:14.741882 2016] [mpm_winnt:crit] [pid 3280:tid 376] (OS 6)The handle is invalid. : AH00389: Child: Unable to access the scoreboard from the parent
[Fri Mar 11 15:04:14.741882 2016] [mpm_winnt:crit] [pid 4052:tid 384] AH00419: master_main: create child process failed. Exiting.
Please help me.