Thursday, June 16, 2016

manage your linux server with beautiful web interface

Ajenti is a admin panel that can be used to administer servers. we can use it to configure basic things such as editor host file, or update name server. And also have a feature to configure firewall, that ease us to rememmer iptables syntax. and we can also configure service such as apache2, bind, postgres, git, etc with it as well.
the following are its plugins available:
ajenti-plugin-ace
ajenti.plugin.augeas
ajenti-plugin-auth-users
ajenti.plugin.core
ajenti-plugin-dashboard
ajenti.plugin.datetime
ajenti-plugin-filemanager
ajenti.plugin.filesystem
ajenti-plugin-network
ajenti.plugin.notepad
ajenti-plugin-packages
ajenti.plugin.passwd
ajenti-plugin-plugins
ajenti.plugin.power
ajenti-plugin-services
ajenti.plugin.settings
ajenti-plugin-supervisorl
ajenti.plugin.terminal
ajenti-plugin-traffic

1- install it using virtualenv, so it does mess up our python libs
$ sudo apt-get install virtualenv
$ virtualenv virt
$ source virt/bin/activate
$ pip install ajenti ajenti-plugin-ace ajenti.plugin.augeas ajenti-plugin-auth-users ajenti.plugin.core ajenti-plugin-dashboard ajenti.plugin.datetime ajenti-plugin-filemanager ajenti.plugin.filesystem ajenti-plugin-network ajenti.plugin.notepad ajenti-plugin-packages ajenti.plugin.passwd ajenti-plugin-plugins ajenti.plugin.power ajenti-plugin-services ajenti.plugin.settings ajenti-plugin-supervisorl ajenti.plugin.terminal ajenti-plugin-traffic

2- create configuration file call config.json with the following content
{
    "users": {
        "root": {
            "configs": {
                "ajenti.plugins.notepad.notepad.Notepad": "{\"bookmarks\": [], \"root\": \"/\"}",
                "ajenti.plugins.terminal.main.Terminals": "{\"shell\": \"sh -c $SHELL || sh\"}",
                "ajenti.plugins.elements.ipmap.ElementsIPMapper": "{\"users\": {}}",
                "ajenti.plugins.logs.main.Logs": "{\"root\": \"/var/log\"}",
                "ajenti.plugins.munin.client.MuninClient": "{\"username\": \"username\", \"prefix\": \"http://localhost:8080/munin\", \"password\": \"123\"}",
                "ajenti.plugins.dashboard.dash.Dash": "{\"widgets\": [{\"index\": 0, \"config\": null, \"container\": \"1\", \"class\": \"ajenti.plugins.sensors.memory.MemoryWidget\"}, {\"index\": 1, \"config\": null, \"container\": \"1\", \"class\": \"ajenti.plugins.sensors.memory.SwapWidget\"}, {\"index\": 2, \"config\": null, \"container\": \"1\", \"class\": \"ajenti.plugins.dashboard.welcome.WelcomeWidget\"}, {\"index\": 0, \"config\": null, \"container\": \"0\", \"class\": \"ajenti.plugins.sensors.uptime.UptimeWidget\"}, {\"index\": 1, \"config\": null, \"container\": \"0\", \"class\": \"ajenti.plugins.power.power.PowerWidget\"}, {\"index\": 2, \"config\": null, \"container\": \"0\", \"class\": \"ajenti.plugins.sensors.cpu.CPUWidget\"}]}",
                "ajenti.plugins.elements.shaper.main.Shaper": "{\"rules\": []}",
                "ajenti.plugins.ajenti_org.main.AjentiOrgReporter": "{\"key\": null}",
                "ajenti.users.UserManager": "{\"sync-provider\": \"\"}",
                "ajenti.plugins.mysql.api.MySQLDB": "{\"password\": \"\", \"user\": \"root\", \"hostname\": \"localhost\"}",
                "ajenti.plugins.fm.fm.FileManager": "{\"root\": \"/\"}",
                "ajenti.plugins.tasks.manager.TaskManager": "{\"job_definitions\": [], \"task_definitions\": [{\"task_class\": \"ajenti.plugins.tasks.tasks.CommandTask\", \"params\": {\"command\": \"ls /etc\"}, \"name\": \"ls-etc\", \"id\": \"4736d058-4c34-47eb-8e28-a48361b104fd\"}, {\"task_class\": \"ajenti.plugins.tasks.tasks.CommandTask\", \"params\": {\"command\": \"touch /home/tin/zero\"}, \"name\": \"createfilezero\", \"id\": \"a9410d6e-9e89-4d7c-b23c-69a49bb46996\"}]}",
                "ajenti.usersync.adsync.ActiveDirectorySyncProvider": "{\"domain\": \"DOMAIN\", \"password\": \"\", \"user\": \"Administrator\", \"base\": \"cn=Users,dc=DOMAIN\", \"address\": \"localhost\"}",
                "ajenti.plugins.elements.usermgr.ElementsUserManager": "{\"groups\": []}",
                "ajenti.plugins.elements.projects.main.ElementsProjectManager": "{\"projects\": \"KGxwMQou\\n\"}"
            },
            "password": "sha512|$6$rounds=40000$nIVrqqz638rB8wOo$VbMv8y2lStgcsYxEuu7JfHiEd06eeiSoIbg7Hvivj9K1vPayaCbAiAqtpyOoIkNfIXFmMD0jK6Dd4WFnvywkY1",
            "permissions": []
        }
    },
    "language": "",
    "bind": {
        "host": "0.0.0.0",
        "port": 8000
    },
    "enable_feedback": true,
    "ssl": {
        "enable": false,
        "certificate_path": ""
    },
    "authentication": false,
    "installation_id": 12354


**note
you have to update username/password of service such as mysql..., in order to to make it work for that service

3- run ajenti with the following command
$ ajenti-panel -c config.json
if we want to have root previledge use with sudo
$ sudo ajenti-panel -c config.json

4- to access it use browser access to url http://localhost:8000, or http://serverip:8000

- screetshot of  ajenti dashboard

- screetshot of terminal on ajenti

No comments:

Post a Comment