Linux VPS Core Getting Started Guide

Published on March 2017 | Categories: Documents | Downloads: 34 | Comments: 0 | Views: 228
of 15
Download PDF   Embed   Report

Comments

Content

Linux VPS Core Getting Started Guide

First Edition April 2011

Linux VPS Core Getting Started Guide

Table of Contents
Introduction ................................................................................................................................................................. 1 Connecting to Your Linux VPS Core Server ............................................................................................................ 2 Shell (SSH) ................................................................................................................................................................. 2 TempDomain Name .................................................................................................................................................... 2 Package Update Options ............................................................................................................................................. 3 Configuring Users ........................................................................................................................................................ 5 Adding Users .............................................................................................................................................................. 5 Lock/Unlock User Accounts ....................................................................................................................................... 6 Removing Users.......................................................................................................................................................... 7 Configuring Email ....................................................................................................................................................... 8 Virtual User Tables ..................................................................................................................................................... 8 Aliases ........................................................................................................................................................................ 9 Configuring Virtual Hosts ........................................................................................................................................ 10 Adding a Virtual Host ............................................................................................................................................... 10 Removing a Virtual Host .......................................................................................................................................... 11 Installing Webmin ..................................................................................................................................................... 12 Notices......................................................................................................................................................................... 13

Table of Contents

ii

Linux VPS Core Getting Started Guide

Introduction
This document provides information to help you quickly get started using your Linux VPS Core server. It will help you setup users, email, and virtual hosts and install a control panel. It will also guide you through the basics of managing your server using the SSH command line. If you prefer to not use the command line, most administration tasks can be completed using a third party control panel such as Webmin. Instructions for installing Webmin are included in this document. For more detailed information on the administration of your Linux VPS Core server, please see the Linux VPS Core User Guide. In addition to this introduction, this document includes the following sections:  “Connecting to Your Linux VPS Core Server” on page 2.  “Package Update Options” on page 3.  “Configuring Users” on page 5.  “Configuring Email” on page 8.  “Configuring Virtual Hosts” on page 10.  “Installing Webmin on page 12.

Introduction

1

Linux VPS Core Getting Started Guide

Connecting to Your Linux VPS Core Server
There are many ways to connect and manage your Linux VPS Core server. One commonly used method is Secure Shell (SSH). SSH does require some technical understanding and is not as user friendly as some would like. If you rd prefer a more user friendly management tool, there are many 3 party control panels that can be installed and used to manage the server using a browser with a login and password. One popular 3 rd party control panel is Webmin. Because there are several 3rd party control panels available, you are responsible for installation, management, and compatibility. For more information on installing Webmin, please see the “Installing Webmin” section. When you ordered your server, you provided a password for your root user account. The root user is the user you will use to connect to your server and to perform administrative tasks such as creating user accounts and FTP, Web, and email configuration. When you connect to your server to perform administrative tasks, always connect using a secure protocol (such as SSH, SFTP, or SCP).A successful login places you in the root user’s home directory i.e /root. When logging in as a user with shell privileges, a successful login will place you in that user’s home directory i.e. /home/username. Only the user's files and directories are accessible here. To access the main server directories you will need to change your current directory to the Server Directory. Keep in mind that the user root is the primary administrative user on your server. To modify many system files, including adding or modifying users, you must be root. Because root is such an important user with so much power, you should be especially careful about selecting a root password and maintaining its security. All users with shell access are able to login in as a substitute user (or su). This enables authorized users to become the root user, or it enables the root user to become another user. Once you become root, however, you can use the su command to become another user on the server without requiring a password.

Shell (SSH)
Shell provides a powerful and secure tool for your Linux VPS Core administration tasks. Using an SSH (Secure Shell) client, you can connect to your server from anywhere in the world. There are several SSH clients to choose from such as PuTTY or SecureCRT. Although each SSH client may have a different look, they typically all require the same pieces of information to connect to your server. That is, the IP address or the hostname of your server, a login, and a password. You will need to log in using the root user (login: root) and the root password you specified during the order process.

TempDomain Name
When you ordered your Linux VPS Core server, a domain name called the TempDomain Name (*.servername.com) was automatically setup and assigned to your server for you to use. The tempdomain name is available for the life of your server. It will aid with configuring and testing your server. Adding your own domain at the time you order your server is optional. Therefore, if no domain is supplied, the tempdomain name will also be assigned as your server’s default hostname. Web content for the hostname can be placed in the /var/www/html directory. You can also use the tempdomain name to connect to your server.

Connecting to Your Linux VPS Core Server

