VestaCP + Longview Guide
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
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!