how to run a server code example

Example 1: minecraft server startup code

java -Xmx1024M -Xms1024M -jar SERVER_FILE_NAME.jar nogui

Example 2: how to setup a web server

# This is just an apache server...

# Do a quick update...
sudo apt-get update

# Install apache2...
sudo apt-get install apache2

# Start it...
sudo service apache2 start

# Stop it if you are not using
sudo service apache2 stop

# To access it after starting.. find your ip address like this...
hostname -I
# or
ifconfig
# or
ip addr

# Now type your ip address in a browser you use. E.g: http://[IP Add.]