2

Linux VPS Core Getting Started Guide

Package Update Options
The Linux VPS Core server uses only standard repositories, standard RPMs, and standard yum functions. No Verio managed repositories or Verio-built RPMs are offered. Package update options are available for any packages installed and managed by yum, including the default server applications that were installed when you ordered your server. Packages installed using alternative methods will not be included with the automated package updates. You are responsible for updating any packages or applications installed using a method other than yum.

Caution: You are responsible to make sure there are no incompatibilities or to correct any incompatibilities between your configuration and the package updates. It is especially important when using the Verio Managed (auto update) option to make sure there are no configuration issues with the updates.

Three package update options are available. The default package update option is set to option #3. The update options are as follows: 1. Self Managed - All packages (including the default server applications) are managed by you. It is your responsibility to make sure these updates are applied in order to ensure the stability and security of your server. No notification of any available updates will be sent to you. Updates will need to be completed using the yum update command. For more information on yum update, please see the following: http://www.centos.org/docs/5/html/yum/sn-managing-packages.html 2. Verio Managed - This is an auto update option. Any new updates will be automatically updated daily, weekly, or monthly. Once the update completes, an email notification will be sent to you with the results of the update. It is very important that the email address where the notifications will be sent to is a valid email address. Verio Notification - Verio will notify you of available updates daily, weekly, or monthly. It is your responsibility to make sure these updates are applied in order to ensure the stability and security of your server. Updates will need to be completed using the yum update command. For more information on yum update, please see the following: http://www.centos.org/docs/5/html/yum/sn-managing-packages.html Package update is executed via cron and managed by the settings located in the /etc/runupdates.conf file. To change the package update options, connect to your server via SSH as root and do the following: 1. Edit the package update configuration file (runupdates.conf) located in the /etc directory. For example: # vi /etc/runupdates.conf Modify the UPDATE= line. It can be set to no, yes, or notify. Notify is the default setting: UPDATE=notify a. b. If set to no, update option #1 is activated and all updates are managed manually by you. You will not receive a notification of any available updates. If set to yes, update option #2 is activated. The default server applications and installed yum packages will be updated automatically on a daily, weekly, or monthly basis. You will receive an email notification (to the address provided by the MAILTO = option) with the results of the update.

3.

2.

Package Update Options

3

Linux VPS Core Getting Started Guide
c. If set to notify, update option #3 is activated and you will be notified daily, weekly, or monthly when updates are available. You can then manually perform the updates when you are ready. You will receive an email notification (to the address provided by the MAILTO = option) of the available updates.

3.

Modify the MAILTO= line. Set the MAILTO= line to the email address you want the update notifications to be sent to. The default email address is root@localhost. MAILTO=root@localhost

Caution: It is important that you make sure the email address used is a valid email address so that the update notifications are received.

4.

Modify the FREQUENCY= line. It can be set to daily, weekly, or monthly. Weekly is the default setting: FREQUENCY=weekly

5. 6.

Save your changes. In order for the changes made to the runupdates.conf file to take effect, execute the following command: # /usr/local/sbin/set_runupdates

Package Update Options

4

Linux VPS Core Getting Started Guide

Configuring Users
Users are added and managed via the SSH command line. Users can also be added and managed using a third-party control panel. However, the following instructions are for SSH command line only. Please refer to the help documentation for the control panel you are using for information on adding and managing users. There are several command line tools available to help you manage users and groups. Some of these tools are:  useradd - Add a new user.  usermod - Modify a user.  userdel - Delete a user.  passwd - Change a user password. User information is stored in several different files on your server. First, the /etc/passwd file contains a list of user names, along with some account information. The following is a sample entry for the user test: test:x:501:501:Test User Account:/home/test:/bin/bash The entry contains seven fields in a colon (:) delimited list. The first field is the username, followed by an “x”, which represents the password. As a security measure, passwords are not actually stored in the /etc/passwd file and the “x” is a place holder for the password. Next are two numbers, the User ID (UID) number and the Group ID (GID) number. UID and GID below 500 are reserved for system users. New users will be assigned a UID and GID above 500. These are used by the server to track file access and ownership rights. After the numbers, the real name or a description of the user account, followed by the user's home directory, and finally the shell they are allowed to use. User passwords are stored in an encrypted format in the /etc/shadow file. This file is similar to the passwd file, although some different fields that the system uses are displayed. Additional user information is stored in files such as /etc/group. This section explains how to manage users such as adding, removing, and unlocking user accounts. It also explains how to view and set a user’s quota.

