I'm setting up a cluster of servers for the company I work at, and I'm using Monit to monitor that all server processes are running and working as they should.
For Apache monitoring, I wanna use the mod_status feature which is explained here. However, this has turned out quite difficult. As no matter how I configure both Monit and Apache, Monit just keeps reporting a connection failure error (connection failed to 127.0.0.1:80 [APACHESTATUS via TCP]).
I followed the instructions on the Monit Wiki without much luck. The Apache status page (http://127.0.0.1/server-status?auto) page works in any browser I test it with. I've also tried changing host the from 127.0.0.1 to localhost without any luck.
I've tested this setup with Monit versions 4.8.x, 4.10x, and 5.0-beta6, all with the same result. Also, there's not much useful info on Google to help either, as most results are about more trivial and simple problems.
Am I missing something? Or am I just plain stupid maybe?
Try to change the authorization in Apache:
Order allow,deny
Allow from all
Check Apache access.log and error.log files - which kind of error is reported ?
Related
After reading of the performance benefits of HTTP2 vs HTTP1.1 - I've attempted to enable HTTP2 on our CentOS v7.9.2009 / Apache server following these steps:
1) Using EasyApache4, ensure mod_mpm_prefork is disabled and enable mod_http2, provision
2) Check /etc/apache2/conf.d/http2.conf for the following, and add if not exists:
<IfModule http2_module>
LogLevel http2:info
Protocols h2 h2c http/1.1
</IfModule>
3) Restart HTTP Server
Unfortunately after carrying out all of the above steps (I also did a graceful server reboot just to check) I'm getting the following browser error upon loading our homepage (or in fact any page on the website) in Google Chrome:
ERR2_INADEQUATE_TRANSPORT_SECURITY
After switching mod_http2 off again via EasyApache4, the above error goes away and the website again functions as normal.
I'm not sure it matters or helps at all but the website itself is Wordpress/WooCommerce.
I can't seem to find any info online about this error linked with enabling mod_http2 and/or Centos so I'm a bit stuck and would really appreciate any help or guidance.
Thanks in advance,
I just know this is one of those questions where the solution should have been obvious and I'm going to feel like an idiot but I'm stuck.
I've set up a basic apache2 web sever under openSUSE Leap 15.1 on my LAN with a single virtual host (for the moment).
If I create a simple html file of 255 bytes or less a browser on another workstation picks it up without problem. If the file gets to anything larger than 255 bytes apache doesn't serve it. The GET request shows up on the server but nothing shows in Firefox, Konqueror at least gives me a 1b Object not found error.
I should say that running a browser on the server itself shows all these files perfectly well should I use 127.0.0.1, localhost or the server name in the URL.
Is this an Apache2 directive I've missed or something else entirely?
After setting the LogLevel to trace1 and then hunting around on the web I came across what appears to be the solution. Set the Apache directive ...
EnableSendfile Off
Apparently Apache is compiled with this set to On and the kernel sendfile doesn't do the job. Not a detailed explanation I know but I haven't followed this all the way through - I just needed to get Apache working!
I chose to force https on my server when setting up let's encrypt, not realizing what a NIGHTMARE it would cause for my Node.js WebSocket server. Nothing that I've found online works to get a secure WebSocket connection up and running. (Probably because I'm using Apache for everything aside from WebSockets)
So I've decided to just disable SSL site-wide. I don't have any real use for it as my server is strictly for development anyway.
I've tried the method here But Apache reports that the site is already disabled. So I cleared the cache on my browser and even tried to visit the site incognito to no avail.
I also looked at the instructions here but NONE of my site-available contain the lines that are mentioned.
Then I saw this post but my apache2.conf file did not contain the lines he mentioned either.
I'm puling my hair out.
If anyone else has this issue, here's what I did to solve it.
I saw a configuration file named <sitenam>-le-ssl.conf in /etc/apache2/sites-enabled So I tried a2dissite <sitename>-le-ssl.conf
But Apache said "the file doesn't exist"
So I copied that file to my home directory with cp <sitename>-le-ssl.conf ~(AND YOU SHOULD TOO! just in case...)
Then I deleted that file with sudo rm <sitename>-le-ssl.conf
Then, restart apache with sudo service apache2 restart
Finally, clear the cache on your browser and visit your site. Everything should be back to normal now.
No idea why letsencrypt set up my server in such an odd way. It didn't follow ANY of the standards that others said it should.
Hope this helps someone in the future.
I've been dealing with this whole day and still can't figure it out.
I've setup Zabbix on one machine, and I want to monitor the Apache server on another machine.
I've completed all the steps described in the docs: http://www.zabbix.com/wiki/templates/apache
and still I get no data in the Apache Template. When checking the logs on the Apache server, I can see in access.log:
IPADDR - - [16/Jul/2012:13:29:08 +0000] "GET /server-status?auto HTTP/1.0" 404 13826 "-" "Python-urllib/1.17"
I think it might has something to do with Virtual Servers and additional sites I have on that machine, but I can't figure it out, and nothing mentioned in the docs...
The Apache checks are not as clever as you may think.
Can Zabbix communicate with your apache server? Link it to a template with something simple like "uptime" and verify that it indeed gets data.
Next, verify that there aren't any firewall rules prevent the zabbix server from communicating with your web server. Can you curl your homepage from the zabbix host without problems?
Are the apache checks active checks? If so you'll need to make sure active checks are enabled in the /etc/zabbix/zabbix-agentd.conf file and that the "Hostname" within the conf is unique and matching up correctly with what you have in the zabbix server.
If that fails, change the DebugLevel to 4 in /etc/zabbix-agentd.conf and tail the zabbix log. Look and see if it is having trouble with any checks.
This is an apache configuration problem, zabbix can't do anything if /server-status yields a 404 error.
Maybe the <Location /server-status>...</Location> directive is not at the right place in apache's configuration.
Try to move it inside the <VirtualHost> section of the specific virtual server to which the GET /server-status is routed.
Also make sure that mod_status is enabled.
I'm running a RubyOnRails application with the following setup:
apache 2.2.9
passenger 2.2.8
rails 2.3.8
MySQL 5.1
when I look at the apache2 error log, I see a lot of the following errors:
[error] mod_log_sql: insufficient configuration to establish database link
[error] mod_log_sql:child spawned but unable to open database link
Since I don't see any mod_log_sql reference in the apache.conf or httpd.conf, I suspect it was enabled by Passenger.
My questions are:
Do these connection establishing hurt performance?
How do I disable the mod_log_sql
Thanks
I don't think mod_log_sql is enabled by default.
Somebody may have set it up using a2enmod on your machine, check with apache2ctl -M
mod_log_sql is used to log in the db, it can co-exist or replace the regular Apache logging system. If you don't require it, you can disable it using a2dismod mod_log_sql .
If you still want to enable it. check here to properly set it up :
http://www.outoforder.cc/projects/apache/mod_log_sql/docs-2.0/?chapter=/3/
Usually it will affect performance, depending upon how you set it up. If you setup loggin on the same mysql server as your app, yes it would affect performance (Depending on traffic tho).