I have seen a few question this regard, but unfortunately that does not solve my problem. Please let me know if you have been able to successfully run Nagios on OpenSuse on a virtual machine.
I have Open Suse installed in two different computers. one via VMware and one via VirtualBox and they run just fine for any other application. No problem on accessing network etc.
But after following the open Suse installation steps as mentioned at:
http://nagios.sourceforge.net/docs/nagioscore/4/en/quickstart-opensuse.html
I find the "Access Forbidden! Error 403" messege when I start localhost/nagios (removed the http:// purposefully in the post) on firefox. The installation looks went through fine with no error. I am using OpenSuse 13.1 version, I tried with nagios version 4.0.6 and 4.0.7 along with plugins 2.0.2.
I made sure, apache(apache2), gcc, gcc++, kernel-source (as suggested in nagios forum by a user), php, apache2-mod_php5, make etc are all installed. apache2 service is running and was retasrted after running:
make install-webconf
The username and password was rightly keyed in :).
Can you please guide me on what is going wrong on this.
Here is the apache2/error_log:
[Mon Jun 23 14:50:57.331306 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46061] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:51:57.317399 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46066] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:52:57.299316 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46068] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:57:57.289446 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46077] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 14:58:59.372027 2014] [autoindex:error] [pid 6136] [client ::1:59841] AH01276: Cannot serve directory /usr/local/nagios/share/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:02:57.274830 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46119] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:07:57.263871 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46143] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:12:57.251875 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46147] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:17:57.239626 2014] [autoindex:error] [pid 6135] [client 127.0.0.1:46152] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:22:57.228968 2014] [autoindex:error] [pid 6136] [client 127.0.0.1:46155] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:27:57.217628 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46158] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:32:57.206081 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46161] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:37:57.197239 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46165] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:42:57.180851 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46168] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:47:57.165708 2014] [autoindex:error] [pid 6135] [client 127.0.0.1:46172] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:52:57.154070 2014] [autoindex:error] [pid 6136] [client 127.0.0.1:46174] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 15:57:57.136265 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46182] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:02:57.122498 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46186] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:07:57.110446 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46191] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:12:57.092886 2014] [autoindex:error] [pid 6137] [client 127.0.0.1:46197] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:17:57.077070 2014] [autoindex:error] [pid 6135] [client 127.0.0.1:46204] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:22:57.067403 2014] [autoindex:error] [pid 6136] [client 127.0.0.1:46206] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:27:57.054625 2014] [autoindex:error] [pid 6138] [client 127.0.0.1:46209] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:32:57.042447 2014] [autoindex:error] [pid 6139] [client 127.0.0.1:46213] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
[Mon Jun 23 16:37:57.030372 2014] [autoindex:error] [pid 24637] [client 127.0.0.1:46219] AH01276: Cannot serve directory /srv/www/htdocs/: No matching DirectoryIndex (index.html,index.html.var) found, and server-generated directory index forbidden by Options directive
Here is the apache2/acsess_log:
::1 - - [23/Jun/2014:14:58:59 -0700] "GET /nagios HTTP/1.1" 401 1233 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
::1 - nagiosadmin [23/Jun/2014:14:58:59 -0700] "GET /nagios HTTP/1.1" 301 310 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
::1 - - [23/Jun/2014:14:58:59 -0700] "GET /nagios/ HTTP/1.1" 403 1004 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
::1 - nagiosadmin [23/Jun/2014:15:01:43 -0700] "GET /nagios/index.php HTTP/1.1" 200 1628 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
127.0.0.1 - - [23/Jun/2014:15:02:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:07:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:12:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:17:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:22:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:27:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:32:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:37:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:42:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:47:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:52:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:15:57:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:02:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:07:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:12:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:17:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:22:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:27:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:32:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:37:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
127.0.0.1 - - [23/Jun/2014:16:42:57 -0700] "GET / HTTP/1.0" 403 1004 "-" "check_http/v2.0.2 (nagios-plugins 2.0.2)"
The conf file is:
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
I know this is a really old thread,I face the similar issue today but in case of Centos7,The only thing I do to resolve this issue is adding index.php to DirectoryIndex parameter,not sure how much this is useful in case of OpenSuse
httpd.conf
Changed
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
To
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
I just ran into this same problem (on a Raspberry Pi 3 w/ Raspian Jessie, using install instructions from http://www.howtovmlinux.com/articles/rasberry-pi/install-nagios-core-latest-version-4-x-x-on-raspberrypi-jessie.html) and I will shame-facedly admit that it was because I skipped a critical step in the installation: I neglected to do "make install"!
It seems unlikely that anyone else would make this same bonehead mistake, but in case they do, here's my solution: run "make install"! :-]
I had a very similar issue on CentOS 7 but I just installed the php package and it worked
yum install php-5.4
Related
I have a AWS ec2 server, I'm running 2 websites there on 2 different domains (obviously) using Apache2. One is domain.com, another is docs.domain.com.
I'm running a wordpress website on domain.com. I'm running react/next js app on docs.domain.com using pm2 & yarn.
Vhost for domain.com
<VirtualHost *:443>
ServerName domain.com
DocumentRoot /var/www/html
ServerAlias domain.com
ErrorLog /var/www/error.log
CustomLog /var/www/requests.log combined
SSLEngine on
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com-0001/privkey.pem
</VirtualHost>
<VirtualHost *:80>
ServerName domain.com
DocumentRoot /var/www/html
ServerAlias bangdb.com
ErrorLog /var/www/error.log
CustomLog /var/www/requests.log combined
RewriteCond %{SERVER_NAME} =www.domain.com [OR]
RewriteCond %{SERVER_NAME} =domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Vhost for docs.domain.com
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName docs.domain.com
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
ServerSignature Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com-0001/privkey.pem
</VirtualHost>
</IfModule>
Suddenly on 22 Jan 2023 around 07:39 (time in the logs) my server got shut down, both websites got down, and I was not able to login to my server via ssh also. I had to restart from AWS console to get it working again.
Here is the syslog when it got down
Jan 22 07:09:36 ip-172-30-0-37 systemd[1]: Starting Clean php session files...
Jan 22 07:09:36 ip-172-30-0-37 systemd[1]: Started Clean php session files.
Jan 22 07:17:00 ip-172-30-0-37 snapd[15896]: autorefresh.go:540: Cannot prepare auto-refresh change due to a permanent network error: persistent network error: Post https://api.snapcraft.io/v2/snaps/refresh: dial tcp: lookup api.snapcraft.io: Temporary failure in name resolution
Jan 22 07:17:00 ip-172-30-0-37 snapd[15896]: stateengine.go:149: state ensure error: persistent network error: Post https://api.snapcraft.io/v2/snaps/refresh: dial tcp: lookup api.snapcraft.io: Temporary failure in name resolution
Jan 22 07:17:01 ip-172-30-0-37 CRON[30597]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jan 22 07:20:01 ip-172-30-0-37 CRON[30603]: (smmsp) CMD (test -x /etc/init.d/sendmail && test -x /usr/share/sendmail/sendmail && test -x /usr/lib/sm.bin/sendmail && /usr/share/sendmail/sendmail cron-msp)
Jan 22 07:20:01 ip-172-30-0-37 sm-msp-queue[30622]: My unqualified host name (ip-172-30-0-37) unknown; sleeping for retry
Jan 22 07:21:01 ip-172-30-0-37 sm-msp-queue[30622]: unable to qualify my own domain name (ip-172-30-0-37) -- using short name
Jan 22 07:39:01 ip-172-30-0-37 CRON[30649]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jan 22 07:39:36 ip-172-30-0-37 systemd[1]: Starting Clean php session files...
Jan 22 07:39:36 ip-172-30-0-37 systemd[1]: Started Clean php session files.
Jan 22 07:39:47 ip-172-30-0-37 systemd[1]: Received SIGINT.
Jan 22 07:39:47 ip-172-30-0-37 systemd[1]: Stopped target Cloud-init target.
Jan 22 07:39:47 ip-172-30-0-37 systemd[1]: Stopping Authorization Manager...
Jan 22 07:39:47 ip-172-30-0-37 systemd[1]: Stopping User Manager for UID 1000...
Jan 22 07:39:47 ip-172-30-0-37 systemd[1]: Stopped target Timers.
Jan 22 07:39:47 ip-172-30-0-37 systemd[18626]: Stopped target Default.
Jan 22 07:40:41 ip-172-30-0-37 systemd[1]: Mounted POSIX Message Queue File System.
Jan 22 07:40:41 ip-172-30-0-37 systemd[1]: Started Set the console keyboard layout.
Jan 22 07:40:41 ip-172-30-0-37 systemd[1]: Mounted Huge Pages File System.
Jan 22 07:40:41 ip-172-30-0-37 systemd[1]: Started Create list of required static device nodes for the current kernel.
Jan 22 07:40:41 ip-172-30-0-37 systemd[1]: Mounted Kernel Debug File System.
Jan 22 07:40:41 ip-172-30-0-37 systemd[1]: Started Remount Root and Kernel File Systems.
Apache logs for the same time
[Sat Jan 21 06:25:02.412725 2023] [ssl:warn] [pid 31096] AH01909: ip-172-30-0-37.ec2.internal:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jan 21 06:25:02.413374 2023] [mpm_prefork:notice] [pid 31096] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 configured -- resuming normal operations
[Sat Jan 21 06:25:02.413383 2023] [core:notice] [pid 31096] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jan 21 17:07:54.107574 2023] [mpm_prefork:error] [pid 31096] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
[Sun Jan 22 06:25:01.992892 2023] [mpm_prefork:notice] [pid 31096] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using fe80::8b1:5dff:fe04:4731. Set the 'ServerName' directive globally to suppress this message
[Sun Jan 22 06:25:02.073408 2023] [ssl:warn] [pid 31096] AH01909: fe80::8b1:5dff:fe04:4731:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 22 06:25:02.074116 2023] [mpm_prefork:notice] [pid 31096] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 configured -- resuming normal operations
[Sun Jan 22 06:25:02.074125 2023] [core:notice] [pid 31096] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jan 22 07:39:47.609420 2023] [mpm_prefork:notice] [pid 31096] AH00169: caught SIGTERM, shutting down
I'm not able to figure out whats the issue, it has happened before on 17th Dec 2022, so it's the second time it has happened.
OS Details :- Ubuntu 18.04.6 LTS
After upgrading to http 2.0, I always get error 503. Can anyone help me solve the problem?
error.log:
[Mon Jul 19 11:03:26.351473 2021] [mpm_event:notice] [pid 9022:tid 140512076250176] AH00493: SIGUSR1 received. Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Mon Jul 19 11:03:26.407467 2021] [mpm_event:notice] [pid 9022:tid 140512076250176] AH00489: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Jul 19 11:03:26.407479 2021] [core:notice] [pid 9022:tid 140512076250176] AH00094: Command line: '/usr/sbin/apache2'
In /etc/apache2/mods-enabled I see http2.conf (if I'm right)
Virtual Host via mod_macro:
<Macro VHost $dir $domain>
<VirtualHost *:443>
Protocols h2 http/1.1
SSLEngine on
SSLCertificateFile /etc/ssl/certs/my.crt
SSLCertificateKeyFile /etc/ssl/private/my.key
AccessFileName .htaccess
DocumentRoot $dir/$domain/httpdocs/
ErrorLog $dir/$domain/error.log
ServerName $domain
ServerAlias www.$domain
<Directory />
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory $dir/$domain>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
</VirtualHost>
</Macro>
Update: domain error.log
[Mon Jul 19 12:47:06.338104 2021] [proxy:error] [pid 18649:tid 140511882213120] (13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (*) failed
[Mon Jul 19 12:47:06.338133 2021] [proxy_fcgi:error] [pid 18649:tid 140511882213120] [client 127.0.0.1:51542] AH01079: failed to make connection to backend: httpd-UDS
[Mon Jul 19 12:47:06.519092 2021] [proxy:error] [pid 18649:tid 140511882213120] (13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.0-fpm.sock (*) failed
[Mon Jul 19 12:47:06.519108 2021] [proxy_fcgi:error] [pid 18649:tid 140511882213120] [client 127.0.0.1:51542] AH01079: failed to make connection to backend: httpd-UDS, referer: https://s2019/
[Mon Jul 19 12:47:12.305094 2021] [ssl:warn] [pid 9022:tid 140512076250176] AH01906: s2019:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jul 19 12:47:12.305103 2021] [ssl:warn] [pid 9022:tid 140512076250176] AH01909: s2019:443:0 server certificate does NOT include an ID which matches the server name
Thank you for any help!
I hope it will be useful if you encounter the same situation. All I needed to do:
Open /etc/php/<version>/fpm/pool.d and replace values
listen.owner = www-data
listen.group = www-data
with data in /etc/apache2/envvars
export APACHE_RUN_USER=someuser
export APACHE_RUN_GROUP=someuser
And the result will be:
listen.owner = someuser
listen.group = someuser
At the end you need to restart fpm sudo service php<version>-fpm start
By the way, php-fpm version may differ from your php version. For example, entering php -v shows me 7.4. But
<?php phpinfo();
now shows me 8.0. So I had to choose this dir /etc/php/8.0/fpm/pool.d
I use this configuration below in order to make my application available via SSL.
My question now would be how it is possible to set a timeout at **.
Is there a way of doing it and how would be the syntax?
# force HTTPS
<VirtualHost *:80>
ServerName app.xy.at
RewriteEngine on
RewriteCond %{SERVER_NAME} =app.xy.at
Redirect permanent "/" https://app.xy.at
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# forward ORDS requests to tomcat
<VirtualHost *:443>
ServerName app.xy.at
# SSL certificates settings
#Include /etc/apache2/conf-enabled/options-ssl-apache.conf
SSLCertificateFile /etc/apache2/ssl/app.xy.at/fullchain.cer
SSLCertificateKeyFile /etc/apache2/ssl/app.xy.at/app.xy.at.key
SSLCertificateChainFile /etc/apache2/ssl/app.xy.at/ca.cer
ProxyRequests on
ProxyPreserveHost On
<Location / >
ProxyPass "ajp://localhost:9090/"
ProxyPassReverse "ajp://localhost:9090/"
</Location>
I will set a timeout because I get the following errors:
[Thu Mar 26 00:10:52.731383 2020] [proxy_ajp:error] [pid 16266:tid
139926293157632] [client
xxx.xxx.3.59:60869] AH00893: dialog to 127.0.0.1:9090 (localhost)
failed, referer:
https domain
[Thu Mar 26 00:10:57.802571 2020] [proxy_ajp:error] [pid 16266:tid
139926720988928]
(70014)End of file found: AH01030: ajp_ilink_receive() can't receive
header
[Thu Mar 26 00:10:57.802597 2020] [proxy_ajp:error] [pid 16266:tid
139926720988928] [client
xxx.xxx.3.59:60875] AH00992: ajp_read_header: ajp_ilink_receive
failed, referer:
https domain
[Thu Mar 26 00:10:57.802628 2020] [proxy_ajp:error] [pid 16266:tid
139926720988928]
(120006)APR does not understand this error code: [client
xxxx.xxxx.3.59:60875] AH00878: read
response failed from 127.0.0.1:9090 (localhost), referer: https domain
and I dont know why.
According to the documentation, You can pass different parameters along with the URL, in the format of key value pairs
ProxyPass "protocol://domain.com" key1=value1 key2=value2 ...
for your case,
ProxyPass "ajp://localhost:9090/" connectiontimeout=10 timeout=50
connectiontimeout : Connect timeout in seconds. The number of seconds
Apache httpd waits for the creation of a connection to the backend to
complete. By adding a postfix of ms, the timeout can be also set in
milliseconds.
timeout : Connection timeout in seconds. The number of seconds Apache
httpd waits for data sent by / to the backend.
I have configured tomcat to run on port 80 with apache2 and mod_jk and this work well. If i reboot the system then the site will be the standart site from apache2. If i restart apache2 (/etc/init.d/apache2 restart) the site will come from tomcat. But why first after restart of apache2?
Anyone an idea?
Log after reboot the system (in /var/log/apache2/):
> mod_jk.log <
[Mon Sep 22 16:24:40.296 2014] [2256:3075069696] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:24:40.296 2014] [2256:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:24:40.296 2014] [2256:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.
[Mon Sep 22 16:24:40.298 2014] [2257:3075069696] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:24:40.298 2014] [2257:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:24:40.298 2014] [2257:3075069696] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.
> error.log <
[Mon Sep 22 16:24:40 2014] [notice] Apache/2.2.22 (Debian) mod_jk/1.2.37 configured -- resuming normal operations
[Mon Sep 22 16:26:50 2014] [notice] caught SIGTERM, shutting down
Log after restart apache (in /var/log/apache2/):
> mod_jk.log <
[Mon Sep 22 16:29:10.042 2014] [3599:3074443008] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:29:10.042 2014] [3599:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:29:10.042 2014] [3599:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.
[Mon Sep 22 16:29:10.052 2014] [3600:3074443008] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized
[Mon Sep 22 16:29:10.052 2014] [3600:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.
[Mon Sep 22 16:29:10.052 2014] [3600:3074443008] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.
> error.log <
[Mon Sep 22 16:29:10 2014] [notice] Apache/2.2.22 (Debian) mod_jk/1.2.37 configured -- resuming normal operations
EDIT 1:
Ok, i have tested this several times and find out that the apache2 / tomcat7 / mod_jk behavior is more crazy xD
I will show you my configurations:
> local: hosts <
192.168.84.129 migor
192.168.84.129 test.migor
> in tomcat server.xml <
<Host name="test.migor" appBase="myapps/test" unpackWARs="true" autoDeploy="true" />
> worker.properties <
workers.tomcat_home=/var/lib/tomcat7
workers.java_home=/usr/lib/jvm/java-7
ps=/
worker.list=ajp13_worker
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13
worker.ajp13_worker.lbfactor=1
> sitea-available/test.migor <
<Virtualhost test.migor>
JkMount /* ajp13_worker
ServerName test.migor
DocumentRoot /var/lib/tomcat7/myapps/test
ErrorLog /var/lib/tomcat7/logs/error.log
CustomLog /var/lib/tomcat7/logs/access.log common
<Directory /var/lib/tomcat7/myapps/test>
Options -Indexes
</Directory>
</Virtualhost>
Now the behavior:
After reboot under url: "test.migor/", "migor/" and my server ip 192.168.84.129 i will get the site from apache2
After restarting apache2 i will get on migor/ and 192.168.84.129 the tomcat page from webapps and on test.migor/ the page from myapps/test. Here the problem, i expected on 192.168.84.129 the page from apache2.
Any an idea?
EDIT 2:
Ok, i have forget to add "NameVirtualHost test.migor" to "sitea-available/test.migor" and my config have completly overwrite default settiong of apache. Now is the behavior ok for me. With url "migor/" i can call default apache site and with url "test.migor/" i can call the tomcat homepage which is in tomcat7/myapps/test.
But this behavior will be activated only after restart of apache2 (if i have rebooted my system before). I will show for the solution and post it here. Maybe in "EDIT 3" xD
The error clearly says that jk-manager and jk-status is not accurately defined in workers.property file.
Please check your workers.properties file and make following changes:
worker.list=jk-manager
worker.jk-manager.type=status
worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true
Cheers!!
previously i had error in installing apache2 for python, this is the link
I thought i should continue there but right now i'm getting a new error so posting it as a new one this is what the problem is
I have placed a file hello.py having code
#!/usr/bin/python
print "Content-type:text/html\r\n\r\n"
print '<html>'
print '<head>'
print '<title>Hello Word - First CGI Program</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI program</h2>'
print '</body>'
print '</html>'
in a folder /var/www/cgi-bin when I run this on apache2 using
http://localhost/cgi-bin/hello.py
i'm getting this error
The requested URL /cgi-bin/hello.py was not found on this server. Apache/2.2.14(Ubuntu)Server at localhost Port 80
This is the code that i found in the default page in sites-available folder:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
This is what i could find in the error log:
[Fri May 06 13:41:22 2011] [notice] mod_python: using mutex_directory /tmp
[Fri May 06 13:41:22 2011] [notice] Apache/2.2.14 (Ubuntu) mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8 configured -- resuming normal operations
[Fri May 06 14:23:03 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Fri May 06 14:23:03 2011] [debug] mod_deflate.c(615): [client 127.0.0.1] Zlib: Compressed 284 to 218 : URL /favicon.ico
[Fri May 06 14:23:11 2011] [notice] mod_python (pid=2038, interpreter='127.0.1.1'): Importing module '/var/www/cgi-bin/hello.py'
[Fri May 06 14:23:11 2011] [debug] mod_deflate.c(615): [client 127.0.0.1] Zlib: Compressed 289 to 222 : URL /cgi-bin/hello.py
[Fri May 06 14:23:11 2011] [error] /usr/lib/python2.6/dist-packages/mod_python/importer.py:32: DeprecationWarning: the md5 module is deprecated; use hashlib instead
[Fri May 06 14:23:11 2011] [error] import md5
[Fri May 06 14:23:25 2011] [debug] mod_deflate.c(615): [client 127.0.0.1] Zlib: Compressed 289 to 222 : URL /cgi-bin/hello.py
This is what i could find in access.log:
172.16.0.73 - - [06/May/2011:02:29:02 +0530] "GET / HTTP/1.1" 200 492 "-" "EZI_WIN_HTTP_AGENT"
172.16.0.73 - - [06/May/2011:02:46:47 +0530] "GET / HTTP/1.1" 200 492 "-" "EZI_WIN_HTTP_AGENT"
127.0.0.1 - - [06/May/2011:14:23:03 +0530] "GET /favicon.ico HTTP/1.1" 404 501 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3"
127.0.0.1 - - [06/May/2011:14:23:10 +0530] "GET /cgi-bin/hello.py HTTP/1.1" 404 504 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3"
127.0.0.1 - - [06/May/2011:14:23:25 +0530] "GET /cgi-bin/hello.py HTTP/1.1" 404 504 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3"
127.0.0.1 - - [06/May/2011:15:10:33 +0530] "GET /cgi-bin/hello.py HTTP/1.1" 404 505 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3"
125.224.195.218 - - [06/May/2011:15:15:10 +0530] "CONNECT 203.188.201.253:25 HTTP/1.1" 405 539 "-" "-"
172.16.0.25 - - [06/May/2011:15:45:53 +0530] "HEAD / HTTP/1.0" 200 277 "-" "-"
127.0.0.1 - - [06/May/2011:21:36:32 +0530] "GET /cgi-bin/hello.py HTTP/1.1" 404 505 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3"
127.0.0.1 - - [06/May/2011:21:36:35 +0530] "GET /favicon.ico HTTP/1.1" 404 500 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3"
Please help me through this.
In your Apache configuration, you need to change the Directory directive to: <Directory /var/www/cgi-bin> if this is where you intend to host your mod_python scripts.
UPDATE:
You're placing your python script in /var/www/cgi-bin but /cgi-bin/ is defined to point to /usr/lib/cgi-bin. You need to standardize on one location for /cgi-bin/.
Here's what I would propose as your corrected Apache configuration. Note that I didn't remove any lines, I only commented out the lines that are not needed or have been replaced.
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#<Directory /var/www>
<Directory /var/www/cgi-bin>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
#<Directory "/usr/lib/cgi-bin">
# AllowOverride None
# Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
# Order allow,deny
# Allow from all
#</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
UPDATE 2:
Now that your Apache configuration is correct, and we've verified that your module is importing correctly, you're still getting a 404. This is because you are using the mod_python publisher handler, which expects a different usage than what you have implemented. Basically, you have implemented a simple CGI script that just prints output. mod_python has a specific API for executing your module. You should try this example to get an understanding of how it works.
To implement your test module as a valid mod_python publisher, you could change hello.py to this:
def index(req):
return """<html>
<head>
<title>Hello Word - First CGI Program</title>
</head>
<body>
<h2>Hello Word! This is my first CGI program</h2>
</body>
</html>"""
Note that the reason you were getting a 404 error (even though the module was imported) is explained on this page:
The traversal will stop and
HTTP_NOT_FOUND will be returned to the
client if:
Any of the traversed object's names
begin with an underscore ("_"). Use
underscores to protect objects that
should not be accessible from the web.
A module is encountered. Published
objects cannot be modules for security
reasons.
If an object in the path could not be
found, HTTP_NOT_FOUND is returned to
the client.