Adding Users
Users can be added from command line using the useradd command. By default, new user accounts are locked and must be unlocked before they are accessible. There are many command line options available to customize your user configuration. However, if no options are given, then the following default settings will be applied: User’s Home directory - /home/username User’s Shell - /bin/bash User’s Default Group - Same as the Username Please see the MAN page or the following for more command line options: http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-users-add.html The following are instructions to add a new user with a basic configuration.

Configuring Users

5

Linux VPS Core Getting Started Guide
To add a new user, connect to your server via SSH as root and do the following: 1. Enter the useradd command with the following options: # useradd <username> –p<password> -c "Full Name" 2. 3. Replace <username> with the username of the user. Replace <password> with the password for the user.

Note: Use a password that will not easily be guessed. A combination of uppercase and lowercase letters, numbers, and symbols is an example of a more secure password. 4. Replace Full Name with the user’s Full Name.

Note: As with most Linux operating systems multi-byte characters in usernames are supported except for the following characters because they are reserved for system use: @, $, #, / or \. Caution: Shell access enables control over many aspects of the server. Shell access should only be offered to trusted users. With shell access users can potentially change files or settings affecting your entire server.

Lock/Unlock User Accounts
To lock a user, connect to your server via SSH as root and do the following: 1. Enter the usermod command with the following options: # usermod –L <username> 2. Replace <username> with the username of the user.

To unlock a user, connect to your server via SSH as root and do the following: 1. Enter the usermod command with the following options: # usermod –U <username> 2. Replace <username> with the username of the user.

Configuring Users

6

Linux VPS Core Getting Started Guide

Removing Users
To remove a user, connect to your server via SSH as root and do the following: 1. Enter the userdel command with the following options: # userdel –r <username> 2. Replace <username> with the username of the user.

Caution: The -r option removes the user’s home directory as well as the user’s mail. Use extreme caution when removing the home directory of users. You will not be warned if Web content or other important information is stored in the user’s home directory.

Note: If you remove a user, but not all the files the user owns, the files or directories of the removed user will now be owned by the user’s UID.

Configuring Users

7

Linux VPS Core Getting Started Guide

Configuring Email
By default, all user email resides in the /var/mail directory. When you add a user using the useradd command, a mailbox is automatically created. In addition, if the email for the user is using an additional domain, the domain will need to manually be added to Sendmail in order for email to deliver properly for that domain. If no other email routing settings (such as aliases or virtual user tables) are configured, by default the username of each user functions as a valid email for all domains that resolve to the server. For example, if domain1.com and domain2.com resolve to the server, for the user bob, both [email protected] and [email protected] would deliver email to the /var/mail/bob email box. The system checks for matches in email routing and addresses in the following order and delivers to the first match it finds:  virtual user tables ( or virtusertable)  aliases  users This section explains the different internal email routing options by using virtusertables, catchalls, and aliases.

Virtual User Tables
Virtual user tables (or virtusertable) route the full email address (both sides of the “@”) to a local user, alias, or remote email address, but cannot direct to files or programs. Only aliases can route email to a file or program such as an autoresponder program. A virtusertable consists of the virtusertable and its destination, or direction. For example, a virtusertable for [email protected] could be directed to the user bob with the following virtusertable entry:
[email protected] bob

Virtusertable enables you to create email addresses without the need to create a corresponding user. For example, a virtusertable for [email protected] could be directed to [email protected] with the following virtusertable entry:
[email protected] [email protected]

In this example, remotedomain.com would indicate a remote domain which does not resolve to your Linux VPS Core server. Specify virtusertable in the /etc/mail/virtusertable file, with one virtusertable entry per line. You can add or change virtusertable settings by editing the virtusertable file and loading the changes into the system. Any time you make a change to the /etc/mail/virtusertable text file, you will need to update the virtusertable database (/etc/mail/irtusertable.db) file that sendmail uses. The following command will update the virtusertable database file:
# makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable

For more information:
http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-email-mta-sendmaildefault.html

Configuring Email

8

Linux VPS Core Getting Started Guide

Aliases
Email aliases forward email to a user, another alias, an email address, a list of addresses, a file, or a program. Aliases enable you to create email addresses without the need to create a corresponding user. For example, the following alias would forward email sent to [email protected] to the stan user:
webmaster: stan

An alias does not route email by considering the full email address like the virtusertable does, rather it routes email by using the entry previous to the “@” sign. An alias does not use the domain name for routing. Aliases also enable you to send email to a list or to a program. For example, the following alias would forward email sent to [email protected] to the bob, joe, and stan users:
sales: bob,joe,stan

