Change Cacti URL

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
pamiller3
Posts: 4
Joined: Wed Aug 29, 2012 3:32 pm

Change Cacti URL

Post by pamiller3 »

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.
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Change Cacti URL

Post by paulgevers »

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
pamiller3
Posts: 4
Joined: Wed Aug 29, 2012 3:32 pm

Re: Change Cacti URL

Post by pamiller3 »

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.
mmerelles
Posts: 18
Joined: Sat May 21, 2005 11:56 am

Re: Change Cacti URL

Post by mmerelles »

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
pamiller3
Posts: 4
Joined: Wed Aug 29, 2012 3:32 pm

Re: Change Cacti URL

Post by pamiller3 »

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.
mmerelles
Posts: 18
Joined: Sat May 21, 2005 11:56 am

Re: Change Cacti URL

Post by mmerelles »

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)
pamiller3
Posts: 4
Joined: Wed Aug 29, 2012 3:32 pm

Re: Change Cacti URL

Post by pamiller3 »

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
mmerelles
Posts: 18
Joined: Sat May 21, 2005 11:56 am

Re: Change Cacti URL

Post by mmerelles »

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
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Change Cacti URL

Post by paulgevers »

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
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Change Cacti URL

Post by JJX »

Change:
$url_path = "/";
in include/config.php

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

Done!
cacti rulez!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests