Difference between revisions of "GenieACS: Install di Ubuntu 24.04"
(Created page with "===1. Update Repository Ubuntu=== sudo apt update -y sud apt upgrade -y ===2. Install Nodejs=== curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh sudo bash nodesource_setup.sh sudo apt install nodejs node -v ===3. Install MongoDB=== ====1. Import the Public Key==== sudo apt-get install gnupg curl curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ --dearmor ====2....") |
|||
| Line 29: | Line 29: | ||
Latest Release | Latest Release | ||
sudo apt-get install -y mongodb-org | |||
====5. Start MongoDB==== | ====5. Start MongoDB==== | ||
Revision as of 18:42, 31 October 2024
1. Update Repository Ubuntu
sudo apt update -y sud apt upgrade -y
2. Install Nodejs
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh sudo bash nodesource_setup.sh sudo apt install nodejs node -v
3. Install MongoDB
1. Import the Public Key
sudo apt-get install gnupg curl
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \ sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \ --dearmor
2. Create the List File
Create the list file /etc/apt/sources.list.d/mongodb-org-8.0.list for your version of Ubuntu.
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
3. Reload the Package Database
sudo apt-get update
4. Install MongoDB Community Server
Latest Release
sudo apt-get install -y mongodb-org
5. Start MongoDB
sudo systemctl start mongod
If you receive an error similar to the following when starting mongod:
"Failed to start mongod.service: Unit mongod.service not found."
Run the following command first:
sudo systemctl daemon-reload
6. Verify that MongoDB has started successfully
sudo systemctl status mongod
You can optionally ensure that MongoDB will start following a system reboot by issuing the following command:
sudo systemctl enable mongod
7. Stop MongoDB
sudo systemctl stop mongod
8. Restart MongoDB
sudo systemctl restart mongod
4. Install GenieACS
1. Installing from NPM
sudo npm install -g [email protected]
2. Create a system user to run GenieACS daemons
sudo useradd --system --no-create-home --user-group genieacs
3. Create directory to save extensions and environment file
mkdir /opt/genieacs mkdir /opt/genieacs/ext chown genieacs:genieacs /opt/genieacs/ext
Create the file /opt/genieacs/genieacs.env to hold our configuration options which we pass to GenieACS as environment variables.
nano /opt/genieacs/genieacs.env
Isi dengan script dibawah:
GENIEACS_CWMP_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-cwmp-access.log GENIEACS_NBI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-nbi-access.log GENIEACS_FS_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-fs-access.log GENIEACS_UI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-ui-access.log GENIEACS_DEBUG_FILE=/var/log/genieacs/genieacs-debug.yaml NODE_OPTIONS=--enable-source-maps GENIEACS_EXT_DIR=/opt/genieacs/ext
Generate a secure JWT secret and append to /opt/genieacs/genieacs.env:
node -e "console.log(\"GENIEACS_UI_JWT_SECRET=\" + require('crypto').randomBytes(128).toString('hex'))" >> /opt/genieacs/genieacs.env
Set file ownership and permissions:
sudo chown genieacs:genieacs /opt/genieacs/genieacs.env sudo chmod 600 /opt/genieacs/genieacs.env
4. Create logs directory
mkdir /var/log/genieacs chown genieacs:genieacs /var/log/genieacs
5. Create systemd unit files
Run the following command to create genieacs-cwmp service:
sudo systemctl edit --force --full genieacs-cwmp
ISI:
[Unit] Description=GenieACS CWMP After=network.target [Service] User=genieacs EnvironmentFile=/opt/genieacs/genieacs.env ExecStart=/usr/bin/genieacs-cwmp [Install] WantedBy=default.target
Run the following command to create genieacs-nbi service:
sudo systemctl edit --force --full genieacs-nbi
ISI
[Unit] Description=GenieACS NBI After=network.target [Service] User=genieacs EnvironmentFile=/opt/genieacs/genieacs.env ExecStart=/usr/bin/genieacs-nbi [Install] WantedBy=default.target
Run the following command to create genieacs-fs service:
sudo systemctl edit --force --full genieacs-fs
ISI
[Unit] Description=GenieACS FS After=network.target [Service] User=genieacs EnvironmentFile=/opt/genieacs/genieacs.env ExecStart=/usr/bin/genieacs-fs [Install] WantedBy=default.target
Run the following command to create genieacs-ui service:
sudo systemctl edit --force --full genieacs-ui
ISI
[Unit] Description=GenieACS UI After=network.target [Service] User=genieacs EnvironmentFile=/opt/genieacs/genieacs.env ExecStart=/usr/bin/genieacs-ui [Install] WantedBy=default.target
6. Configure log file rotation using logrotate
sudo nano /etc/logrotate.d/genieacs
ISI
/var/log/genieacs/*.log /var/log/genieacs/*.yaml {
daily
rotate 30
compress
delaycompress
dateext
}
7. Enable and start services
sudo systemctl enable genieacs-cwmp sudo systemctl start genieacs-cwmp sudo systemctl status genieacs-cwmp
sudo systemctl enable genieacs-nbi sudo systemctl start genieacs-nbi sudo systemctl status genieacs-nbi
sudo systemctl enable genieacs-fs sudo systemctl start genieacs-fs sudo systemctl status genieacs-fs
sudo systemctl enable genieacs-ui sudo systemctl start genieacs-ui sudo systemctl status genieacs-ui
web browser : 172.16.100.250:3000
click en : Adacadabra! login : admin password : admin
Devices Port : 7547
Fuente : https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/ https://docs.genieacs.com/en/latest/installation-guide.html