VestaCP + Longview Guide

Hey guys,

I had a problem with getting longview to work with VestaCP since VestaCP does the apache/nginx configuration for you.

The configuration files offered by the help section for Apache and Nginx don't work with the VestaCP stock configuration.

So here's how to get everything to play nice.

The problem stems from longview trying to access apache and nginx on port 80, we just change the port longview is attaching to and it works great.

Keep in mind I'm doing this on Debian 7.5, the specific file locations and other things may be different for other distros, especially for CentOS

Step 1: Edit Apache Configuration

Open status.conf, VestaCP won't overwrite this file.

sudo nano /etc/apache2/mods-enabled/status.conf

Write this to the file

 <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> 

Ctrl+O, Enter, then Ctrl+X to save and close.

Step 2: Edit Nginx configuration

Open a new file, longview.conf:

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

Write this to it:

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;
    }
}

Save and close.

Step 3: Edit Longview Configuration

Open Apache configuration
> sudo nano /etc/linode/longview.d/Apache.conf

Write this to the file:
> location http://127.0.0.1:8081/server-status?auto
Comment out or delete any other lines in this file.

Save and close.

Now open the Nginx Configuration
> sudo nano /etc/linode/longview.d/.conf

Write this to the file

location http://127.0.0.1:79/nginx_status

Save and close.

Step 4: Restart Services

sudo service apache2 restart
sudo service nginx restart
sudo service longview restart

Hope that saves someone a little time!

2 Replies

A very good tutorial by you to install and configure longview to work with VestaCP. It also give me a severe headache in past as its very hard to configure it easily. But this tutorial is good to check. I will check it and will configure longview myself and will then update this post about it.

Great post scottlott. Thank you for sharing!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct