LINODE LONGVIEW AND VESTACP 500 ERRORS

1372-lv_overview_network

The Linode Longview is a beautiful Linux Analysis and system graphing tool available with a free plan. During the installation on CentOS 6 with the VestaCP panel installed, there were a few issues related to Apache and Nginx monitoring. These are the errors I encountered within the Longview server browser:

Nginx: Unable to access server status page (http://127.0.0.1/nginx_status) for Nginx: 500 Can’t connect to 127.0.0.1:80 (connect: Connection refused)

HTTPD/Apache: Unable to access local server status for Apache at http://127.0.0.1/server-status?auto: 500 Can’t connect to 127.0.0.1:80 (connect: Connection refused)

MySQL: Unable to connect to the database, no credentials found

 

And here is how I fixed them:

Apache

Edit the Apache configuration by opening status.conf:

sudo nano /etc/httpd/conf.d/status.conf

Replace all of the existing text with this:

<IfModule mod_status.c>
 ExtendedStatus On
 Listen 127.0.0.1:8081 
<Location /server-status>
     SetHandler server-status
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1 
 </Location>
</IfModule>

Nginx

Edit the Nginx configuration by opening status.conf

sudo nano /etc/nginx/conf.d/status.conf

Replace all of the existing text with this:

server {
     listen 127.0.0.1:79;
     server_name 127.0.0.1;
     location /nginx_status {
         stub_status on;
         allow 127.0.0.1;
         deny all;
     }
 }

Longview

Edit the Longview Apache configuration

sudo nano /etc/linode/longview.d/Apache.conf

And add this line (making sure you comment out every other line)

location http://127.0.0.1:8081/server-status?auto

 

Edit the Longview Nginx configuration

sudo nano /etc/linode/longview.d/Nginx.conf

And add this line

location http://127.0.0.1:79/nginx_status

 

Restarting the Services

Make sure you save and close all of the files and the restart:

sudo service httpd restart 
sudo service nginx restart 
sudo service longview restart

MySQL

If you installed VestaCp on a clean machine and are unaware of the PhpMyAdmin root password, just open the file located at: /usr/local/vesta/conf/mysql.conf

And locate this section

USER='root' PASSWORD='THIS IS YOUR ROOT PASSWORD'

After finding your root MySQL password, you can log in to PhpMyAdmin using the ‘root’ account and password

http://YOUR_SERVER_IP/phpyadmin

After logging in, head to users and create a new user called “linode-longview” and enter a password (remember to save it somewhere safe)

 

Next open this file:

/etc/linode/longview.d/MySQL.conf

And add this below the commented text (making sure to change the password)

username linode-longview 
password passwordyoujustmade

 

And then restart the Linode Longview service and your graphs!

service longview restart

相关文章

发表评论