Common Server Commands

The following commands can be used when running the ssh command (more information about initial setup can be found at Server Setup documentation)

The following command can get you into the shell for the server:

ssh kipo

while replacing kipo with the name of your deployment

Informational Commands

Once logged onto the server, you can use cd /dcserver to enter the root folder. Running ls at the root should provide a list similar to the following:

dcServer-23419.fifo deploy-kipo docs ext foreground.sh ignite.sh lib LICENSE.txt logs packages README.md server.sh sync temp templates util

If a file ending in .fifo is present, this means the server is actively running. The numerical portion of that file matches the process ID of the main server process.

htop

Running the htop command will provide a list of processes running currently in the server. The left most column with list the PID or process ID for each process. Press Q at any time to exit the htop screen.

tail

The tail command is a way to pull the last x number of logs from the server, useful for debugging purposes. The format is:

tail -n [x] logs/hub-daemon.log

where x is the number of logs you'd like to view.

exit

Simply type exit to exit the ssh at any timezone

Stopping and Starting the Server

To stop the server, run the following command:

./server.sh stop

You will see a similar message to the following:

Waiting for process 17322 to finish.......done

Also, if you run a ls on the root directory, you'll see the file ended in .fifo is now gone.

To start the server back up again, you can run either of the two following commands:

./server.sh startup ./server.sh start

The startup command will also attempt to update the server before booting up (TODO add info on how updates occur)

WARNING: the following command can be used if there are issues with the stop command functioning properly but if run, you may need to perform the steps located in the Server Setup subsection of Server Setup .

sudo shutdown -r now

This will attempt a hard shutdown and reboot of the server.

Afterwards, check to make sure the disk is properly mounted. While still on the df level on the command line, run the lsblk command, would should present something like the following:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme1n1 259:0 0 100G 0 disk /dcserver nvme0n1 259:1 0 8G 0 disk ├─nvme0n1p1 259:2 0 8G 0 part / └─nvme0n1p128 259:3 0 1M 0 part

If /dcserver is not present in the MOUNTPOINT field, mark the name of the largest size disk (in this example, this would be the nvme1n1 disk), and run the following command:

sudo mount /dev/{nameofdiskhere} /dcserver

once that is complete, IP routing will need to be reset. Run the following three commands:

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443 sudo iptables -t nat -L

Afterwards, check the root URL of the website in a broswer to make sure everything is running smoothly