For long email lists, place the emails in a file, one address per line, and use the include option. For example, the following alias would forward email sent to [email protected] to all addresses in the /lists/promotion file:
promotion: :include: /lists/promotion

Specify aliases in the /etc/aliases file, with one alias per line. You configure the aliases by editing the aliases file according to your needs. After making changes to the file, execute the newaliases command from the command prompt to load the aliases into the system. Note: The system only considers the first portion of the email address (before @) for aliases. To direct an entire email address to a certain recipient, use a virtusertable.

Configuring Email

9

Linux VPS Core Getting Started Guide

Configuring Virtual Hosts
The Linux VPS Core server enables you to configure multiple websites and domains in addition to the main domain (hostname) of the server. Other domains or sites hosted by your server are called Virtual Hosts. This section explains adding, removing, and configuring a Virtual Host.

Adding a Virtual Host
Virtual Hosts are configured with the Apache Virtual Host <VirtualHost> directive. The Apache Web server looks for Virtual Host entries in the httpd.conf file located in the /etc/httpd/conf directory. A Virtual Host configuration can include many settings. The following instructions are for name-based virtual hosting and list the minimum settings needed. To add a Virtual Host, connect to your server via SSH as root and do the following: 1. Create the directory where you want to keep your virtual host files. For example: # mkdir /home/user/www/vhost.com 2. Make sure the permissions for the new directory and parent directories are set appropriately. For example: # chmod +x –R user/www/vhost.com 3. Edit the httpd.conf file in the /etc/httpd/conf directory. For example: # vi /etc/httpd/conf/httpd.conf 4. Locate and uncomment the following line and replace the asterisk (*) with the IP address you want to assign to the Virtual Host: NameVirtualHost *:80 5. Create a <Virtual Host> directive with your Virtual Host settings and replace the asterisk (*) with your IP address such as: <VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com example.domain.com DocumentRoot /www/domain.com </VirtualHost> 6. Save your changes to the httpd.conf file and restart the Apache Server: # service httpd restart

Configuring Virtual Hosts

10

Linux VPS Core Getting Started Guide

Removing a Virtual Host
The Apache configuration file (httpd.conf) located in the /etc/httpd/conf directory contains the configuration of your Virtual Hosts. To remove the Virtual Host configuration from the Web server, do the following: 1. Edit the httpd.conf file in the /etc/httpd/conf directory and remove the <Virtual Host> directive for the Virtual Host in question. 2. Save your changes to the httpd.conf file and restart the Apache Server: # service httpd restart 3. Remove any unneeded files or directories for the Virtual Host from the server.

Configuring Virtual Hosts

11

Linux VPS Core Getting Started Guide

Installing Webmin
Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely. For more information, please see the following: http://www.webmin.com/rpm.html To install Webmin, connect to your server via SSH as root and run the following commands: 1. Create a file called webmin.repo in the /etc/yum.repos.d directory. 2. Add the following lines to the webmin.repo file: [Webmin] name=Webmin Distribution Neutral #baseurl=http://download.webmin.com/download/yum mirrorlist=http://download.webmin.com/download/yum/mirrorlist enabled=1 3. Fetch and install the GPG key for the package by running this command: # rpm --import http://www.webmin.com/jcameron-key.asc 4. Run the yum install command for Webmin: # yum install webmin You can access Webmin using a URL similar to the following: http://<hostname>/webmin Replace <hostname> with the hostname of your server or you can use the IP address.

Installing Webmin

12

Linux VPS Core Getting Started Guide

Notices
Document Source
This document was written by: VERIO, Inc. 1230 North Research Way, Orem, UT 84097

Copyright  1995-2010 by VERIO Inc. All rights reserved.

Disclaimers
The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law: VERIO CORPORATION PROVIDES THIS PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of expressed or implied warranties in certain transactions; therefore, this statement might not apply to you. The information included in this document is intended for internal use by Verio, OEM partners, and viaVerio resellers. Printed copies of this document are not controlled. Official form is available from Verio. This document could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. VERIO might make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time. This document might contain reference to, or information about, VERIO products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that VERIO intends to announce such VERIO products, programming, or services in your country.

Trademarks
VERIO and VERIO-related product names are trademarks of VERIO Inc. All other trademarks in this document are the property of their respective owners.

Contact VERIO
If you have comments or questions about the content in this document, please send an email message to [email protected] and include any specific details. Requests for technical information about VERIO products should be made to VERIO Marketing Representatives.

Notices

13

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close