Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Feb 22, 2019 11:43 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Change Cacti URL
PostPosted: Wed Aug 29, 2012 3:34 pm 
Offline

Joined: Wed Aug 29, 2012 3:32 pm
Posts: 4
I am working on a project for school and I am needing to change the default directory from http://IP ADDRESS/cacti to just the http://IP ADDRESS. I have looked through the forums and google for a quick solution as this should be, but I am striking out. Any advice would be great.


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Thu Aug 30, 2012 1:28 pm 
Offline
Cacti Pro User

Joined: Tue Aug 29, 2006 4:09 pm
Posts: 590
Location: NL
If I remember correctly, the later Cacti's have a $url_path in include/config.php If you set that to / you get what you want.

_________________
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Thu Aug 30, 2012 4:59 pm 
Offline

Joined: Wed Aug 29, 2012 3:32 pm
Posts: 4
I found the config.php file /usr/share/cacti/site/include and in the config file there is no $url_path.

This is all I see:

<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2011 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDTool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/

/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";
$database_ssl = false;

/* Default session name - Session name must contain alpha characters */
#$cacti_session_name = "Cacti";

?>


Thanks for the help, but I am not seeing it.


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Fri Aug 31, 2012 1:57 pm 
Offline

Joined: Sat May 21, 2005 11:56 am
Posts: 18
check at cacti/include/global.php (instead of config.php)

look for this:
/* define default url path */
$url_path = "/cacti/";

set there:
/* define default url path */
$url_path = "/";


If it still does not exist in global.php, you may include it


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Fri Aug 31, 2012 3:27 pm 
Offline

Joined: Wed Aug 29, 2012 3:32 pm
Posts: 4
It was not in there, I added it and still nothing on the / site.

I also added it to the
global_form.php
global_constants.php
global_settings.php

all nothing.


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Fri Aug 31, 2012 5:55 pm 
Offline

Joined: Sat May 21, 2005 11:56 am
Posts: 18
In such case it seems there is an issue where your apache is pointing or where your cacti base is. Please get the following info for me:

login to mysql command line and run:
use cacti;
select * from settings where name='path_webroot';
what is the output?

then

edit the apache config files and let me know where the "directory root" is pointing to?
vi /etc/http/conf/httpd.conf (the path depends on your apache install)


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Fri Aug 31, 2012 8:40 pm 
Offline

Joined: Wed Aug 29, 2012 3:32 pm
Posts: 4
This is the results from the mysql output:

mysql> select * from settings were name ='path_webroot';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'name ='path_webroot'' at line 1

I opened the httpd.conf and it is blank. I am running webmin recently and I am wondering if this is causing the trouble. I found this in the code for the webmin maybe this will explain:

link_dir=/etc/apache2/sites-enabled
test_manual=0
show_list=0
mime_types=/etc/apache2/mime.types
access_conf=/etc/apache2/access.conf
auto_mods=1
stop_cmd=/etc/init.d/apache2 stop
virt_file=/etc/apache2/sites-available
test_apachectl=1
max_servers=100
srm_conf=/etc/apache2/srm.conf
httpd_dir=/etc/apache2
start_cmd=/etc/init.d/apache2 start
show_order=0
test_always=0
httpd_conf=/etc/apache2/apache2.conf
defines_file=/etc/apache2/envvars
apachectl_path=/usr/sbin/apache2ctl
show_names=0
test_config=1
apply_cmd=/usr/sbin/apache2ctl graceful
httpd_path=/usr/sbin/apache2


I also went into the /var/www folder and made a simple index.html file and checked and it ran as normal if you navigate to just the IP


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Fri Aug 31, 2012 8:56 pm 
Offline

Joined: Sat May 21, 2005 11:56 am
Posts: 18
You received an SQL syntax error due to you mistyped the command. Please note it is "wHere" not "were". Run it again correctly to see the output.


as per your webmin config, the apache configuration file is stored here:
httpd_conf=/etc/apache2/apache2.conf

so you should edit that file, confirm whitin there that the root directoy is pointing to /var/www and change it to /usr/share/xxx/cacti/ (wherever you cacti root directory is in your file system)
restart apache for changes to be applied


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Sat Sep 01, 2012 1:58 am 
Offline
Cacti Pro User

Joined: Tue Aug 29, 2006 4:09 pm
Posts: 590
Location: NL
pamiller3 wrote:
I found the config.php file /usr/share/cacti/site/include and in the config file there is no $url_path.


Obviously you are running Debian or a derivative. Which version of it and which version of cacti?

I agree with mmerelles that you should probably fix this in apache.

_________________
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging


Top
 Profile  
 
 Post subject: Re: Change Cacti URL
PostPosted: Thu Sep 06, 2012 8:56 am 
Offline
Cacti User

Joined: Thu Oct 06, 2005 5:03 am
Posts: 401
Change:
Quote:
$url_path = "/";


in include/config.php

Then change apache to show the root directory as home directory.

Done!

_________________
cacti rulez!


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 15 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