At the End, you should have this:::
cgradmin is an administrative interface for CGRateS. At the end of this tutorial, you should have cgradmin running at http://localhost:8080. An Assumption is made that Debian would be used.
We would be needing the following Softwares installed:
1. Golang(>=1.4)
2. MySQL
3. Redis
4. CGRateS
5. cgradmin
-
Installing Golang(>=1.4) To install Golang, Please follow this [link] (http://www.hostingadvice.com/how-to/install-golang-on-ubuntu/). We would be using Golang 1.4
-
Installing MySQL(Skip if you already have MySQL Installed)
To install MySQL::
sudo apt-get install mysql-server
During the installation, MySQL will ask you to set a root password. Please take note of this as you would be needing it latter.
-
Installing Redis(Skip if you already have Redis Installed)
To install Redis::
sudo apt-get install redis-server
-
Installing CGRateS From the CGRateS documentation,
On the server you want to install CGRateS, simply execute the following commands:
cd /etc/apt/sources.list.d/ wget -O - http://apt.itsyscom.com/conf/cgrates.gpg.key|apt-key add - wget http://apt.itsyscom.com/conf/cgrates.apt.list apt-get update apt-get install cgrates
Now, We've got some postinstall setup to do::
cd /usr/share/cgrates/storage/mysql/
From within this directory, run
./setup_cgr_db.sh root YOUR_PASSWORD localhost
You should now have CGRateS along with it's components installed.
5 - Installing cgradmin Now, let's install cgradmin
go get github.com/cgrates/cgradmin
This would fetch cgradmin to your $GOPATH
Let's Start cgr-engine(this was installed along side CGRateS) with some sample config file, NOTE, You would need to leave this terminal running...
cgr-engine -config_dir /usr/share/cgrates/conf/samples/cgradmin/
Let's start up cgradmin web app
cd $GOPATH/src/github.com/cgrates/cgradmin
Within this directory, run
go run main.go
You should see something along the lines of
2016/04/15 22:37:19.646027 Starting Goji on [::]:8080
Now Open up your browser and visit http://localhost:8080
Use root as username and testus as password.
There you have cgradmin running, HOWEVER, you would observe that the Webapp would not be properly styled. You would need to install some static assets for it.
Let's get that done.
6 - Let's Update the static Resources needed by cgradmin First, you would need to install NodeJS and npm -
Please visit https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Once that is done successfully,
cd $GOPATH/src/github.com/cgrates/cgradmin/static
From within this directory, run
bower install
Restart your Webapp, and you should have a properly styled cgradmin Webapp.
That's It. Quite Easy!
Credit goes to @rif for his ascicasts at - https://asciinema.org/a/17066