Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Apr 28, 2017 5:14 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Protecting config files
PostPosted: Mon Oct 31, 2016 7:04 pm 
Offline

Joined: Mon Oct 31, 2016 6:54 pm
Posts: 8
Hello, I'm a newbie to Cacti and Linux. I have created some config files. The files are all located in /usr/share/cacti/plugins/weathermap/configs. I have found that I am able to access those config files directly via a web browser (e.g. http://<IP address of cacti server>/cacti/plugins/weathermap/configs/test.conf). Is there a way to make those config files inaccessible via web browser or somehow password protect them?


Top
 Profile  
 
 Post subject: Re: Protecting config files
PostPosted: Tue Nov 01, 2016 4:53 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5091
Location: United Kingdom
What webserver do you use? There's already a .htaccess file for Apache in the configs folder that would normally stop web access.

If you use Apache, you might need to add "AllowOverride" to your Apache config so that it takes notice of the .htaccess file. Here's a link for how that works on Ubuntu /Debian: https://ubuntuforums.org/showthread.php?t=1506129

(On other Linux, it will be different: sites-available is a specific Debian/Ubuntu thing)

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Protecting config files
PostPosted: Wed Nov 02, 2016 2:13 pm 
Offline

Joined: Mon Oct 31, 2016 6:54 pm
Posts: 8
I'm using Apache v2.4.6. I found some info on the web about password protecting folders using the .htaccess and .htpasswd files. But those didn't work for me. After looking at the link in the last response, I changed httpd.conf.

Currently, I have the following set in /etc/httpd/conf/httpd.conf.

<Directory "/var/www">
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

FYI - after each change to httpd.conf, I restarted Apache using the command "apachectl restart".

I can still access the config file via web browser.


Top
 Profile  
 
 Post subject: Re: Protecting config files
PostPosted: Wed Nov 02, 2016 2:24 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5091
Location: United Kingdom
This isn't really a weathermap issue...

OK, so what directory is Weathermap in? (Is it below /var/www somewhere, or in /usr/share or similar where Ubuntu sometimes puts things)

And do you still have the original (from the zip) .htaccess in the configs/ folder?

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Protecting config files
PostPosted: Wed Nov 02, 2016 2:49 pm 
Offline

Joined: Mon Oct 31, 2016 6:54 pm
Posts: 8
FYI - I'm running Centos 7.

Weathermap is in /usr/share/cacti/plugins/weathermap.

Yes, I have the original .htaccess in the configs folder.


Top
 Profile  
 
 Post subject: Re: Protecting config files
PostPosted: Wed Nov 02, 2016 3:19 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5091
Location: United Kingdom
OK, so adding 'AllowOverride all' to /var/www is not going to affect /usr/share :-)

Have a look through /etc/httpd/conf/httpd.conf and /etc/httpd/conf.d/*.conf for another <Directory> mentioning /usr/share

If there isn't one, you probably want to create a new file /etc/httpd/conf.d/weathermap.conf containing:
Code:
<Directory "/usr/share/cacti/plugins/weathermap">
AllowOverride All
</Directory>

or something similar. Then restart Apache.

I expect that you might already have something like /etc/httpd/conf.d/cacti.conf

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)


Top
 Profile  
 
 Post subject: Re: Protecting config files
PostPosted: Wed Nov 02, 2016 3:37 pm 
Offline

Joined: Mon Oct 31, 2016 6:54 pm
Posts: 8
I created a weathermap.conf file. That worked! I get a prompt for password to access config files now. Thank you Howie!! You're awesome!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group