diff --git a/ci/vale/dictionary.txt b/ci/vale/dictionary.txt index 50f98607540..d39b3945503 100644 --- a/ci/vale/dictionary.txt +++ b/ci/vale/dictionary.txt @@ -181,6 +181,7 @@ config configs configtest configurability +containerd containerised convolutional cookstyle @@ -198,6 +199,7 @@ craigslist crashingdaily createdt createfromstackscript +cri cron crond cronie @@ -398,6 +400,7 @@ foodcritic fortran fpm fragging +frakti framesets freedns friendster @@ -1088,6 +1091,7 @@ releasever remi remmina remotehost +replicaset replset repo repos diff --git a/docs/applications/big-data/how-to-scrape-a-website-with-beautiful-soup/index.md b/docs/applications/big-data/how-to-scrape-a-website-with-beautiful-soup/index.md index fd19bdff284..aa103511d9a 100644 --- a/docs/applications/big-data/how-to-scrape-a-website-with-beautiful-soup/index.md +++ b/docs/applications/big-data/how-to-scrape-a-website-with-beautiful-soup/index.md @@ -231,7 +231,7 @@ row = 0 The **Headlines** variable is a list of titles for the columns in the spreadsheet. The **row** variable tracks the current spreadsheet row. -2. Use `xlswriter` to open a workbook and add a worksheet to receive the data. +2. Use `xlsxwriter` to open a workbook and add a worksheet to receive the data. {{< file "craigslist.py" python >}} workbook = xlsxwriter.Workbook('motorcycle.xlsx') diff --git a/docs/applications/containers/beginners-guide-to-kubernetes/index.md b/docs/applications/containers/beginners-guide-to-kubernetes/index.md new file mode 100644 index 00000000000..520652c1f21 --- /dev/null +++ b/docs/applications/containers/beginners-guide-to-kubernetes/index.md @@ -0,0 +1,489 @@ +--- +author: + name: Andy Stevens + email: docs@linode.com +description: 'A high level overview of Kubernetes cluster.' +keywords: ['kubernetes','k8s','beginner','architecture'] +license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' +published: 2019-03-21 +modified: 2019-03-21 +modified_by: + name: Linode +title: "A Beginner's Guide to Kubernetes" +contributor: + name: Linode +external_resources: +- '[Kubernetes API Documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/)' +- '[Kubernetes Concepts Documentation](https://kubernetes.io/docs/concepts/)' +--- + +*Kubernetes*, often referred to as *k8s*, is an open source container orchestration system that helps deploy and manage containerized applications. Developed by Google starting in 2014 and written in the Go language, Kubernetes is quickly becoming the standard way to architect horizontally-scalable applications. This guide will explain the major parts and concepts of Kubernetes. + + +## Containers + +Kubernetes is a container orchestration tool and, therefore, needs a container runtime installed to work. In practice, the default container runtime for Kubernetes is [Docker](https://www.docker.com/), though other runtimes like [rkt](https://coreos.com/rkt/), and [LXD](https://linuxcontainers.org/lxd/introduction/) will also work. With the advent of the [Container Runtime Interface (CRI)](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/container-runtime-interface.md), which hopes to standardize the way Kubernetes interacts with containers, other options like [containerd](https://containerd.io/), [cri-o](https://cri-o.io/), and [Frakti](https://github.com/kubernetes/frakti) have also become available. This guide assumes you have a working knowledge of containers and the examples will all use Docker as the container runtime. + +## Kubernetes API + +Kubernetes is built around a robust RESTful API. Every action taken in Kubernetes, be it inter-component communication or user command, interacts in some fashion with the Kubernetes API. The goal of the API is to help facilitate the desired state of the Kubernetes cluster. If you want X instances of your application running and have Y currently active, the API will take the required steps to get to X, whether this means creating, or destroying resources. To create this desired state, you create *objects*, which are normally represented by YAML files called *manifests*, and apply them through the command line with the **kubectl** tool. + +## kubectl + +kubectl is a command line tool used to interact with the Kubernetes cluster. It offers a host of features, including the ability to create, stop, and delete resources, describe active resources, and auto scale resources. For more information on the types of commands and resources you can use with kubectl, consult the [Kubernetes kubectl documentation](https://kubernetes.io/docs/reference/kubectl/overview/). + +## Kubernetes Master, Nodes, and Control Plane + +At the highest level of Kubernetes, there exist two kinds of servers, a *Master* and a *Node*. These servers can be Linodes, VMs, or physical servers. Together, these servers form a *cluster*. + +### Nodes + +Kubernetes Nodes are worker servers that run your application. The number of Nodes is determined by the user, and they are created by the user. In addition to running your application, each Node runs two processes: + +- **kubelet** receives descriptions of the desired state of a [Pod](#pods) from the API server, and ensures the Pod is healthy, and running on the Node. +- **kube-proxy** is a networking proxy that proxies the UDP, TCP, and SCTP networking of each Node, and provides load balancing. This is only used to connect to [Services](#services). + +### Kubernetes Master + +The Kubernetes Master is normally a separate server responsible for maintaining the desired state of the cluster. It does this by telling the Nodes how many instances of your application it should run and where. The Kubernetes Master runs three processes: + +- **kube-apiserver** is the front end for the Kubernetes API server. +- **kube-controller-manager** is a daemon that manages the Kubernetes control loop. For more on Controllers, see the [Controllers section](#controllers). +- **kube-scheduler** is a function that looks for newly created Pods that have no Nodes, and assigns them a Node based on a host of requirements. For more information on kube-scheduler, consult the [Kubernetes kube-scheduler documentation](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/). + +Additionally, the Kubernetes Master runs the database **etcd**. Etcd is a highly available key-value store that provides the backend database for Kubernetes. + +Together, kube-apiserver, kube-controller-manager, kube-scheduler, and etcd form what is known as the *control plane*. The control plane is responsible for making decisions about the cluster, and pushing it toward the desired state. + +## Kubernetes Objects + +In Kubernetes, there are a number of objects that are abstractions of your Kubernetes system's desired state. These objects represent your application, its networking, and disk resources -- all of which together form your application. + +### Pods + +In Kubernetes, all containers exist within *Pods*. Pods are the smallest unit of the Kubernetes architecture, and can be viewed as a kind of wrapper for your container. Each Pod is given its own IP address with which it can interact with other Pods within the cluster. + +Usually, a Pod contains only one container, but a Pod can contain multiple containers if those containers need to share resources. If there is more than one container in a Pod, these containers can communicate with one another via localhost. + +Pods in Kubernetes are "mortal," which means that they are created, and destroyed depending on the needs of the application. For instance, you might have a web app backend that sees a spike in CPU usage. This might cause the cluster to scale up the amount of backend Pods from two to ten, in which case eight new Pods would be created. Once the traffic subsides, the Pods might scale back to two, in which case eight pods would be destroyed. + +It is important to note that Pods are destroyed without respect to which Pod was created first. And, while each Pod has its own IP address, this IP address will only be available for the life-cycle of the Pod. + +Below is an example of a Pod manifest: + +{{< file "my-apache-pod.yaml" yaml >}} +apiVersion: v1 +kind: Pod +metadata: + name: apache-pod + labels: + app: web +spec: + containers: + - name: apache-container + image: httpd +{{}} + +Each manifest has four necessary parts: + +- The version of the API in use +- The kind of resource you'd like to define +- Metadata about the resource +- Though not required by all objects, a spec which describes the desired behavior of the resource is necessary for most objects and controllers. + +In the case of this example, the API in use is `v1`, and the `kind` is a Pod. The metadata field is used for applying a name, labels, and annotations. Names are used to differentiate resources, while labels are used to group like resources. Labels will come into play more when defining [Services](#services) and [Deployments](#deployments). Annotations are for attaching arbitrary data to the resource. + +The spec is where the desired state of the resource is defined. In this case, a Pod with a single Apache container is desired, so the `containers` field is supplied with a name, 'apache-container', and an image, the latest version of Apache. The image is pulled from [Docker Hub](https://hub.docker.com), as that is the default container registry for Kubernetes. + +For more information on the type of fields you can supply in a Pod manifest, refer to the [Kubernetes Pod API documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#pod-v1-core). + +Now that you have the manifest, you can create the Pod using the `create` command: + + kubectl create -f my-apache-pod.yaml + +To view a list of your pods, use the `get pods` command: + + kubectl get pods + +You should see output like the following: + + NAME READY STATUS RESTARTS AGE + apache-pod 1/1 Running 0 16s + +To quickly view which Node the Pod exists on, issue the `get pods` command with the `-o=wide` flag: + + kubectl get pods -o=wide + +To retrieve information about the Pod, issue the `describe` command: + + kubcetl describe pod apache-pod + +You should see output like the following: + + ... + Events: + Type Reason Age From Message + ---- ------ ---- ---- ------- + Normal Scheduled 2m38s default-scheduler Successfully assigned default/apache-pod to mycluster-node-1 + Normal Pulling 2m36s kubelet, mycluster-node-1 pulling image "httpd" + Normal Pulled 2m23s kubelet, mycluster-node-1 Successfully pulled image "httpd" + Normal Created 2m22s kubelet, mycluster-node-1 Created container + Normal Started 2m22s kubelet, mycluster-node-1 Started container + +To delete the Pod, issue the `delete` command: + + kubectl delete pod apache-pod + +### Services + +*Services* group identical Pods together to provide a consistent means of accessing them. For instance, you might have three Pods that are all serving a website, and all of those Pods need to be accessible on port 80. A Service can ensure that all of the Pods are accessible at that port, and can load balance traffic between those Pods. Additionally, a Service can allow your application to be accessible from the internet. Each Service is given an IP address and a corresponding local DNS entry. Additionally, Services exist across Nodes. If you have two replica Pods on one Node and an additional replica Pod on another Node, the service can include all three Pods. There are four types of Service: + +- **ClusterIP**: Exposes the Service internally to the cluster. This is the default setting for a Service. +- **NodePort**: Exposes the Service to the internet from the IP address of the Node at the specified port number. You can only use ports in the 30000-32767 range. +- **LoadBalancer**: This will create a load balancer assigned to a fixed IP address in the cloud, so long as the cloud provider supports it. In the case of Linode, this is the responsibility of the [Linode Cloud Controller Manager](https://github.com/linode/linode-cloud-controller-manager), which will create a NodeBalancer for the cluster. This is the best way to expose your cluster to the internet. +- **ExternalName**: Maps the service to a DNS name by returning a CNAME record redirect. ExternalName is good for directing traffic to outside resources, such as a database that is hosted on another cloud. + +Below is an example of a Service manifest: + +{{< file "my-apache-service.yaml" yaml>}} +apiVersion: v1 +kind: Service +metadata: + name: apache-service + labels: + app: web +spec: + type: NodePort + ports: + - port: 80 + targetPort: 80 + nodePort: 30020 + selector: + app: web +{{}} + +The above example Service uses the `v1` API, and its `kind` is Service. Like the Pod example in the previous section, this manifest has a name and a label. Unlike the Pod example, this spec uses the `ports` field to define the exposed port on the container (`port`), and the target port on the Pod (`targetPort`). The `type` `NodePort` unlocks the use of `nodePort` field, which allows traffic on the host Node at that port. Lastly, the `selector` field is used to target only the Pods that have been assigned the `app: web` label. + +For more information on Services, visit the [Kubernetes Service API documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#service-v1-core). + +To create the Service from the YAML file, issue the create command: + + kubectl create -f my-apache-service.yaml + +To view a list of running services, issue the `get services` command: + + kubectl get services + +You should see output like the following: + + NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + apache-service NodePort 10.99.57.13 80:30020/TCP 54s + kubernetes ClusterIP 10.96.0.1 443/TCP 46h + +To retrieve more information about your Service, issue the `describe` command: + + kubectl describe service apache-service + +To delete the Service, issue the delete command: + + kubcetl delete service apache-service + +### Volumes + +A *Volume* in Kubernetes is a way to share file storage between containers in a Pod. Kubernetes Volumes differ from Docker volumes because they exist inside the Pod rather than inside the container. When a container is restarted the Volume persists. Note, however, that these Volumes are still tied to the lifecycle of the Pod, so if the Pod is destroyed the Volume will be destroyed with it. + +Linode also offers a [Container Storage Interface (CSI) driver](https://github.com/linode/linode-blockstorage-csi-driver) that allows the cluster to persist data on a Block Storage volume. + +Below is an example of how to create and use a Volume by creating a Pod manifest: + +{{< file "my-apache-pod-with-volume.yaml" yaml>}} +apiVersion: v1 +kind: Pod +metadata: + name: apache-with-volume +spec: + volumes: + - name: apache-storage-volume + emptyDir: {} + + containers: + - name: apache-container + image: httpd + volumeMounts: + - name: apache-storage-volume + mountPath: /data/apache-data +{{}} + +A Volume has two unique aspects to its definition. In this example, the first aspect is the `volumes` block that defines the type of Volume you want to create, which in this case is a simple empty directory (`emptyDir`). The second aspect is the `volumeMounts` field within the container's `spec`. This field is given the name of the Volume you are creating and a mount path within the container. + +There are a number of different Volume types you could create in addition to `emptyDir` depending on your cloud host. For more information on Volume types, visit the [Kubernetes Volumes API documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#volume-v1-core). + + +### Namespaces + +Namespaces are virtual clusters that exist within the Kubernetes cluster that help to group and organize objects. Every cluster has at least three namespaces: `default`, `kube-system`, and `kube-public`. When interacting with the cluster it is important to know which Namespace the object you are looking for is in, as many commands will default to only showing you what exists in the `default` namespace. Resources created without an explicit namespace will be added to the `default` namespace. + +Namespaces consist of alphanumeric characters, dashes (`-`), and periods (`.`). + +Here is an example of how to define a Namespace with a manifest: + +{{< file "my-namespace.yaml" yaml>}} +apiVersion: v1 +kind: Namespace +metadata: + name: my-app +{{}} + +To create the Namespace, issue the `create` command: + + kubcetl create -f my-namespace.yaml + +Below is an example of a Pod with a Namespace: + +{{< file "my-apache-pod-with-namespace.yaml" yaml >}} +apiVersion: v1 +kind: Pod +metadata: + name: apache-pod + labels: + app: web + namespace: my-app +spec: + containers: + - name: apache-container + image: httpd +{{}} + +To retrieve resources in a certain Namespace, use the `-n` flag. + + kubectl get pods -n my-app + +You should see a list of Pods within your namespace: + + NAME READY STATUS RESTARTS AGE + apache-pod 1/1 Running 0 7s + +To view Pods in all Namespaces, use the `--all-namespaces` flag. + + kubectl get pods --all-namespaces + +To delete a Namespace, issue the `delete namespace` command. Note that this will delete all resources within that Namespace: + + kubectl delete namespace my-app + +For more information on Namespaces, visit the [Kubernetes Namespaces API documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#namespace-v1-core) + +## Controllers + +A Controller is a control loop that continuously watches the Kubernetes API and tries to manage the desired state of certain aspects of the cluster. There are a number of controllers. Below is a short reference of the most popular controllers you might interact with. + +### ReplicaSets + +As has been mentioned, Kubernetes allows an application to scale horizontally. A *ReplicaSet* is one of the controllers responsible for keeping a given number of replica Pods running. If one Pod goes down in a ReplicaSet, another will be created to replace it. In this way, Kubernetes is *self-healing*. However, for most use cases it is recommended to use a [Deployment](#deployments) instead of a ReplicaSet. + +Below is an example of a ReplicaSet: + +{{< file "my-apache-replicaset.yaml" yaml>}} +apiVersion: apps/v1 +kind: ReplicaSet +metadata: + name: apache-replicaset + labels: + app: web +spec: + replicas: 5 + selector: + matchLabels: + app: web + template: + metadata: + labels: + app: web + spec: + containers: + - name: apache-container + image: httpd +{{}} + +There are three main things to note in this ReplicaSet. The first is the `apiVersion`, which is `apps/v1`. This differs from the previous examples, which were all `apiVersion: v1`, because ReplicaSets do not exist in the `v1` core. They instead reside in the `apps` group of `v1`. The second and third things to note are the `replicas` field and the `selector` field. The `replicas` field defines how many replica Pods you want to be running at any given time. The `selector` field defines which Pods, matched by their label, will be controlled by the ReplicaSet. + +To view your ReplicaSets, issue the `get replicasets` command: + + kubectl get replicasets + +You should see output like the following: + + NAME DESIRED CURRENT READY AGE + apache-replicaset 5 5 0 5s + +This output shows that of the five desired replicas, there are 5 currently active, but zero of those replicas are available. This is because the Pods are still booting up. If you issue the command again, you will see that all five have become ready: + + NAME DESIRED CURRENT READY AGE + apache-replicaset 5 5 5 86s + +You can view the Pods the ReplicaSet created by issuing the `get pods` command: + + NAME READY STATUS RESTARTS AGE + apache-replicaset-5rsx2 1/1 Running 0 31s + apache-replicaset-8n52c 1/1 Running 0 31s + apache-replicaset-jcgn8 1/1 Running 0 31s + apache-replicaset-sj422 1/1 Running 0 31s + apache-replicaset-z8g76 1/1 Running 0 31s + +To delete a ReplicaSet, issue the `delete replicaset` command: + + kubectl delete replicaset apache-replicaset + +If you issue the `get pods` command, you will see that the Pods the ReplicaSet created are in the process of terminating: + + NAME READY STATUS RESTARTS AGE + apache-replicaset-bm2pn 0/1 Terminating 0 3m54s + +In the above example, four of the Pods have already terminated, and one is in the process of terminating. + +For more information on ReplicaSets, view the [Kubernetes ReplicaSets API documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#replicaset-v1-apps). + +### Deployments + +A *Deployment* can manage a ReplicaSet, so it shares the ability to keep a defined number of replica pods up and running. A Deployment can also update those Pods to resemble the desired state by means of rolling updates. For example, if you wanted to update a container image to a newer version, you would create a Deployment, and the controller would update the container images one by one until the desired state is achieved. This ensures that there is no downtime when updating or altering your Pods. + +Below is an example of a Deployment: + +{{< file "my-apache-deployment.yaml" yaml>}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: apache-deployment + labels: + app: web +spec: + replicas: 5 + selector: + matchLabels: + app: web + template: + metadata: + labels: + app: web + spec: + containers: + - name: apache-container + image: httpd:2.4.35 +{{}} + +The only noticeable difference between this Deployment and the example given in the ReplicaSet section is the `kind`. In this example we have chosen to initially install Apache 2.4.35. If you wanted to update that image to Apache 2.4.38, you would issue the following command: + + kubectl --record deployment.apps/apache-deployment set image deployment.v1.apps/apache-deployment apache-container=httpd:2.4.38 + +You'll see a confirmation that the images have been updated: + + deployment.apps/apache-deployment image updated + +To see for yourself that the images have updated, you can grab the Pod name from the `get pods` list: + + kubectl get pods + + NAME READY STATUS RESTARTS AGE + apache-deployment-574c8c4874-8zwgl 1/1 Running 0 8m36s + apache-deployment-574c8c4874-9pr5j 1/1 Running 0 8m36s + apache-deployment-574c8c4874-fbs46 1/1 Running 0 8m34s + apache-deployment-574c8c4874-nn7dl 1/1 Running 0 8m36s + apache-deployment-574c8c4874-pndgp 1/1 Running 0 8m33s + +Issue the `describe` command to view all of the available details of the Pod: + + kubectl describe pod apache-deployment-574c8c4874-pndgp + +You'll see a long list of details, of which the container image is included: + + .... + + Containers: + apache-container: + Container ID: docker://d7a65e7993ab5bae284f07f59c3ed422222100833b2769ff8ee14f9f384b7b94 + Image: httpd:2.4.38 + + .... + + +For more information on Deployments, visit the [Kubernetes Deployments API documentation](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#deployment-v1-apps) + +### Jobs + +A *Job* is a controller that manages a Pod that is created for a single, or set, of tasks. This is handy if you need to create a Pod that performs a single function, or calculates a value. The deletion of the Job will delete the Pod. + +Below is an example of a Job that simply prints "Hello World!" and ends: + +{{< file "my-job.yaml" yaml>}} +apiVersion: batch/v1 +kind: Job +metadata: + name: hello-world +spec: + template: + metadata: + name: hello-world + spec: + containers: + - name: output + image: debian + command: + - "bin/bash" + - "-c" + - "echo 'Hello World!'" + restartPolicy: Never +{{}} + +To create the Job, issue the `create` command: + + kubectl create -f my-job.yaml + +To see if the job has run, or is running, issue the `get jobs` command: + + kubectl get jobs + +You should see output like the following: + + NAME COMPLETIONS DURATION AGE + hello-world 1/1 9s 8m23s + +To get the Pod of the Job, issue the `get pods` command: + + kubectl get pods + +You should see an output like the following: + + NAME READY STATUS RESTARTS AGE + hello-world-4jzdm 0/1 Completed 0 9m44s + +You can use the name of the Pod to inspect its output by consulting the log file for the Pod: + + kubectl get logs hello-world-4jzdm + +To delete the Job, and its Pod, issue the `delete` command: + + kubectl delete job hello-world + +## Networking + +Networking in Kubernetes was designed to make it simple to port existing apps from VMs to containers, and subsequently, Pods. The basic requirements of the Kubernetes networking model are: + +1. Pods can communicate with each other across Nodes without the use of [NAT](https://whatismyipaddress.com/nat) +2. Agents on a Node, like kubelet, can communicate with all of a Node's Pods +3. In the case of Linux, Pods in a Node's host network can communicate to all other Pods without NAT. + +Though the rules of the Kubernetes networking model are simple, the implementation of those rules is an advanced topic. Because Kubernetes does not come with its own implementation, it is up to the user to provide a networking model. + +Two of the most popular options are [Flannel](https://github.com/coreos/flannel#flannel) and [Calico](https://docs.projectcalico.org/v2.0/getting-started/kubernetes/). Flannel is a networking overlay that meets the functionality of the Kubernetes networking model by supplying a layer 3 network fabric, and is relatively easy to set up. Calico enables networking, and networking policy through the [NetworkPolicy API](https://kubernetes.io/docs/concepts/services-networking/network-policies/) to provide simple virtual networking. + +For more information on the Kubernetes networking model, and ways to implement it, consult the [cluster networking documentation](https://kubernetes.io/docs/concepts/cluster-administration/networking/). + +## Next Steps + +There are a number of advanced topics in Kubernetes. Below are a few you might find useful as you progress in Kubernetes: + +- [StatefulSets](https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/) can be used when creating stateful applications. +- [DaemonSets](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) can be used to ensure each Node is running a certain Pod. This is useful for log collection, monitoring, and cluster storage. +- [Horizontal Pod Autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) can automatically scale your deployments based on CPU usage. +- [CronJobs](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) can schedule [Jobs](#jobs) to run at certain times. +- [ResourceQuotas](https://kubernetes.io/docs/concepts/policy/resource-quotas/) are helpful when working with larger groups where there is a concern that some teams might take up too many resources. \ No newline at end of file diff --git a/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md b/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md index e4968a74ada..2dcede5d7e4 100644 --- a/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md +++ b/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md @@ -81,7 +81,7 @@ password = MySQL root user's password 3. Create the cron job file. Below is an example cron job to back up the entire database management system every day at 1am: {{< file "/etc/cron.daily/mysqldump" >}} -0 1 * * * /usr/bin/mysqldump --defaults-extra-file=/home/example_user/.my.cnf -u root --single-transaction --quick --lock-tables=false --all-databases > full-backup-$(date +%F).sql +0 1 * * * /usr/bin/mysqldump --defaults-extra-file=/home/example_user/.my.cnf -u root --single-transaction --quick --lock-tables=false --all-databases > full-backup-$(date +\%F).sql {{< /file >}} For more information on cron, see the [cron(8)](https://linux.die.net/man/8/cron) and [cron(5)](https://linux.die.net/man/5/crontab) manual pages. diff --git a/docs/development/version-control/introduction-to-version-control/index.md b/docs/development/version-control/introduction-to-version-control/index.md index bc095837f2f..e0dcde4ec74 100644 --- a/docs/development/version-control/introduction-to-version-control/index.md +++ b/docs/development/version-control/introduction-to-version-control/index.md @@ -36,7 +36,7 @@ Version control (also referred to as *revision control* or *source control*) is Version control is also a great tool for individuals who need to work on the same files at the same time. With version control, they can *check out* the repository and then *commit* the changes when they're finished. If two individuals have modified the same file, the version control system can usually *merge* the changes, unless there's a *conflict*, in which case the user will need to manually combine the changes or favor one change over the other. -Version control also makes it easy to track changes. You can see who committed code, and why. And if you start working on a new version of your website or application, you can *branch* a copy of your code to a separate area. (The branch can later be modified back into the *truck*.) In short, version control is cheap insurance against human errors and unforeseeable disasters. You should be using it! +Version control also makes it easy to track changes. You can see who committed code, and why. And if you start working on a new version of your website or application, you can *branch* a copy of your code to a separate area. (The branch can later be modified back into the *trunk*.) In short, version control is cheap insurance against human errors and unforeseeable disasters. You should be using it! ### Evaluating Version Control Systems diff --git a/docs/email/how-to-create-an-email-server-with-mail-in-a-box/index.md b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/index.md index f9c84c19e1c..9f5b4acb2c8 100644 --- a/docs/email/how-to-create-an-email-server-with-mail-in-a-box/index.md +++ b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/index.md @@ -6,14 +6,15 @@ description: 'This guide shows how to install and run Mail-in-a-Box, a simple, c keywords: ["install mail-in-a-box", "webmail control panel", "caldav", "cardav", " TLS certificate"] license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' published: 2017-08-29 -modified: 2017-08-30 +modified: 2019-03-19 modified_by: - name: Alexandru Andrei + name: Faisal Misle title: How to Create an Email Server with Mail-in-a-Box contributor: name: Alexandru Andrei external_resources: - '[Mail-in-a-Box Official Website](https://mailinabox.email/)' +- '[Mail-in-a-Box Forums](https://discourse.mailinabox.email/)' --- @@ -21,18 +22,18 @@ external_resources: If you chose to host your own email server, but after reading through [Running a Mail Server](/docs/email/running-a-mail-server/) you got discouraged by the complexity of this process, then there's another solution: Mail-in-a-Box. The name is fitting since the software manages to pack everything you need from a mail server, in one single allegorical box. It includes: -* Postfix, as the Simple Mail Transfer Protocol (SMTP) server. -* Dovecot, as the Internet Message Access Protocol (IMAP) server; it's what allows you to sync mail with your phone, read/send messages, delete them, etc. +* Postfix, as the *Simple Mail Transfer Protocol* (SMTP) server. +* Dovecot, as the *Internet Message Access Protocol* (IMAP) server; it's what allows you to sync mail with your phone, read/send messages, delete them, etc. * CardDAV/CalDAV implemented through Nextcloud (a fork of OwnCloud that includes more features); this enables you to sync your address book and calendar events. * Z-push to implement the Exchange ActiveSync protocol so that mail can be "pushed" to your phone as soon as it arrives on the server. * Roundcube webmail, which helps you manage your email by using a web browser. -* Nsd4 Domain Name System (DNS) server; this saves you the hassle of manually adding DNS entries to configure *Sender Policy Framework* (*SPF*), *DomainKeys Identified Mail* (*DKIM*) and *Domain-based Message Authentication, Reporting and Conformance* (*DMARC*), features used to battle spam on the Internet; properly configured, these increase the likelihood that your server will be seen as "legit" by other servers +* Nsd4 *Domain Name System* (DNS) server; this saves you the hassle of manually adding DNS entries to configure *Sender Policy Framework* (SPF), *DomainKeys Identified Mail* (DKIM) and *Domain-based Message Authentication, Reporting and Conformance* (DMARC), features used to battle spam on the Internet; properly configured, these increase the likelihood that your server will be seen as "legit" by other servers * A backup service * A control panel, also accessible through the web browser, that: * Greets you with a comprehensive system status check that makes you aware of any possible problems with your server and offers advice on how to fix them; * Lets you add or remove mailboxes, change passwords, backup data, change DNS settings; * Does a great job at explaining what each setting does and how it should be used. It also includes examples on how to interact with its *Application Programming Interface* (API) so that you can automate tasks, such as creating a mailbox through your own application/website (e.g., user registers on your website to get an email account) -* And more: if you're interested in the details, you can read about the components here: [Mail-in-a-Box Components](https://github.com/mail-in-a-box/mailinabox#the-box) +* If you're interested in the details, you can read about the components here: [Mail-in-a-Box Components](https://github.com/mail-in-a-box/mailinabox#the-box) The preconfigured box of software is also fairly security-conscious and you can read more about it here: [Security features enabled in Mail-in-a-Box](https://github.com/mail-in-a-box/mailinabox/blob/master/security.md) @@ -44,23 +45,25 @@ The preconfigured box of software is also fairly security-conscious and you can 3. It's highly recommended that you follow the instructions on [Hardening SSH access](/docs/security/securing-your-server/#harden-ssh-access) but **only** the steps regarding SSH; other steps might clash with what Mail-in-a-Box will set up (e.g., it implements its own `fail2ban` rules). -If you insist on using a password for root instead of a private key, at least use a **very good password**. Bots constantly scan the Internet for SSH servers and try random passwords. Some are more aggressive than others, and while `fail2ban` helps block IPs, there's always the next bot (with a different IP) that will visit and have another try. Keep in mind that strings such as "h4x0r123," while they may look strong because they mix letters and numbers, are actually very weak. +If you insist on using a password for root instead of a private key, at least use a **very good password**. Bots constantly scan the Internet for SSH servers and try random passwords. Some are more aggressive than others, and while `fail2ban` helps block IPs, there's always the next bot (with a different IP) that will visit and have another try. Keep in mind that strings such as *h4x0r123*, while they may look strong because they mix letters and numbers, are actually very weak. -4. Wherever you see `example.com` in this tutorial, replace it with your domain name, and leave the prefix as it is. That is, don't change `box` to something else. +{{< note >}} +Wherever you see `example.com` in this tutorial, replace it with your domain name, and leave the prefix as it is. That is, don't change `box` to something else. Also, `203.0.113.1` is used as an example IP; your outputs should reflect your server IP instead. +{{< /note >}} -## Launch Ubuntu 14.04 Server +## Launch Ubuntu 18.04 Server {{< caution >}} Use this server exclusively for Mail-in-a-Box. Installing extra software might cause unexpected behavior. {{< /caution >}} -Although Ubuntu 16.04 is available, Mail-in-a-Box has not been prepared or tested in that environment so you'll need to use the 14.04 release which still receives security fixes until April 2019. - Choose a server with at least 1GB of RAM. If you plan to host many users (mailboxes) and/or expect a high volume of email traffic, you can start out with 2GB or more. Don't forget to boot the server. +Make sure you select Ubuntu 18.04 as the *Operating System* (OS), as starting with version 0.40 only Ubuntu 18.04 is supported. + ## Configure Your Domain Name -You'll have to check with the company where you've registered your domain name to see how you can change your nameservers and add glue records. Either search for this information on Google, the site's knowledge base, or ask their support to help you. +You'll have to check with your registrar, the company where you've registered your domain name with, to see how you can change your nameservers and add glue records. Either search for this information on Google, the site's knowledge base, or ask their support to help you. Here's what you'll need to do: @@ -74,7 +77,7 @@ Here's what you'll need to do: ns1.box.example.com 203.0.113.1 ns2.box.example.com 203.0.113.1 -You might have noticed you're using the same IP in both entries. There are a few registrars that have a problem with this, so in case you're unlucky, you won't be able to save these settings and will have to contact their support team. +You might have noticed you're using the same IP in both entries. There are a few registrars that have a problem with this, so you may not be able to save these settings and will have to contact their support team. Alternatively, you can skip using your box as a DNS host, and keep your registrar's DNS host. You will find all the needed records in the **System -> External DNS** tab of the administration console, once you've completed installation. Also note that some registrars may only require you to enter `ns1.box` as they autocomplete the rest of your hostname, `.example.com`. Carefully examine the page to see which variant you should use. @@ -90,7 +93,7 @@ You should see your nameservers at the end of the output: example.com. 300 IN NS ns2.box.example.com. dig: couldn't get address for 'ns1.box.example.com': no more -At this point you can continue. If you don't see the required data, then come back later and check - again. If after one hour it's still missing, then contact your registrar's support team. +At this point you can continue. If you don't see the required data, then come back later and check again. If after one hour it's still missing, then contact your registrar's support team. ## Install Mail-in-a-Box @@ -110,31 +113,31 @@ If you notice a reboot is needed (usually when the Linux kernel is upgraded), ty curl -s https://mailinabox.email/setup.sh | sudo bash -It will start to download software and after a while greet you with a *Text User Interface* (*TUI*), which is a way to present a more user-friendly install wizard under the limitations of a terminal. You can navigate the menus with the arrow keys and simply press `ENTER` to make the desired selections. +It will start to download software and after a while greet you with a *Text User Interface* (TUI), which is a way to present a more user-friendly install wizard under the limitations of a terminal. You can navigate the menus with the arrow keys and simply press `ENTER` to make the desired selections. -Every step is thoroughly explained in the terminal output. The first steps are easy to follow. But here are the more interesting ones: +Every step is thoroughly explained in the terminal output. ### Install Wizard Steps 1. When you're prompted to choose an email address, delete the pre-filled value and replace it with `your_name`@example.com. You can replace `your_name` with whatever you desire, as long as it's a valid username. - ![Choose Main Email Address and Domain](mail-in-a-box-choose-email-and-domain-ubuntu1404.png) + ![Choose Main Email Address and Domain](mail-in-a-box-choose-email-and-domain-ubuntu1804.png) 2. In the next step, the hostname should look like this: - ![Choose Hostname](mail-in-a-box-choose-hostname-ubuntu1404.png) + ![Choose Hostname](mail-in-a-box-choose-hostname-ubuntu1804.png) Now, the install wizard should continue to download and configure software packages. Just wait for it to do its magic. 3. At the next step, you'll be prompted to choose your timezone. Use the arrow keys to make the desired selection and press `ENTER`. - ![Choose Timezone](mail-in-a-box-choosing-timezone-ubuntu1404.png) + ![Choose Timezone](mail-in-a-box-choose-timezone-ubuntu1804.png) Once again, Mail-in-a-Box will continue to pull in required packages and auto-configure them. Wait for it to finish, it will take longer this time. -4. When package auto-configuration is complete, you'll be prompted to install a *Transport Layer Security* (*TLS*) certificate. If Let's Encrypt cannot verify that you own your domain (i.e., DNS changes haven't yet propagated to its servers), then this step will be automatically skipped, but you can still request your certificate later from the control panel of Mail-in-a-Box. +4. When it finishes installing the packages, the script will prompt you to choose a password for the administrative account. Choose a good password since this is the most powerful account that can make any change in the control panel. This will also be the password to the email account you set up in Step 1. -5. At the next step, you'll choose a password for the administrative account. Choose a good password since this is the most powerful account that can make any change in the control panel. +5. When package auto-configuration is complete, you'll be prompted to install a *Transport Layer Security* (TLS) certificate. If Let's Encrypt cannot verify that you own your domain (i.e., DNS changes haven't yet propagated to its servers), then this step will be automatically skipped, but you can still request your certificate later from the control panel of Mail-in-a-Box. 6. At this point the script has finished its job and you'll be prompted with this message in the terminal output: @@ -173,19 +176,19 @@ Since it's very likely that a Let's Encrypt TLS certificate hasn't been installe dig example.com - When you see this in the output, `203.0.113.1` (the IP address of your server), you can continue; otherwise try again later: + When you see your server IP in the A record, you can continue; otherwise try again later. ;; ANSWER SECTION: example.com. 1724 IN A 203.0.113.1 -2. In the top-left menu you'll notice an element called **System**. Click on it and then select **TLS (SSL) Certificates**. Now click on the blue button that says **Provision** and follow the instructions. +2. In the top-left menu you'll notice an element called **System**. Click on it and then select **TLS (SSL) Certificates**. Now click on the blue button that says **Provision** and within a few minutes the certificate status should change to **Signed & valid**. ![Control Panel - TLS Certificates Page](mail-in-a-box-control-panel-tls-certificates-ubuntu1404.png) -3. Follow this guide, [How to Configure Reverse DNS on a Linode Server](/docs/networking/dns/configure-your-linode-for-reverse-dns/), to set up a pointer record (PTR). This step is important to execute and pass some antispam checks. Without it, some of the other mail servers will flag your outbound email as spam or will consider it suspicious that your IP doesn't point to your domain name. +3. Follow this guide, [How to Configure Reverse DNS on a Linode Server](/docs/networking/dns/configure-your-linode-for-reverse-dns/), to set up a *pointer record* (PTR). Make sure you set it to `box.example.com`. This step is very important to execute and pass some antispam checks. Without it, a lot of mail servers will flag your outbound email as spam and will consider it suspicious that your IP doesn't point to your domain name, and sometimes even reject it. ## Conclusion -As you can see, it's very convenient when everything for an email server is packaged in one place and automagically configured. But convenience often has a price. Mail-in-a-box's centralization - that makes it easy to manage everything - also creates a single point of failure. There is a safety net though: email servers are intelligent enough to retry sending you their data for a few days, in case your server is unavailable. +As you can see, it's very convenient when everything for an email server is packaged in one place and automatically configured. But convenience often has a price. Mail-in-a-box's centralization - that makes it easy to manage everything - also creates a single point of failure. There is a safety net though: email servers are intelligent enough to retry sending you their data for a few days, in case your server is unavailable. -But if you can't afford the delay, you should look at ways to make your setup more reliable. A beginner friendly approach is to set up a monitoring system that will notify you quickly in case of problems. Later on, you can look into secondary (slave) nameservers, secondary MX entries, cloning and syncing Mail-in-a-Box machines, so they can take over in case of failure and floating IPs. +If you can't afford the delay, you should look at ways to make your setup more reliable. A beginner friendly approach is to set up a monitoring system that will notify you quickly in case of problems. Later on, you can look into secondary (slave) nameservers, secondary MX entries, cloning and syncing Mail-in-a-Box machines, and floating IPs. diff --git a/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-email-and-domain-ubuntu1804.png b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-email-and-domain-ubuntu1804.png new file mode 100644 index 00000000000..1580d5f2e27 Binary files /dev/null and b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-email-and-domain-ubuntu1804.png differ diff --git a/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-hostname-ubuntu1804.png b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-hostname-ubuntu1804.png new file mode 100644 index 00000000000..c69c02e28cc Binary files /dev/null and b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-hostname-ubuntu1804.png differ diff --git a/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-timezone-ubuntu1804.png b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-timezone-ubuntu1804.png new file mode 100644 index 00000000000..6c65fc259ad Binary files /dev/null and b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-choose-timezone-ubuntu1804.png differ diff --git a/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-control-panel-system-status-checks-ubuntu1404.png b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-control-panel-system-status-checks-ubuntu1404.png index 93f1ce04647..b40e30cd76a 100644 Binary files a/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-control-panel-system-status-checks-ubuntu1404.png and b/docs/email/how-to-create-an-email-server-with-mail-in-a-box/mail-in-a-box-control-panel-system-status-checks-ubuntu1404.png differ diff --git a/docs/game-servers/install-steamcmd-for-a-steam-game-server/index.md b/docs/game-servers/install-steamcmd-for-a-steam-game-server/index.md index 55867131463..b6a31363bfd 100644 --- a/docs/game-servers/install-steamcmd-for-a-steam-game-server/index.md +++ b/docs/game-servers/install-steamcmd-for-a-steam-game-server/index.md @@ -5,7 +5,6 @@ author: description: 'Install SteamCMD, a command-line version of the Steam client, which works with games that use SteamPipe. Installing SteamCMD is a prerequisite before hosting a Steam title on your own game server.' keywords: ["steam", "steamcmd", "steam cmd", "games", "game server", "steam server", "steampipe"] license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' -modified: 2019-02-01 modified_by: name: Linode published: 2016-02-15 @@ -28,36 +27,41 @@ This guide is intended to get you quickly up and running with SteamCMD on your L This guide is written for a non-root user. Commands that require elevated privileges are prefixed with `sudo`. If you’re not familiar with the `sudo` command, you can check our [Users and Groups](/docs/tools-reference/linux-users-and-groups/) guide. {{< /note >}} -## Before You Install +## Before You Begin 1. Familiarize yourself with our [Getting Started](/docs/getting-started/) guide and complete the steps for setting your Linode's hostname and timezone. -2. Update Your Operating System: +1. Update Your Operating System: **CentOS** sudo yum update - **Debian / Ubuntu** + **Debian, Ubuntu** sudo apt update && sudo apt upgrade +1. [Install the `screen` utility](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/#installing-gnu-screen), which will be used later when running SteamCMD. For more information about how screen works, review the rest of our [Using GNU Screen to Manage Persistent Terminal Sessions](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/) guide. ## Secure Your Game Server Game servers and clients are an especially ripe target for attack. Use our [Securing Your Server](/docs/security/securing-your-server/) guide to: -1. [Add a Steam user account](/docs/security/securing-your-server/#add-a-limited-user-account). Make the username `steam` to coincide with the rest of [Linode's Steam guides](/docs/applications/game-servers/), as well as Valve's official documentation. Be sure to give the `steam` user `sudo` privileges. +1. [Add a limited Linux user](/docs/security/securing-your-server/#add-a-limited-user-account) to your server. Make the username `steam` to coincide with the rest of [Linode's Steam guides](/docs/applications/game-servers/), as well as Valve's official documentation. Be sure to give the `steam` user `sudo` privileges. -2. [Harden SSH access](/docs/security/securing-your-server/#harden-ssh-access). +1. [Harden SSH access](/docs/security/securing-your-server/#harden-ssh-access). -3. [Remove unused network-facing services](/docs/security/securing-your-server/#remove-unused-network-facing-services). +1. [Remove unused network-facing services](/docs/security/securing-your-server/#remove-unused-network-facing-services). -4. If you are using iptables, complete the [Configure a firewall](/docs/security/securing-your-server/#configure-a-firewall) steps **using the rulesets below**. If instead you are using **firewalld**, skip ahead to step 5. +1. If you are using [**iptables**](/docs/security/firewalls/control-network-traffic-with-iptables/) (which is set in Linode's Ubuntu and Debian images by default), follow the [Configure your Firewall Using IPTables](#configure-your-firewall-using-iptables) section. - *IPv4* +1. If instead you are using [**firewalld**](/docs/security/firewalls/introduction-to-firewalld-on-centos/) (as in Linode's CentOS 7 and Fedora images), follow the [Configure your Firewall Using FirewallD](#configure-your-firewall-using-firewalld) section. - {{< file "iptables" >}} +### Configure your Firewall Using IPTables + +1. Create two files named `v4` and `v6` in your home directory to record your IPv4 and IPv6 firewall rules: + + {{< file "~/v4" >}} *filter # Allow all loopback (lo0) traffic and reject traffic @@ -72,8 +76,8 @@ Game servers and clients are an especially ripe target for attack. Use our [Secu -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT # Allow the Steam client. --A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65355 -j ACCEPT --A INPUT -p udp -m udp --sport 4380 --dport 1025:65355 -j ACCEPT +-A INPUT -p udp -m udp --dport 27000:27030 -j ACCEPT +-A INPUT -p udp -m udp --dport 4380 -j ACCEPT # Allow inbound traffic from established connections. # This includes ICMP error returns. @@ -90,15 +94,7 @@ Game servers and clients are an especially ripe target for attack. Use our [Secu COMMIT {{< /file >}} - {{< note >}} -Some Steam games require a few additional rules which can be found in our [Steam game guides](/docs/applications/game-servers/). Steam can also use multiple port ranges for various purposes, but they should only be allowed if your game(s) make use of those services. See [this](https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711) Steam Support page for more information. -{{< /note >}} - - *IPv6* - - Steam currently supports multiplayer play over IPv4 only, so a Steam server only needs basic IPv6 firewall rules, shown below. - - {{< file "iptables" >}} + {{< file "v6" >}} *filter # Allow all loopback (lo0) traffic and reject traffic @@ -119,14 +115,63 @@ Some Steam games require a few additional rules which can be found in our [Steam COMMIT {{< /file >}} -5. If you are using **firewalld** (CentOS 7, Fedora) instead of iptables, **use these rules**. If you are using iptables, do skip this step. + {{< note >}} +Some Steam games require a few additional rules which can be found in our [Steam game guides](/docs/applications/game-servers/). Steam can also use multiple port ranges for various purposes, but they should only be allowed if your game(s) make use of those services. See [this](https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711) Steam Support page for more information. + +Steam currently supports multiplayer play over IPv4 only, so a Steam server only needs basic IPv6 firewall rules, shown below. +{{< /note >}} + +1. Import the rulesets into your firewall to activate them: + + sudo iptables-restore < ~/v4 + sudo ip6tables-restore < ~/v6 + +1. [Install iptables-persistent](/docs/security/firewalls/control-network-traffic-with-iptables/#install-iptables-persistent). If you don't install this software, your firewall rules will not persist through reboots of your Linode. + +1. If iptables-persistent was already installed, reconfigure the package so that it recognizes your new rulesets: + + sudo dpkg-reconfigure iptables-persistent + +1. Confirm that your firewall rules are active: + + sudo iptables -vL + + The output should look similar to: + + Chain INPUT (policy ACCEPT 0 packets, 0 bytes) + pkts bytes target prot opt in out source destination + 0 0 ACCEPT all -- lo any anywhere anywhere + 0 0 REJECT all -- !lo any localhost/8 anywhere reject-with icmp-port-unreachable + 0 0 ACCEPT icmp -- any any anywhere anywhere state NEW icmp echo-request + 0 0 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh + 0 0 ACCEPT udp -- any any anywhere anywhere udp dpts:27000:27030 + 0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:4380 + 0 0 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED + 0 0 LOG all -- any any anywhere anywhere limit: avg 3/min burst 5 LOG level debug prefix "iptables_INPUT_denied: " + 0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable + + Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) + pkts bytes target prot opt in out source destination + 0 0 LOG all -- any any anywhere anywhere limit: avg 3/min burst 5 LOG level debug prefix "iptables_FORWARD_denied: " + 0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable + + Chain OUTPUT (policy ACCEPT 60 packets, 8304 bytes) + pkts bytes target prot opt in out source destination + +1. If you ever import new rules into your firewall in the future, be sure to reconfigure iptables-persistent again afterward: + + sudo dpkg-reconfigure iptables-persistent + +### Configure your Firewall Using FirewallD + +1. Set up your ruleset: sudo firewall-cmd --zone="public" --add-service=ssh --permanent sudo firewall-cmd --zone="public" --add-forward-port=port=27000-27030:proto=udp:toport=1025-65355 --permanent sudo firewall-cmd --zone="public" --add-forward-port=port=4380:proto=udp:toport=1025-65355 --permanent sudo firewall-cmd --reload - Switch on firewalld and verify your ruleset: +1. Switch on firewalld and verify your ruleset: sudo systemctl start firewalld sudo systemctl enable firewalld @@ -134,76 +179,75 @@ COMMIT ## Install SteamCMD -First, install `screen` to run Steam games in a separate session: - -**CentOS 7** +SteamCMD can be installed via your distribution's [package manager](#from-package-repositories-recommended), or through a [manual method](#install-manually). - sudo yum install screen +### From Package Repositories (Recommended) -**Debian / Ubuntu** +Installing via the package manager allows you to more easily download updates and security patches, so we strongly recommend using this method if your distribution includes the SteamCMD package. The package is available for Ubuntu and Debian deployments. - sudo apt-get install screen +- **Ubuntu** + 1. Install the package: -### From Package Repositories (Recommended) + sudo apt-get install steamcmd -Installing via the package manager allows you to more easily download updates and security patches, so we strongly recommend using this method if your distribution includes the SteamCMD package. + 1. Create a symlink to the `steamcmd` executable in a convenient place, such as your home directory: -1. Install the package: + cd ~ + ln -s /usr/games/steamcmd steamcmd - sudo apt-get install steamcmd +- **Debian** - {{< note >}} -On Debian you need to add the `non-free` area of the repository to your sources, because the package is available only there. + 1. Add the `non-free` area to the repositories in your sources list, because the `steamcmd` package is only available from this area. To do so, edit your `/etc/apt/sources.list` file and include `non-free` at the end of each `deb` and `deb-src` line, as in this snippet: -To do so, edit the `/etc/apt/sources.list` file, and include `non-free` at the end of each `deb` and `deb-src` line: + {{< file "/etc/apt/sources.list" >}} +deb http://mirrors.linode.com/debian stretch main non-free +deb-src http://mirrors.linode.com/debian stretch main non-free +... +{{< /file >}} - deb http://mirrors.linode.com/debian stretch main non-free - deb-src http://mirrors.linode.com/debian stretch main non-free - ... + 1. Add the i386 architecture, update your package list, and install `steamcmd`: -Then, add the i386 architecture, update your package list, and install `steamcmd`: + sudo dpkg --add-architecture i386 + sudo apt update + sudo apt-get install steamcmd - sudo dpkg --add-architecture i386 - sudo apt update - sudo apt-get install steamcmd -{{< /note >}} + 1. Create a symlink to the `steamcmd` executable in a convenient place, such as your home directory: -1. Create a symlink to the `steamcmd` executable in a convenient place, such as your home directory: + cd ~ + ln -s /usr/games/steamcmd steamcmd - cd ~ - ln -s /usr/games/steamcmd steamcmd +### Install Manually -### Manually +If your package manager does not include the `steamcmd` package, install it manually: 1. Newly created Linodes use 64-bit Linux operating systems. Since Steam is compiled for i386, install the appropriate libraries. For CentOS, also install `wget`. - **CentOS 7** + - **CentOS 7, Fedora** - sudo yum install glibc.i686 libstdc++.i686 wget + sudo yum install glibc.i686 libstdc++.i686 wget - **Debian / Ubuntu** + - **Debian, Ubuntu** - sudo apt-get install lib32gcc1 + sudo apt-get install lib32gcc1 {{< note >}} Running `dpkg --add-architecture i386` is not necessary at this point. Our Steam game guides add [multiarch support](https://wiki.debian.org/Multiarch/HOWTO) only when a game requires it. {{< /note >}} -2. Create the directory for SteamCMD and change to it: +1. Create the directory for SteamCMD and change to it: mkdir ~/Steam && cd ~/Steam -3. Download the SteamCMD tarball: +1. Download the SteamCMD tarball: wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz -4. Extract the installation and runtime files: +1. Extract the installation and runtime files: tar -xvzf steamcmd_linux.tar.gz -#### Add an Error Fix - +{{< note >}} When running a Steam game, you may encounter the following error: /home/steam/.steam/sdk32/libsteam.so: cannot open shared object file: No such file or directory @@ -213,17 +257,19 @@ The game server will still operate despite this error, and it should be somethin mkdir -p ~/.steam/sdk32/ ln -s ~/Steam/linux32/steamclient.so ~/.steam/sdk32/steamclient.so +{{< /note >}} + ## Run SteamCMD -1. Run the executable in a screen. +1. Run the executable in a screen session: If you have installed SteamCMD from repositories: - screen ./steamcmd + screen ~/.steam/steamcmd If you have installed SteamCMD manually: - screen ./steamcmd.sh + screen ~/Steam/steamcmd.sh That will return an output similar to below and leave you at the `Steam>` prompt: @@ -250,7 +296,7 @@ The game server will still operate despite this error, and it should be somethin Steam> -2. Most Steam game servers allow anonymous logins. You can verify this for your title with Valve's list of [dedicated Linux servers](https://developer.valvesoftware.com/wiki/Dedicated_Servers_List#Linux_Dedicated_Servers). +1. Most Steam game servers allow anonymous logins. You can verify this for your title with Valve's list of [dedicated Linux servers](https://developer.valvesoftware.com/wiki/Dedicated_Servers_List#Linux_Dedicated_Servers). To log in anonymously: @@ -261,14 +307,22 @@ The game server will still operate despite this error, and it should be somethin login example_user {{< caution >}} -Be aware that some versions of the Steam CLI do **not** obfuscate passwords. If you're signing in with your Steam account, be aware of your local screen's security. +Some versions of the Steam CLI do **not** obfuscate passwords. If you're signing in with your Steam account, be aware of your local screen's security. {{< /caution >}} - {{< note >}} -You can exit the `Steam>` prompt at any time by typing `quit`. -{{< /note >}} +## Exit SteamCMD + +### Detach from the Screen Session + +To exit the screen session which contains the Steam process *without* disrupting the Steam process, enter **Control+A** followed by **Control+D** on your keyboard. You can later return to the screen session by entering: + + screen -r + +For more information on managing your screen sessions, review our [Using GNU Screen to Manage Persistent Terminal Sessions](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/) guide. + +### Stop SteamCMD -3. To exit the screen session without disrupting the Steam process, press **CTRL + A** and then **D**. To resume, use the `screen -r` command. For more information, check out our guide on [how to use screen sessions](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions/). +To stop the Steam process and remove your screen session, enter `quit` at the `Steam>` command prompt, or enter **Control+C** on your keyboard. ## Next Steps diff --git a/docs/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/index.md b/docs/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/index.md index d2f6342392e..5332c4abc1b 100644 --- a/docs/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/index.md +++ b/docs/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/index.md @@ -6,15 +6,16 @@ description: 'This Counter Strike: Global Offensive (CS:GO) server guide contain keywords: ["counter strike", "counter strike global offensive", "csgo", "cs:go", "csgo server", "csgo server hosting", " steam servers", "game servers", "games", "ubuntu", "ubuntu 14.04"] license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' published: 2016-02-25 -modified: 2019-02-01 modified_by: name: Linode title: 'Launch a Counter Strike: Global Offensive (CS:GO) server on Ubuntu 14.04' contributor: name: Sam Mauldin -aliases: ['applications/game-servers/csgo-server-debian-ubuntu/','applications/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/'] +aliases: ['applications/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/'] external_resources: - - '[Valve Developer Community - Counter-Strike: Global Offensive Dedicated Servers](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers)' + - '[Valve Developer Community - Counter-Strike: Global Offensive Dedicated Servers](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers)' +deprecated: true +deprecated_link: 'game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-18-04/' dedicated_cpu_link: true --- @@ -164,4 +165,4 @@ These settings are changed in the launch command. ### RCON -When logged into the server, you can open the RCON console with the backtick button (`), or your mapped key. To log in type `rcon_password` followed by your password. For more information regarding RCON, click [here](/docs/game-servers/team-fortress2-on-debian-and-ubuntu/#rcon). +When logged into the server, you can open the RCON console with the backtick button (`` ` ``), or your mapped key. To log in type `rcon_password` followed by your password. For more information regarding RCON, click [here](/docs/game-servers/team-fortress2-on-debian-and-ubuntu/#rcon). diff --git a/docs/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-18-04/index.md b/docs/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-18-04/index.md new file mode 100644 index 00000000000..f09dceecb8e --- /dev/null +++ b/docs/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-18-04/index.md @@ -0,0 +1,158 @@ +--- +author: + name: Linode Community + email: docs@linode.com +description: 'This Counter Strike: Global Offensive (CS:GO) server guide contains instructions on how to install SteamCMD, download the dedicated server, and launch the game server.' +keywords: ["counter strike", "counter strike global offensive", "csgo", "cs:go", "csgo server", "csgo server hosting", " steam servers", "game servers", "games", "ubuntu", "ubuntu 14.04"] +license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' +published: 2019-01-07 +modified_by: + name: Linode +title: 'Launch a Counter Strike: Global Offensive (CS:GO) server on Ubuntu 18.04' +contributor: + name: Linode +aliases: ['applications/game-servers/csgo-server-debian-ubuntu/','applications/game-servers/launch-a-counter-strike-global-offensive-server-on-ubuntu-14-04/'] +external_resources: + - '[Valve Developer Community - Counter-Strike: Global Offensive Dedicated Servers](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers)' +dedicated_cpu_link: true +--- + +[Counter Strike: Global Offensive](http://store.steampowered.com/app/730) (CS:GO) is a first-person shooter by Valve. Hosting your own server gives you full control over your game and game modes, so you can play the exact flavor of CS:GO you want. This guide contains instructions on how to download the dedicated server and launch the game server. + + + +## Before You Begin + +1. [Create a Linode](/docs/getting-started-new-manager/#create-a-linode) running Ubuntu 18.04. + +1. Create a [Steam](http://store.steampowered.com) account if you do not have one, and download [Counter Strike: Global Offensive](http://store.steampowered.com/app/730/) to your computer. + +1. A Steam game server login token (GSLT) is required to host a public CS:GO server. Without the token, client connections are restricted to the LAN only. [Register your GSLT](https://steamcommunity.com/dev/managegameservers) on Steam's website. Enter `730` as the App ID when creating your GSLT. Review [Steam's documentation](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Registering_Game_Server_Login_Token) for more information about GSLTs. + +1. Complete our guide: [Install SteamCMD for a Steam Game Server](/docs/applications/game-servers/install-steamcmd-for-a-steam-game-server). This will get SteamCMD installed and running on your Linode and this guide will pick up where the SteamCMD page leaves off. + + {{< note >}} +This guide is written for a non-root user. Commands that require elevated privileges are prefixed with `sudo`. If you’re not familiar with the `sudo` command, you can check our [Users and Groups](/docs/tools-reference/linux-users-and-groups) guide. +{{< /note >}} + +## Prerequisites for Counter-Strike: Global Offensive + +After following the SteamCMD guide, some firewall modifications are needed specifically for CS:GO: + +1. [Stop the SteamCMD process](/docs/game-servers/install-steamcmd-for-a-steam-game-server/#stop-steamcmd) if it is currently running. + +1. Replace a firewall rule to slightly extend the UDP port range available to the game. This command assumes that you have **only** the iptables rules in place from the SteamCMD guide: + + sudo iptables -R INPUT 5 -p udp -m udp --dport 26900:27030 -j ACCEPT + +1. Reconfigure iptables-persistent to ensure that your new rule persists: + + sudo dpkg-reconfigure iptables-persistent + +## Install Counter Strike: Global Offense + +1. [Run SteamCMD and login to Steam](/docs/game-servers/install-steamcmd-for-a-steam-game-server/#run-steamcmd) inside a screen session. + +1. From the SteamCMD prompt, install CS:GO to the `steam` user's home directory: + + force_install_dir ./csgo-ds + app_update 740 validate + + This can take some time. If the download looks as if it has frozen, be patient. Once the download is complete, you should see this output: + + Success! App '740' fully installed. + + Steam> + +1. Exit SteamCMD: + + quit + + {{< note >}} +To update CS:GO, run the above 4 commands again. +{{< /note >}} + +## Configure the Server + +1. Create a file called `server.cfg` using your preferred text editor with the contents of the following snippet. The location you should save this file to depends on how you installed SteamCMD: + + | SteamCMD Installation Method | File Location | + | ------------------- | ------------- | + | Package manager | `~/.steam/steamcmd/csgo-ds/csgo/cfg/server.cfg` | + | Manual installation | `~/Steam/csgo-ds/csgo/cfg/server.cfg` | + + The value for `hostname` will displayed to users that join your server. Replace the values of `sv_password` and `rcon_password` with two different and unique passwords that you don't use elsewhere. + + {{< file "server.cfg" aconf >}} +hostname "The name of your CS:GO server" +sv_password "server_password" +sv_timeout 60 +rcon_password "rcon_password" +mp_autoteambalance 1 +mp_limitteams 1 +writeid +writeip +{{< /file >}} + + `sv_password` is the password users will need to enter to join the server. `rcon_password` is the [RCON](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol) password, which is used to remotely control the game server from within the game. For an extensive list of `server.cfg` options, see [this page](http://csgodev.com/csgodev-server-cfg-for-csgo/). + +1. Create a startup script for CS:GO with the following snippet. Name the file `startcsgo.sh` and save it to your `steam` user's home directory. Set the value of the `YOUR_GSLT` variable at the top to be your game server login token. Set the value of the `CSGO_INSTALL_LOCATION` variable at the top according to the table below. + + {{< file "~/startcsgo.sh" >}} +#!/bin/sh + +YOUR_GSLT= +CSGO_INSTALL_LOCATION= + +cd $CSGO_INSTALL_LOCATION +screen -S "Counter-Strike: Global Offensive Server" ./srcds_run -game csgo -usercon +game_type 0 +game_mode 1 +mapgroup mg_bomb +map de_dust2 +sv_setsteamaccount $YOUR_GSLT -net_port_try 1 +{{< /file >}} + + | SteamCMD Installation Method | CSGO_INSTALL_LOCATION | + | ------------------- | ------------- | + | Package manager | `~/.steam/steamcmd/csgo-ds/` | + | Manual installation | `~/Steam/csgo-ds/` | + + When run, the script will execute a Dust2 server in competitive game mode in a [screen session](/docs/networking/ssh/using-gnu-screen-to-manage-persistent-terminal-sessions). For more startup modes and game options, see Valve's [CS:GO wiki](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server). + +1. Make the script executable: + + chmod +x ~/startcsgo.sh + +## Start the Server + +1. Now that your server is installed and configured, it can be launched by running the `startcsgo.sh` script from your `steam` user's home directory. + + cd ~ && ./startcsgo.sh + +1. Review instructions for [detaching from or stopping SteamCMD](/docs/game-servers/install-steamcmd-for-a-steam-game-server/#exit-steamcmd) to exit the CS:GO server. + +## Join the Game + +1. Launch Counter-Strike: Global Offensive. + +1. Once launched, go to **Play** and click **Browse Community Servers**. + +1. Click on the **Favorites** tab and then click **Add a Server** at the bottom. + +1. Type in the IP address of your Linode and click **Add this address to favorites**. + +1. You'll see your new Counter-Strike: Global Offensive server. Click **Connect** at the bottom right and start fragging away. + +## Game Settings + +### Game Modes and Types + +You can change the game type and mode options to start different types of servers: + + Mode game_mode game_type + Classic Casual 0 0 + Classic Competitive 0 1 + Arms Race 1 0 + Demolition 1 1 + +These settings are changed in the launch command. + +### RCON + +When logged into the server, you can open the RCON console with the backtick button (`` ` ``), or your mapped key. To log in type `rcon_password` followed by your password. For more information regarding RCON, click [here](/docs/game-servers/team-fortress2-on-debian-and-ubuntu/#rcon). \ No newline at end of file diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md index 3898b8c20c2..4f798db3302 100644 --- a/docs/getting-started/index.md +++ b/docs/getting-started/index.md @@ -61,8 +61,6 @@ Use a [StackScript](http://www.linode.com/stackscripts) to quickly deploy softwa 1. Give your Linode a label. This is a name to help you easily identify it within the Cloud Manager's Dashboard. If desired, assign a tag to the Linode in the **Add Tags** field. -1. Create a strong password for your Linode. You will use this password to SSH into your Linode. - 1. Create a root password for your Linode in the **Root Password** field. This password must be provided when you log in to your Linode via SSH. It must be at least 6 characters long and contain characters from two of the following categories: - lowercase and uppercase case letters diff --git a/docs/platform/api/getting-started-with-the-linode-api-classic-manager/index.md b/docs/platform/api/getting-started-with-the-linode-api-classic-manager/index.md index 4f6a8683c73..f42cd96eaff 100644 --- a/docs/platform/api/getting-started-with-the-linode-api-classic-manager/index.md +++ b/docs/platform/api/getting-started-with-the-linode-api-classic-manager/index.md @@ -12,7 +12,7 @@ modified_by: published: 2018-04-03 title: Getting Started with the Linode API external_resources: - - '[API Documentation](https://developers.linode.com/v4/introduction)' + - '[API Documentation](https://developers.linode.com/api/v4/)' - '[Linode CLI](https://github.com/linode/linode-cli)' - '[Linode API Python Library](https://github.com/linode/python-linode-api)' cloud_manager_link: platform/api/getting-started-with-the-linode-api/ @@ -35,10 +35,10 @@ This guide will help you get set up to run this example. Note that if you run th Only authorized users can add Linodes and make changes to your account, and each request must be authenticated with an access token. -The easiest way to get a token is through the [beta Linode Manager](https://cloud.linode.com). +The easiest way to get a token is through the [Linode Cloud Manager](https://cloud.linode.com). {{< note >}} -If you are building an application which will need to authenticate multiple users (for example, a custom interface to Linode's infrastructure for your organization), you can set up an [OAuth authentication flow](https://developers.linode.com/v4/access) to generate tokens for each user. +If you are building an application which will need to authenticate multiple users (for example, a custom interface to Linode's infrastructure for your organization), you can set up an [OAuth authentication flow](https://developers.linode.com/api/v4/) to generate tokens for each user. {{< /note >}} ### Create an API Token @@ -133,7 +133,7 @@ If you prefer a smaller number of items per page, you can override the default v ### Filter Results -The API also supports filtering lists of results. Filters are passed using the `X-Filter` header and use JSON format. You can filter on almost any field that appears in a response object and the [API documentation](https://developers.linode.com/v4/introduction) specifies which fields are filterable. +The API also supports filtering lists of results. Filters are passed using the `X-Filter` header and use JSON format. You can filter on almost any field that appears in a response object and the [API documentation](https://developers.linode.com/api/v4/) specifies which fields are filterable. The following query uses the `deprecated` and `vendor` fields to return all current Debian images: @@ -177,4 +177,4 @@ More complex searches are possible through the use of logical operators. Use `or curl https://api.linode.com/v4/images/ -H "{"+or": [{"vendor":"Debian"}, {"vendor":"Ubuntu"}]}" -See the [Linode API documentation](https://developers.linode.com/v4/filtering) for a full list of supported operators. +See the [Linode API documentation](https://developers.linode.com/api/v4/) for a full list of supported operators. diff --git a/docs/platform/api/getting-started-with-the-linode-api/index.md b/docs/platform/api/getting-started-with-the-linode-api/index.md index 95dc8edfa63..62fbe1db056 100644 --- a/docs/platform/api/getting-started-with-the-linode-api/index.md +++ b/docs/platform/api/getting-started-with-the-linode-api/index.md @@ -12,7 +12,7 @@ modified_by: published: 2018-04-03 title: Getting Started with the Linode API external_resources: - - '[API Documentation](https://developers.linode.com/v4/introduction)' + - '[API Documentation](https://developers.linode.com/api/v4/introduction)' - '[Linode CLI](https://github.com/linode/linode-cli)' - '[Linode API Python Library](https://github.com/linode/python-linode-api)' aliases: ['platform/api/getting-started-with-the-linode-api-new-manager/'] @@ -38,22 +38,22 @@ Only authorized users can add Linodes and make changes to your account, and each The easiest way to get a token is through the [Cloud Manager](https://cloud.linode.com). {{< note >}} -If you are building an application which will need to authenticate multiple users (for example, a custom interface to Linode's infrastructure for your organization), you can set up an [OAuth authentication flow](https://developers.linode.com/v4/access) to generate tokens for each user. +If you are building an application which will need to authenticate multiple users (for example, a custom interface to Linode's infrastructure for your organization), you can set up an [OAuth authentication flow](https://developers.linode.com/api/v4/) to generate tokens for each user. {{< /note >}} ### Create an API Token 1. Log in to the Cloud Manager. -1. Click on your username at the top of the screen and select **My Profile**. +2. Click on your username at the top of the screen and select **My Profile**. ![Select My Profile.](get-started-with-linode-api-select-my-profile.png "Select My Profile.") -1. Select the **API Tokens** tab: +3. Select the **API Tokens** tab: ![Select API Tokens tab in My Profile Settings.](get-started-with-linode-api-my-profile-small.png "Select the API Tokens tab in My Profile Settings.") -1. Click on **Add a Personal Access Token** and choose the access rights you want users authenticated with the new token to have. +4. Click on **Add a Personal Access Token** and choose the access rights you want users authenticated with the new token to have. ![Add a Personal Access Token](get-started-with-linode-api-new-token.png "Add a Personal Access Token") @@ -143,7 +143,7 @@ If you prefer a smaller number of items per page, you can override the default v ### Filter Results -The API also supports filtering lists of results. Filters are passed using the `X-Filter` header and use JSON format. You can filter on almost any field that appears in a response object and the [API documentation](https://developers.linode.com/v4/introduction) specifies which fields are filterable. +The API also supports filtering lists of results. Filters are passed using the `X-Filter` header and use JSON format. You can filter on almost any field that appears in a response object and the [API documentation](https://developers.linode.com/api/v4/) specifies which fields are filterable. The following query uses the `deprecated` and `vendor` fields to return all current Debian images: @@ -187,4 +187,4 @@ More complex searches are possible through the use of logical operators. Use `or curl https://api.linode.com/v4/images/ -H "{"+or": [{"vendor":"Debian"}, {"vendor":"Ubuntu"}]}" -See the [Linode API documentation](https://developers.linode.com/v4/filtering) for a full list of supported operators. +See the [Linode API documentation](https://developers.linode.com/api/v4/) for a full list of supported operators. diff --git a/docs/platform/billing-and-support/network-transfer-quota/index.md b/docs/platform/billing-and-support/network-transfer-quota/index.md index f08d3a32cb5..af2e0be5cb6 100644 --- a/docs/platform/billing-and-support/network-transfer-quota/index.md +++ b/docs/platform/billing-and-support/network-transfer-quota/index.md @@ -39,6 +39,10 @@ The transfer quota only considers traffic on your Linodes' public addresses. Tra All inbound traffic to your Linodes is free and will not count against your quota--only traffic that your Linodes emit on their public addresses is counted. +{{< note >}} +Linode does not offer private IPv6 address allocations. Our IPv6 accounting was designed so that local IPv6 traffic does not count against your transfer quota, so you can use your default IPv6 address as if it were a private IP address. +{{}} + ## Transfer Resets, Proration, and Overages Your transfer quota is reset at the beginning of each month. diff --git a/docs/platform/block-storage/how-to-use-block-storage-with-your-linode/index.md b/docs/platform/block-storage/how-to-use-block-storage-with-your-linode/index.md index cc3fbb4c7d0..19228df1c60 100644 --- a/docs/platform/block-storage/how-to-use-block-storage-with-your-linode/index.md +++ b/docs/platform/block-storage/how-to-use-block-storage-with-your-linode/index.md @@ -70,6 +70,19 @@ There is currently a soft limit of 100 TB of Block Storage Volume per account. FILE_SYSTEM_PATH /mnt/BlockStorage1 ext4 defaults 0 2 + + {{< note >}} +If you plan on detaching the volume regularly or moving it between other Linodes, you may want to consider adding the flags `noatime` and `nofail` to the **/etc/fstab** entry. + +* `noatime` - This will save space and time by preventing writes made to the filesystem for data being read on the volume. +* `nofail` - If the volume is not attached, this will allow your server to boot/reboot normally without hanging at dependency failures if the volume is not attached. + +Example: + + FILE_SYSTEM_PATH /mnt/BlockStorage1 ext4 defaults,noatime,nofail 0 2 + + {{}} + ### Attach a Volume from Your Account's Volume List 1. Click on the **Volumes** link in the sidebar to see your account's Volume list: @@ -172,11 +185,15 @@ Storage Volumes **cannot** be sized down, only up. Keep this in mind when sizing umount /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1 -1. Assuming you have an ext2, ext3, or ext4 partition, resize it to fill the new Volume size: +1. Assuming you have an ext2, ext3, or ext4 partition,first run a file system check: + + e2fsck -f /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1 + +1. Then resize it to fill the new Volume size: resize2fs /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1 -1. Mount it back onto the filesystem: +1. Mount your volume back onto the filesystem: mount /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1 /mnt/BlockStorage1 diff --git a/docs/platform/disk-images/clone-your-linode-classic-manager/index.md b/docs/platform/disk-images/clone-your-linode-classic-manager/index.md index ba9bd460bfb..fa8af84a36f 100644 --- a/docs/platform/disk-images/clone-your-linode-classic-manager/index.md +++ b/docs/platform/disk-images/clone-your-linode-classic-manager/index.md @@ -25,19 +25,19 @@ To follow the steps in this guide, you will need a Linode with enough free stora ## Clone Your Linode -1. Log in to the [Linode Manager](https://manager.linode.com). -2. Select the **Linodes** tab to list your active Linodes. -3. Click on the Linode you wish to clone. This will load its Dashboard. -4. **Recommended:** Click **Shut down** to power down the Linode. This is recommended to prevent data corruption. -5. Click the **Clone** tab to select the disks or configuration profiles you wish to clone. If you select a configuration profile, all of the disks attached to it will be included automatically. You can confirm this from the *Disks Attached* column. +1. Log in to the [Linode Manager](https://manager.linode.com). +2. Select the **Linodes** tab to list your active Linodes. +3. Click on the Linode you wish to clone. This will load its Dashboard. +4. **Recommended:** Click **Shut down** to power down the Linode. This is recommended to prevent data corruption. +5. Click the **Clone** tab to select the disks or configuration profiles you wish to clone. If you select a configuration profile, all of the disks attached to it will be included automatically. You can confirm this from the *Disks Attached* column. [![Selecting configuration profiles and disks to migrate](clone-tab-small.png)](clone-tab.png "Selecting configuration profiles and disks to migrate") -6. Once you've applied your choices, hit **Select**. You'll be provided with an approximate estimate of how long it will take to clone your Linode: +6. Once you've applied your choices, hit **Select**. You'll be provided with an approximate estimate of how long it will take to clone your Linode: [![Clone summary page](clone-tab-destination-small.png)](clone-tab-destination.png "Clone summary page") -7. From the **Destination Linode** menu, select the Linode you want to clone to. -8. Click **Clone**. The receiving Linode's Dashboard will appear. Watch the *Host Job Queue* to monitor your progress. +7. From the **Destination Linode** menu, select the Linode you want to clone to. +8. Click **Clone**. The receiving Linode's Dashboard will appear. Watch the *Host Job Queue* to monitor your progress. Once the cloning process completes, your selected disks and configuration profiles will be available on the destination Linode. diff --git a/docs/platform/disk-images/clone-your-linode/index.md b/docs/platform/disk-images/clone-your-linode/index.md index 27acbefa0d7..8b216f37209 100644 --- a/docs/platform/disk-images/clone-your-linode/index.md +++ b/docs/platform/disk-images/clone-your-linode/index.md @@ -19,30 +19,32 @@ This guide will show you how to clone one of your Linode’s existing [disks and ## Clone Your Linode -1. Log in to the [Linode Cloud Manager](https://cloud.linode.com). +1. Log in to the [Linode Cloud Manager](https://cloud.linode.com). -1. **Recommended**: Power off the Linode you would like to clone. This is recommended to prevent data corruption. +1. **Recommended**: Power off the Linode you would like to clone. This is recommended to prevent data corruption. -1. Click **Create** at the top of the Cloud Manager and select **Linode**. +1. Click **Create** at the top of the Cloud Manager and select **Linode**. -1. In the **Create New Linode** form, click on the **Clone from Existing** tab: +1. In the **Create New Linode** form, click on the **Clone from Existing** tab: - ![Select the 'Clone from Existing' tab to clone an existing Linode.](clone-linode-menu.png) + ![Select the 'Clone from Existing' tab to clone an existing Linode.](clone-linode-menu.png) -1. Under **Select Linode to Clone From**, click on the Linode you wish to clone. +1. Under **Select Linode to Clone From**,click on the Linode you wish to clone. -1. Select the region for the clone. +1. Select the region and plan for the clone. -1. Select the plan for the clone. - - {{< note >}} + {{< note >}} You will not be able to choose a plan for your clone that is smaller than the plan of the Linode you are cloning. For example, a 2GB Linode can not be cloned into a 1GB Nanode. {{}} -1. Provide a label for your new Linode. +1. Provide a label for your new Linode. + +1. Click **Create**. -1. Click **Create**. +1. The cloning process will begin. Depending on the size of your Linode, it may take some time. You will see a status bar above the Linode you cloned with the percentage of completion. -1. The cloning process will begin. Depending on the size of your Linode, it may take some time. You will see a status bar above the Linode you cloned with the percentage of completion. +1. While your Linode is being cloned, your new clone will appear on the Linodes page in a powered off state. Once the cloning process is complete you will need to manually power on your new Linode. -1. While your Linode is being cloned, your new clone will appear on the Linodes page in a powered off state. Once the cloning process is complete you will need to manually power on your new Linode. + {{< note >}} +You may want to swap your IP address from the Linode you originally created to your cloned Linode in order to have your clone function over the network without making any configuration changes. To complete this, you'd just need to follow this [guide](/docs/platform/manager/remote-access/#swapping-ip-addresses). +{{}}" \ No newline at end of file diff --git a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-config.png b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-config.png index 90b7c667dba..4b29e977a1b 100644 Binary files a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-config.png and b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-config.png differ diff --git a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-disk-image.png b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-disk-image.png index 6c146f02f33..b2eb42028a4 100644 Binary files a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-disk-image.png and b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-a-disk-image.png differ diff --git a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-blank-disk.png b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-blank-disk.png index d9bafc04966..9992458b7a5 100644 Binary files a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-blank-disk.png and b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-add-blank-disk.png differ diff --git a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-advanced-options.png b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-advanced-options.png index e348868cf61..e24bfa2d42c 100644 Binary files a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-advanced-options.png and b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-advanced-options.png differ diff --git a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-boot-this-config.png b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-boot-this-config.png index e7ea2d84ed0..ed48c497e9c 100644 Binary files a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-boot-this-config.png and b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-boot-this-config.png differ diff --git a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-resize-a-disk.png b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-resize-a-disk.png index a7cd285ac7e..e4937070e36 100644 Binary files a/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-resize-a-disk.png and b/docs/platform/disk-images/disk-images-and-configuration-profiles/disks-and-config-profiles-resize-a-disk.png differ diff --git a/docs/platform/disk-images/disk-images-and-configuration-profiles/index.md b/docs/platform/disk-images/disk-images-and-configuration-profiles/index.md index 4a5fd42b5dc..607cc9db41a 100644 --- a/docs/platform/disk-images/disk-images-and-configuration-profiles/index.md +++ b/docs/platform/disk-images/disk-images-and-configuration-profiles/index.md @@ -30,7 +30,7 @@ The Linode Cloud Manager automatically creates a disk and configuration profile ### Finding Your Way Around -All of a Linode's disks and configuration profiles are displayed on the Linode's detail page, under the **Settings** tab, in the **Advanced Configurations** panel. You can add, edit, and remove items from this page, as shown below. +All of a Linode's disks and configuration profiles are displayed on the Linode's detail page, under the **Advanced**. [![Overview of Linode Manager interface.](disks-and-config-profiles-advanced-options.png)](disks-and-config-profiles-advanced-options.png) @@ -55,7 +55,7 @@ The Linode Cloud Manager makes it easy to create a new disk with a fresh Linux d 1. Log in to the [Linode Cloud Manager](https://cloud.linode.com). 2. Click the **Linodes** link in the sidebar. 3. Select a Linode. The Linode's detail page appears. -4. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +4. Click on the **Advanced** tab. 5. Click on **Add a Disk**. The **Add Disk** form appears: [![The 'Add Disk' menu.](disks-and-config-profiles-add-a-disk-image.png)](disks-and-config-profiles-add-a-disk-image.png) @@ -76,7 +76,7 @@ Create a blank disk if you need detachable storage space or want to download and 1. Log in to the [Linode Cloud Manager](https://cloud.linode.com). 1. Click the **Linodes** link in the sidebar. 1. Select a Linode. The Linode's detail page appears. -2. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +2. Click on the **Advanced** tab. 3. Click on **Add a Disk**. The **Add Disk** form appears: [![The 'Add Disk' menu.](disks-and-config-profiles-add-blank-disk.png)](disks-and-config-profiles-add-blank-disk.png) @@ -100,7 +100,7 @@ Resizing a disk requires you to power your Linode off, if it is currently in use 2. Click the **Linodes** link in the sidebar. 3. Select a Linode. The Linode's detail page appears. 4. Select **Power Off** from the status dropdown menu to turn your Linode off. Monitor the progress bar at the top of the page for confirmation that your Linode has powered off. -5. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +5. Click on the **Advanced** tab. 6. Click the **more options ellipsis** for the disk you would like to resize, and select **Resize**. The **Resize Disk** form appears. [![Resize a disk.](disks-and-config-profiles-resize-a-disk.png)](disks-and-config-profiles-resize-a-disk.png) @@ -141,7 +141,7 @@ Removing a disk is permanent and cannot be undone. 2. Click the **Linodes** link in the sidebar. 3. Select a Linode. The Linode's detail page appears. 4. Click **Power Off** from the status menu to turn your Linode off. Monitor the progress bar at the top of the page for confirmation that your Linode has powered off. -5. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +5. Click on the **Advanced** tab. 6. Click on the **more options ellipsis** next to the disk you would like to delete and select **Delete**. Monitor your bell notifications for updates on the deletion of your disk. 7. Click **Power On** from the status menu to turn on the Linode. @@ -158,7 +158,7 @@ Making a new configuration profile allows you to create a new and separate boot 1. Log in to the [Linode Cloud Manager](https://cloud.linode.com). 2. Click the **Linodes** link from the sidebar. 3. Select a Linode. The Linode's detail page appears. -4. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +4. Click on the **Advanced** tab. 5. Select the **Add a Configuration** link. The **Add Linode Configuration** form appears: [![The Add Linode Configuration menu.](disks-and-config-profiles-add-a-config.png)](disks-and-config-profiles-add-a-config.png) @@ -183,7 +183,7 @@ You can edit existing configuration profiles to change boot settings, set other 1. Log in to the [Linode Cloud Manager](https://cloud.linode.com). 2. Click the **Linodes** link from the sidebar. 3. Select a Linode. The Linode's detail page appears. -4. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +4. Click on the **Advanced** tab. 5. Click the configuration profile's **more options ellipsis** and select **Edit**. The **Edit Linode Configuration** form appears. 6. Edit the settings as necessary. 7. When finished, click **Submit**. @@ -197,7 +197,7 @@ You can create and store many different configuration profiles in the Linode Man 1. Log in to the [Linode Cloud Manager](https://cloud.linode.com). 2. Click the **Linodes** link from the sidebar. 3. Select a Linode. The Linode's detail page appears. -4. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +4. Click on the **Advanced** tab. 5. Click the more options ellipsis for the configuration profile you would like to boot from: [![Selecting a configuration profile](disks-and-config-profiles-boot-this-config.png)](disks-and-config-profiles-boot-this-config.png) @@ -213,7 +213,7 @@ You can remove a configuration profile from the Linode Cloud Manager at any time 1. Log in to the [Linode Cloud Manager](https://manager.linode.com). 2. Click the **Linodes** link from the sidebar. 3. Select a Linode. The Linode's detail page appears. -4. Click on the **Settings** tab and expand the **Advanced Configurations** panel. +4. Click on the **Advanced** tab. 5. Click the **more options ellipsis** for the configuration profile you would like to remove. 6. Select the **Delete** option from the dropdown menu that appears. diff --git a/docs/platform/disk-images/linode-images-classic-manager/index.md b/docs/platform/disk-images/linode-images-classic-manager/index.md index 08fe4007b8b..7e93b750ea1 100644 --- a/docs/platform/disk-images/linode-images-classic-manager/index.md +++ b/docs/platform/disk-images/linode-images-classic-manager/index.md @@ -45,7 +45,8 @@ While an image can be captured while your Linode is running, we would recommend [![Host Job Queue](host-job-queue.png)](host-job-queue.png) {{< note >}} -Linode Images are limited to 2048MB of data per disk. You will need to ensure that data within your disk does not exceed this size limit. +Linode Images are limited to 2048MB of data per disk. You will need to ensure that data within your disk does not exceed this size limit. Additionally, Linode Images cannot be created if you are using raw disks or disks that have been formatted using custom filesystems. + {{< /note >}} Once the job in the host queue has completed, your Linode's disk has been captured and stored. diff --git a/docs/platform/disk-images/linode-images/index.md b/docs/platform/disk-images/linode-images/index.md index 6c220f26266..9b2c987e26b 100644 --- a/docs/platform/disk-images/linode-images/index.md +++ b/docs/platform/disk-images/linode-images/index.md @@ -16,7 +16,7 @@ classic_manager_link: platform/disk-images/linode-images-classic-manager/ ![Linode Images](linode-images.jpg) -*Linode Images* allows you to take snapshots of your disks, and then deploy them to any Linode under your account. This can be useful for bootstrapping a master image for a large deployment, or retaining a disk for a configuration that you may not need running, but wish to return to in the future. Linode Images will be retained whether or not you have an active Linode on your account, which also makes them useful for long term storage of a private template that you may need in the future. There is no additional charge to store Images for Linode users, with a limit of 2GB per Image and 3 Images per account. +*Linode Images* allows you to take snapshots of your disks, and then deploy them to any Linode under your account. This can be useful for bootstrapping a master image for a large deployment, or retaining a disk for a configuration that you may not need running, but wish to return to in the future. Linode Images will be retained whether or not you have an active Linode on your account, which also makes them useful for long term storage of a private template that you may need in the future. There is no additional charge to store Images for Linode users. Images are limited to 2GB per Image and 3 Images per account. Additionally, images can only be created on disks with ext3 or ext4 filesystems with a single partition. {{< note >}} When saving a Linode image, it is the aspects of the Linode that are on the **disk** that are saved, not any additional aspects such as IP addresses, fully qualified domain names, and MAC addresses. @@ -43,8 +43,7 @@ While an image can be captured while your Linode is running, we would recommend ![Image creation status under the bell notifications.](images-image-being-created.png "Image creation status under the bell notifications.") {{< note >}} -Linode Images are limited to 2048MB of data per disk. You will need to ensure that data within your disk does not exceed this size limit. -{{< /note >}} +Linode Images are limited to 2048MB of data per disk. You will need to ensure that data within your disk does not exceed this size limit. Additionally, Linode Images cannot be created if you are using raw disks or disks that have been formatted using custom filesystems. {{< /note >}} Once the job has completed, your Linode's disk has been captured and stored. diff --git a/docs/platform/tokyo2-migration/index.md b/docs/platform/tokyo2-migration/index.md index 2f6308af8e0..df9c377551d 100644 --- a/docs/platform/tokyo2-migration/index.md +++ b/docs/platform/tokyo2-migration/index.md @@ -25,7 +25,7 @@ The Tokyo 2 data center provides access to features that are not available in To ## When will My Linodes be Migrated? -The [Linode Classic Manager](https://http://manager.linode.com) will display the scheduled dates and times for the migrations of your Tokyo 1 Linodes. If you visit the Classic Manager before this schedule is set by Linode, the information will not be displayed. +The [Linode Classic Manager](https://manager.linode.com) will display the scheduled dates and times for the migrations of your Tokyo 1 Linodes. If you visit the Classic Manager before this schedule is set by Linode, the information will not be displayed. When your migration schedule first becomes visible in the Classic Manager, you will receive a support ticket from Linode to let you know. This ticket will be sent to you at least two months in advance of the start of your first migration. Your different Linodes will be scheduled to migrate on different dates and times. **Linode will not be able to adjust this schedule of migrations.** @@ -143,4 +143,4 @@ Having a short TTL means that your users will be directed to your new IP address ## Contact Linode Support -If you have any issues when migrating or cloning to Tokyo 2, or if you have any questions about this process, please [contact Linode Support](/docs/platform/billing-and-support/support/#contacting-linode-support). Technical questions about your Linux deployment's configuration are often outside the scope of support. For any out-of-scope issues, we also recommend searching and asking technical questions in the [Linode Community Site](/community/questions/). \ No newline at end of file +If you have any issues when migrating or cloning to Tokyo 2, or if you have any questions about this process, please [contact Linode Support](/docs/platform/billing-and-support/support/#contacting-linode-support). Technical questions about your Linux deployment's configuration are often outside the scope of support. For any out-of-scope issues, we also recommend searching and asking technical questions in the [Linode Community Site](/community/questions/). diff --git a/docs/security/upgrading/upgrade-to-ubuntu-18-04/index.md b/docs/security/upgrading/upgrade-to-ubuntu-18-04/index.md index 08f06fa5123..65fa86ae9a5 100644 --- a/docs/security/upgrading/upgrade-to-ubuntu-18-04/index.md +++ b/docs/security/upgrading/upgrade-to-ubuntu-18-04/index.md @@ -103,13 +103,13 @@ Prompt=lts {{< /file >}} -3. You're now ready to begin the upgrade to Ubuntu 18.04 LTS. Since Ubuntu encourages upgrades for LTS distributions to `.1` (like `18.04.1`), use the `-d` option to force it to recognize the new version: +1. You're now ready to begin the upgrade to Ubuntu 18.04 LTS. - do-release-upgrade -d + do-release-upgrade Follow the on-screen instructions to complete the installation process. -4. Because Linode offers internal package mirrors for Ubuntu, you may see some combination of the following messages: +2. Because Linode offers internal package mirrors for Ubuntu, you may see some combination of the following messages: * **No valid mirror found** diff --git a/docs/tools-reference/custom-kernels-distros/install-nixos-on-linode/index.md b/docs/tools-reference/custom-kernels-distros/install-nixos-on-linode/index.md index 218e49b55f3..deae533603e 100644 --- a/docs/tools-reference/custom-kernels-distros/install-nixos-on-linode/index.md +++ b/docs/tools-reference/custom-kernels-distros/install-nixos-on-linode/index.md @@ -8,7 +8,7 @@ keywords: ["custom distro", "NixOS", "advanced Linux", "kvm"] license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' modified_by: name: Andrew Miller -modified: 2018-10-29 +modified: 2019-04-25 title: Install and Configure NixOS on a Linode external_resources: - '[NixOS](https://nixos.org/nixos/manual/)' @@ -64,7 +64,7 @@ The [NixOS manual](https://nixos.org/nixos/manual/) is the main reference for Ni In your browser, navigate to the [NixOS download page](https://nixos.org/nixos/download.html) and copy the URL from the **Minimal installation CD, 64-bit Intel/AMD** link. -[Boot your Linode into rescue mode](/docs/troubleshooting/rescue-and-rebuild#booting-into-rescue-mode) with the installer disk mounted as `/dev/sda`. Once in rescue mode, run the following command, replacing the URL with the latest 64-bit minimal installation image copied from the [NixOS download page](https://nixos.org/nixos/download.html). This example installs NixOS 18.09: +[Boot your Linode into rescue mode](/docs/troubleshooting/rescue-and-rebuild#booting-into-rescue-mode) with the installer disk mounted as `/dev/sda`. Once in rescue mode, run the following command, replacing the URL with the latest 64-bit minimal installation image copied from the [NixOS download page](https://nixos.org/nixos/download.html). This example installs NixOS 19.03: # Bind the URL you grabbed from the download page to a bash variable iso= diff --git a/docs/tools-reference/tools/find-files-in-linux-using-the-command-line/find-files-title.jpg b/docs/tools-reference/tools/find-files-in-linux-using-the-command-line/find-files-title.jpg index 359a2dcf5d6..920d03bb6c4 100644 Binary files a/docs/tools-reference/tools/find-files-in-linux-using-the-command-line/find-files-title.jpg and b/docs/tools-reference/tools/find-files-in-linux-using-the-command-line/find-files-title.jpg differ diff --git a/docs/web-servers/lemp/how-to-install-a-lemp-server-on-ubuntu-18-04/index.md b/docs/web-servers/lemp/how-to-install-a-lemp-server-on-ubuntu-18-04/index.md index e68fe0ea8d1..ea5403c78e2 100644 --- a/docs/web-servers/lemp/how-to-install-a-lemp-server-on-ubuntu-18-04/index.md +++ b/docs/web-servers/lemp/how-to-install-a-lemp-server-on-ubuntu-18-04/index.md @@ -133,7 +133,7 @@ server { - NGINX is listening on port `80` for incoming connections to `example.com` or `www.example.com`. - - The site is served out of `/var/www/html/example.com/public_html` and its index page (`index.html`) is a simple `.html` file. If your index page will use PHP like WordPress does, substitute `index.html` for `index.php`. + - The site is served out of `/var/www/html/example.com/public_html` and its index page (`index.html`) is a simple `.html` file. **If your index page will use PHP like WordPress does, substitute `index.html` for `index.php`.** - `try_files` tells NGINX to verify that a requested file or directory [actually exists](https://nginx.org/en/docs/http/ngx_http_core_module.html#try_files) in the site's root filesystem before further processing the request. If it does not, a `404` is returned. diff --git a/docs/web-servers/nginx/install-nginx-ubuntu/index.md b/docs/web-servers/nginx/install-nginx-ubuntu/index.md index a35fe7d3e07..98480be13b1 100644 --- a/docs/web-servers/nginx/install-nginx-ubuntu/index.md +++ b/docs/web-servers/nginx/install-nginx-ubuntu/index.md @@ -32,42 +32,36 @@ Currently, the best way to install NGINX on Ubuntu 18.04 is to use the version i ### Add Basic Site -NGINX site-specific configuration files are kept in `/etc/nginx/conf.d/`. Generally you will want a separate file in this directory for each domain or subdomain you will be hosting. +NGINX site-specific configuration files are kept in `/etc/nginx/sites-available` and symlinked into `/etc/nginx/sites-enabled/`. Generally you will want to create a separate original file in the `sites-available` directory for each domain or subdomain you will be hosting, and then set up a symlink in the `sites-enabled` directory. 1. Copy the default configuration file. Replace `example.com` with your website's domain name or your Linode's public IP address. - sudo cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/example.com.conf + sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com -2. Disable the default configuration file by adding `.disabled` to the filename: +2. Disable the default configuration file by removing the symlink in `/etc/nginx/sites-enabled/`: - sudo mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.disabled + unlink /etc/nginx/sites-enabled/default 3. Open your site's configuration file in a text editor. Replace `example.com` in the `server_name` directive with your site's domain name or IP address. If you already have content ready to serve (such as a WordPress installation or static files) replace the path in the `root` directive with the path to your site's content: - {{< file "/etc/nginx/conf.d/example.com.conf" nginx >}} + {{< file "/etc/nginx/sites-available/example.com" nginx >}} server { listen 80; - server_name example.com; + server_name example.com - #charset koi8-r; - #access_log /var/log/nginx/host.access.log main; + root /var/www/example.com; + index index.html; - location / { - root /usr/share/nginx/html; - index index.html index.htm; - } - - #error_page 404 /404.html; - - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } + location / { + try_files $uri $uri/ =404; + } } {{< /file >}} +4. Set up a new symlink to the `/etc/nginx/sites-enabled/` directory to enable your configuration: + + sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/ + ### Test NGINX 1. Test your configuration for errors: