1. 程式人生 > >完美安裝配置Ubuntu 伺服器版

完美安裝配置Ubuntu 伺服器版

這篇教程指導你如何完美安裝配置ubuntu 伺服器版本,並安裝配置一般的服務:

apache (ssl) positfix 郵件伺服器 smtp-auth tls bind dns伺服器,proftpd ftp伺服器

mysql資料庫 courierpop3/imap 郵件服務, 磁碟限額,防火牆等等。雖然這篇教程

是在32位的ubutnu 8.04上安裝的,但應該也適用於64位版本的。下面是相關軟體的版本:

* Web 伺服器: Apache 2.2 PHP 5.2.4? Ruby
* Database 伺服器: MySQL 5.0
* Mail 伺服器: Postfix
* DNS 伺服器: BIND9
* FTP 伺服器: proftpd
* POP3/IMAP: I will use Maildir format and therefore install Courier-POP3/Courier-IMAP.
* Webalizer 網站訪問分析

安裝完成之後你會有個穩定的伺服器系統。

1 準備必要的東西

要安裝需要準備下面的資料:

* Ubuntu 8.04 LTS 伺服器版cd,

可以到這裡下載: ftp://releases.ubuntu.com/releases/

* 比較快的網際網路

2 注意點

在這篇教程裡面伺服器名叫server1.example.com ip 192.168.0.100 閘道器 192.168.0.1,

你的設定可能跟這個不同,替換成你需要設定的引數就可以了。

3 基本系統

插入你的ubuntu安裝關盤,從光碟啟動,選擇安裝語言:

選擇安裝ubuntu伺服器:

再次選擇語言:

選擇區域:

選擇鍵盤 基本選擇標準101鍵盤,或者根據你的鍵盤選擇

安裝會自動校驗光碟 硬體 配置網路

輸入主機名,在這個教程裡面,我的主機名叫 server.example.com 所以我輸入server1

下面要分割槽了,為了簡單步驟我選擇整個硬碟,你也可以選擇手動分割槽,使用lvm卷等

選擇需要分割槽的硬碟

當問你是否要儲存硬碟改變時選擇yes

然後你的心得分割槽就會被建立並被格式化,下面開始安裝

建立一個使用者比如 administrator 不要選擇ubuntu保留的使用者名稱

下面配置包安裝管理器,proxy那裡不要設定,除非你有使用proxy

我們需要安裝dns mail lamp 伺服器,但是我從來不選擇他們,因為我喜歡完全控制我的系統,

只安裝那些我需要的。 我們會在後面手工安裝它們。唯一我選擇的是openssh伺服器,因為我要馬上

使用ssh在安裝完成後登陸。ssh可以用? PuTTY

安裝繼續

安裝grub

基礎系統就安裝完成了。拿出cd重新啟動系統。

進入下一步

4 啟用root使用者

當重啟之後你可以用剛剛你設定的使用者明登陸了。比如administrator。因為我們要以root使用者執行下面的

步驟,所以我們現在需要啟用root使用者。執行下面的命令

sudo passwd root

輸入一個root密碼,下面我們以root執行

su

5 安裝ssh伺服器(可選)

如果你一開始沒有裝,這個時候你就可以裝了。

apt-get install ssh openssh-server

從現在開始你就可以從你的工作臺上用ssh客戶端比如 PuTTY 來連線伺服器執行下面的安裝了。

6 安裝vim-full(可選)

在這篇教程裡我使用的文字編輯器是vi。預設的vi有點奇怪的問題,要修復這個問題,我們安裝vim-full

apt-get install vim-full

(你不一定非的使用vi,你也可以使用joe or nano.)

7 配置網路

我們安裝時使用的是預設配置,獲得ip是使用dhcp獲得的,作為一個伺服器應該有一個靜態 ip,編輯

/etc/network/interfaces 調整相關引數以符合你的需要,我在教程裡使用的是192.168.0.100:

vi /etc/network/interfaces

# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1

重啟網路:

/etc/init.d/networking restart

編輯/etc/hosts.

vi /etc/hosts

127.0.0.1 localhost.localdomain localhost192.168.0.100 server1.example.com server1# The following lines are desirable for IPv6 capable hosts::1 ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allroutersff02::3 ip6-allhosts

現在執行

echo server1.example.com > /etc/hostname

/etc/init.d/hostname.sh start

然後執行

hostname

hostname -f

兩個都應該顯示server1.example.com now.

8 編輯 /etc/apt/sources.list 更新安裝

編輯 /etc/apt/sources.list. 註釋掉或者刪除安裝cd,新增一些網際網路倉庫,國內cn99的比較快,

我這裡只是舉個例子,大家可以直接按照自己的需要新增網際網路倉庫:

vi /etc/apt/sources.list

##deb cdrom:[Ubuntu-Server 8.04 _Hardy Heron_ Release i386 (20080423.2)]/ hardy main restricted#deb cdrom:[Ubuntu-Server 8.04 _Hardy Heron_-Release i386 (20080423.2)]/ hardy main restricted# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb http://de.archive.ubuntu.com/ubuntu/ hardy main restricteddeb-src http://de.archive.ubuntu.com/ubuntu/ hardy main restricted## Major bug fix updates produced after the final release of the## distribution.deb http://de.archive.ubuntu.com/ubuntu/ hardy-updates main restricteddeb-src http://de.archive.ubuntu.com/ubuntu/ hardy-updates main restricted## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in## universe WILL NOT receive any review or updates from the Ubuntu security## team.deb http://de.archive.ubuntu.com/ubuntu/ hardy universedeb-src http://de.archive.ubuntu.com/ubuntu/ hardy universedeb http://de.archive.ubuntu.com/ubuntu/ hardy-updates universedeb-src http://de.archive.ubuntu.com/ubuntu/ hardy-updates universe## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in## multiverse WILL NOT receive any review or updates from the Ubuntu## security team.deb http://de.archive.ubuntu.com/ubuntu/ hardy multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ hardy multiversedeb http://de.archive.ubuntu.com/ubuntu/ hardy-updates multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ hardy-updates multiverse## Uncomment the following two lines to add software from the ‘backports’## repository.## N.B. software from this repository may not have been tested as## extensively as that contained in the main release, although it includes## newer versions of some applications which may provide useful features.## Also, please note that software in backports WILL NOT receive any review## or updates from the Ubuntu security team.# deb http://de.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe

#multiverse# deb-src http://de.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe

#multiverse## Uncomment the following two lines to add software from Canonical’s## ‘partner’ repository. This software is not part of Ubuntu, but is## offered by Canonical and the respective vendors as a service to Ubuntu## users.# deb http://archive.canonical.com/ubuntu hardy partner# deb-src http://archive.canonical.com/ubuntu hardy partnerdeb http://security.ubuntu.com/ubuntu hardy-security main restricteddeb-src http://security.ubuntu.com/ubuntu hardy-security main restricteddeb http://security.ubuntu.com/ubuntu hardy-security universedeb-src http://security.ubuntu.com/ubuntu hardy-security universedeb http://security.ubuntu.com/ubuntu hardy-security multiversedeb-src http://security.ubuntu.com/ubuntu hardy-security multiverse

接著執行更新包資料庫

apt-get update

安裝最新的包

apt-get upgrade

9 改變預設的shell

/bin/sh 是一個符號連結,聯結至/bin/dash, 我們比較常用的是/bin/bash, not /bin/dash. 所以我們這麼做:

ln -sf /bin/bash /bin/sh

有好多指令碼是用bash寫的,所以,建議大家用bash作為預設shell

10 禁用 AppArmor

AppArmor是一個安裝擴充套件,類似紅帽的selinux . 在我的觀念裡面,你不需要他就可以配置一個非常安全

的系統,而且這個擴充套件經常導致這樣或那樣奇怪的問題。因此我禁用了這個擴充套件。

像這樣來禁用他:

/etc/init.d/apparmor stop

update-rc.d -f apparmor remove

apt-get remove apparmor apparmor-utils

11 安裝一些相關的包

有一些包是非常通用的,建議直接裝上,執行:

apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev

libpcre3 libpopt-dev lynx m4 make ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf

automake1.9 libtool bison autotools-dev g++ build-essential

這些命令是要使用網際網路連結的,如果你沒有聯網,可能就裝不了。

12 磁碟限額

如果你使用的是一個分割槽,那麼你一定要使用磁碟限額,以免整個系統的空間被哪個傢伙全吃掉。

安裝quota執行

apt-get install quota

編輯 /etc/fstab. 最起碼像這樣(我在/下分割槽上添加了,usrquota,grpquota? ):

vi /etc/fstab

# /etc/fstab: static file system information.## <file system> <mount point> <type> <options> <dump> <pass>proc /proc proc defaults 0 0# /dev/sda1UUID=6af53069-0d51-49be-b275-aeaea8d780c5 / ext3relatime,errors=remount-ro,usrquota,grpquota 0 1# /dev/sda5UUID=d8e1f66c-1442-423e-b442-8ae66eded9d7 none swap sw 0 0/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

啟用quota, 執行這些命令:

touch /quota.user /quota.group

chmod 600 /quota.*

mount -o remount /

quotacheck -avugm

quotaon -avug

13 DNS 伺服器

執行

apt-get install bind9

因為一些安裝問題,我們需要chrooted bind(這個相當與虛擬一個新的linux給dns使用),執行下面的步驟

/etc/init.d/bind9 stop

編輯 /etc/default/bind9 以便超級執行緒可以以一個沒有許可權的使用者執行,

比如bind,chrooted 到/var/lib/named. 修改這一行: OPTIONS=”-u bind” 加上選項OPTIONS=”-u bind -t /var/lib/named”:

vi /etc/default/bind9

OPTIONS=”-u bind -t /var/lib/named”# Set RESOLVCONF=no to not run resolvconfRESOLVCONF=yes

在 /var/lib下建立相關目錄:

mkdir -p /var/lib/named/etc

mkdir /var/lib/named/dev

mkdir -p /var/lib/named/var/cache/bind

mkdir -p /var/lib/named/var/run/bind/run

移動配置資料夾從/etc 到 /var/lib/named/etc:

mv /etc/bind /var/lib/named/etc

建立一個符號從舊的資料夾連線到新的配置資料夾,這是為了避免當bind升級時出現問題。

ln -s /var/lib/named/etc/bind /etc/bind

建立一些不存在的隨便的裝置,以修復資料夾的許可權:

mknod /var/lib/named/dev/null c 1 3

mknod /var/lib/named/dev/random c 1 8

chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random

chown -R bind:bind /var/lib/named/var/*

chown -R bind:bind /var/lib/named/etc/bind

我們需要修改/etc/default/syslogd 以便我們登陸系統的時候可以得到一些重要日誌資訊。. 修改這一行: SYSLOGD=”"? SYSLOGD=”-a /var/lib/named/dev/log”:

vi /etc/default/syslogd

## Top configuration file for syslogd### Full documentation of possible arguments are found in the manpage# syslogd(8).### For remote UDP logging use SYSLOGD=”-r”#SYSLOGD=”-a /var/lib/named/dev/log”

重啟日誌程序:

/etc/init.d/sysklogd restart

啟動 BIND, 檢查/var/log/syslog彙報的錯誤:

/etc/init.d/bind9 start

14 MySQL資料庫

要安裝MySQL, 我們執行

apt-get install mysql-server mysql-client libmysqlclient15-dev

安裝中會要求你給root設定一個密碼,安裝完了之後,

[email protected]? 和 [email protected] 該E-mail地址已受到防止垃圾郵件機器人的保護,您必須啟用瀏覽器的Java Script才能看到。 的密碼都是剛剛設的這個,我們就不需要再重設root密碼了。:

New password for the MySQL “root” user: <– 你要設定的密碼

Repeat password for the MySQL “root” user: <– 再輸入一次你要輸入的密碼

我們需要mysql監聽所有的介面而不是隻有127.0.0.1 所以我們要編輯/etc/mysql/my.cnf

註釋掉這一行 bind-address = 127.0.0.1:

vi /etc/mysql/my.cnf

[...]# Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.#bind-address = 127.0.0.1[...]

重啟MySQL:

/etc/init.d/mysql restart

檢查是否已經在網路上開了服務埠. 執行

netstat -tap | grep mysql

結果看起來應該象這個:

[email protected]:~# netstat -tap | grep mysql

tcp??????? 0????? 0 *:mysql???????????????? *:*???????????????????? LISTEN????? 5869/mysqld

[email protected]:~#

15 安裝帶SMTP-AUTH 和 TLS模組郵件伺服器Postfix

按照下面的步驟安裝daismtp-auth 和 tls 模組的郵件伺服器:

apt-get install postfix libsasl2-2 sasl2-bin libsasl2-modules procmail

按照下面回答提示的兩個問題:

General type of mail configuration: <– Internet Site

System mail name: <– server1.example.com

執行

dpkg-reconfigure postfix

還會提示下面的問題:

General type of mail configuration: <– Internet Site

System mail name: <– server1.example.com

Root and postmaster mail recipient: <– [blank]

Other destinations to accept mail for (blank for none):

<– server1.example.com, localhost.example.com, localhost.localdomain, localhost

Force synchronous updates on mail queue? <– No

Local networks: <– 127.0.0.0/8

Use procmail for local delivery? <– Yes

Mailbox size limit (bytes): <– 0

Local address extension character: <– +

Internet protocols to use: <– all

接著執行下面的命令:

postconf -e ’smtpd_sasl_local_domain =’

postconf -e ’smtpd_sasl_auth_enable = yes’

postconf -e ’smtpd_sasl_security_options = noanonymous’

postconf -e ‘broken_sasl_auth_clients = yes’

postconf -e ’smtpd_sasl_authenticated_header = yes’

postconf -e ’smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination’

postconf -e ‘inet_interfaces = all’

echo ‘pwcheck_method: saslauthd’ >> /etc/postfix/sasl/smtpd.conf

echo ‘mech_list: plain login’ >> /etc/postfix/sasl/smtpd.conf

然後我們建立tls認證:

mkdir /etc/postfix/ssl

cd /etc/postfix/ssl/

openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024

chmod 600 smtpd.key

openssl req -new -key smtpd.key -out smtpd.csr

openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt

openssl rsa -in smtpd.key -out smtpd.key.unencrypted

mv -f smtpd.key.unencrypted smtpd.key

openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650

下面配置 TLS (確認你自己使用正確的 hostname 在 myhostname這一項上):

postconf -e ‘myhostname = server1.example.com’

postconf -e ’smtpd_tls_auth_only = no’

postconf -e ’smtp_use_tls = yes’

postconf -e ’smtpd_use_tls = yes’

postconf -e ’smtp_tls_note_starttls_offer = yes’

postconf -e ’smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key’

postconf -e ’smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt’

postconf -e ’smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem’

postconf -e ’smtpd_tls_loglevel = 1′

postconf -e ’smtpd_tls_received_header = yes’

postconf -e ’smtpd_tls_session_cache_timeout = 3600s’

postconf -e ‘tls_random_source = dev:/dev/urandom’

最後/etc/postfix/main.cf 看起來像這樣:

cat /etc/postfix/main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version# Debian specific: Specifying a file name will cause the first# line of that file to be used as the name. The Debian default# is /etc/mailname.#myorigin = /etc/mailnamesmtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)biff = no# appending .domain is the MUA’s job.append_dot_mydomain = no# Uncomment the next line to generate “delayed mail” warnings#delay_warning_time = 4hreadme_directory = no# TLS parameterssmtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crtsmtpd_tls_key_file = /etc/postfix/ssl/smtpd.keysmtpd_use_tls = yessmtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scachesmtp_tls_session_cache_database = btree:${data_directory}/smtp_scache# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for# information on enabling SSL in the smtp client.myhostname = server1.example.comalias_maps = hash:/etc/aliasesalias_database = hash:/etc/aliasesmyorigin = /etc/mailnamemydestination = server1.example.com, localhost.example.com, localhost.localdomain, localhostrelayhost =mynetworks = 127.0.0.0/8mailbox_command = procmail -a “$EXTENSION”mailbox_size_limit = 0recipient_delimiter = +inet_interfaces = allinet_protocols = allsmtpd_sasl_local_domain =smtpd_sasl_auth_enable = yessmtpd_sasl_security_options = noanonymousbroken_sasl_auth_clients = yessmtpd_sasl_authenticated_header = yessmtpd_recipient_restrictions =

permit_sasl_authenticated,permit_mynetworks,reject_unauth_destinationsmtpd_tls_auth_only = nosmtp_use_tls = yessmtp_tls_note_starttls_offer = yessmtpd_tls_CAfile = /etc/postfix/ssl/cacert.pemsmtpd_tls_loglevel = 1smtpd_tls_received_header = yessmtpd_tls_session_cache_timeout = 3600stls_random_source = dev:/dev/urandom

認證由saslauthd實現的,因為postfix是chroot執行在/var /spool/postfix/下,我們需要做一些改變使其正常工作,

:

mkdir -p /var/spool/postfix/var/run/saslauthd

編輯/etc/default/saslauthd 啟用sslauthd. 設定 START 為yes 把OPTIONS=”-c -m /var/run/saslauthd”

改成 OPTIONS=”-c -m /var/spool/postfix/var/run/saslauthd -r”:

vi /etc/default/saslauthd

## Settings for saslauthd daemon# Please read /usr/share/doc/sasl2-bin/README.Debian for details.## Should saslauthd run automatically on startup? (default: no)START=yes# Description of this saslauthd instance. Recommended.# (suggestion: SASL Authentication Daemon)DESC=”SASL Authentication Daemon”# Short name of this saslauthd instance. Strongly recommended.# (suggestion: saslauthd)NAME=”saslauthd”# Which authentication mechanisms should saslauthd use? (default: pam)## Available options in this Debian package:# getpwent — use the getpwent() library function# kerberos5 — use Kerberos 5# pam — use PAM# rimap — use a remote IMAP server# shadow — use the local shadow password file# sasldb — use the local sasldb database file# ldap — use LDAP (configuration is in /etc/saslauthd.conf)## Only one option may be used at a time. See the saslauthd man page# for more information.## Example: MECHANISMS=”pam”MECHANISMS=”pam”# Additional options for this mechanism. (default: none)# See the saslauthd man page for information about mech-specific options.MECH_OPTIONS=”"# How many saslauthd processes should we run? (default: 5)# A value of 0 will fork a new process for each connection.THREADS=5# Other options (default: -c -m /var/run/saslauthd)# Note: You MUST specify the -m option or saslauthd won’t run!## See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.# See the saslauthd man page for general information about these options.## Example for postfix users: “-c -m /var/spool/postfix/var/run/saslauthd”#OPTIONS=”-c -m /var/run/saslauthd”OPTIONS=”-c -m /var/spool/postfix/var/run/saslauthd -r”

下面把postfix user 加到sasl組裡面,這一步使postfix有許可權使用saslauthd

adduser postfix sasl

重啟Postfix 啟動saslauthd:

/etc/init.d/postfix restart

/etc/init.d/saslauthd start

下面看看smtp-auth 和tls工作了沒:

telnet localhost 25

看到提示了後執行:

ehlo localhost

如果你看到了下面的

250-STARTTLS

還有這個

250-AUTH LOGIN PLAIN

那就證明所有的都ok了。

在我的機器上顯示的像下面的:

[email protected]:/etc/postfix/ssl# telnet localhost 25

Trying 127.0.0.1…

Connected to localhost.localdomain.

Escape character is ‘^]’.

220 server1.example.com ESMTP Postfix (Ubuntu)

ehlo localhost

250-server1.example.com

250-PIPELINING

250-SIZE 10240000

250-VRFY

250-ETRN

250-STARTTLS

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250-ENHANCEDSTATUSCODES

250-8BITMIME

250 DSN

quit

221 2.0.0 Bye

Connection closed by foreign host.

[email protected]:/etc/postfix/ssl#

輸入

quit

返回系統shells.

16 安裝 Courier-IMAP/Courier-POP3

執行下面的命令安裝Courier-IMAP/Courier-IMAP-SSL (IMAPs 在埠 993上)

和Courier-POP3/Courier-POP3-SSL (POP3s 在埠 995上)pop3和imap是明文傳輸密碼的,這兩個包是為了解決安全問提出現的:

apt-get install courier-authdaemon courier-base courier-imap

courier-imap-ssl courier-pop courier-pop-ssl courier-ssl gamin libgamin0 libglib2.0-0

提示下面兩個問題:

Create directories for web-based administration? <– No

SSL certificate required <– Ok

17 安裝Apache/PHP5/Ruby

下面我們安裝Apache:

apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert

下面我們安裝PHP5 和 Ruby (兩個都是apache的模組):

apt-get install libapache2-mod-php5 libapache2-mod-ruby php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

編輯edit /etc/apache2/mods-available/dir.conf:

vi /etc/apache2/mods-available/dir.conf

更改DirectoryIndex 這一行:

<IfModule mod_dir.c>#DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htmDirectoryIndex index.html index.htm index.shtml index.cgi index.php </IfModule>

現在我們可以啟用某些Apache 模組了 (SSL, rewrite, suexec, and include):

a2enmod ssl

a2enmod rewrite

a2enmod suexec

a2enmod include

重新載入配置檔案:

/etc/init.d/apache2 force-reload

17Proftpd

安裝Proftpd, run

apt-get install proftpd ucf

會提示你這個問題:

Run proftpd: <– standalone

為了提高proftpd的安全性可以做下面的操作,更多資訊可以看這裡: http://proftpd.org/localsite/Userguide/linked/userguide.html):

vi /etc/proftpd/proftpd.conf

[...]DefaultRoot ~IdentLookups offServerIdent on “FTP Server ready.”[...]

18 網站訪問統計分析

安裝webalizer,直接執行

apt-get install webalizer

19 同步系統時鐘

與網際網路上某個時間伺服器同步是一個不錯的選擇。簡單的執行

apt-get install ntp ntpdate

以後你的系統時間就會自動同步了。

相關推薦

完美安裝配置Ubuntu 伺服器

這篇教程指導你如何完美安裝配置ubuntu 伺服器版本,並安裝配置一般的服務: apache (ssl) positfix 郵件伺服器 smtp-auth tls bind dns伺服器,proftpd ftp伺服器 mysql資料庫 courierpop3/imap 郵件服

Ubuntu上NFS的安裝配置(問題解決)

On the master node, edit your /etc/hosts.allow file to allow connections from slave nodes. If your cluster LAN is on 192.168.1.0/24, your hosts.allow will

CentOS 6.3安裝配置LAMP伺服器 (Apache+PHP5+MySQL)

準備篇: 1、配置防火牆,開啟80埠、3306埠 vi /etc/sysconfig/iptables -A INPUT -mstate --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #允許80埠通過防火牆 -A INPUT -m state --st

CentOS 6.8安裝配置samba伺服器

1、關閉防火牆 # service iptables status //檢視防火牆的狀態 # service iptables stop //停止防火牆 # chkconfig iptables off //永久關閉防火牆 2、關閉SELINUX # sestatu

CentOS-Minimal 配置安裝配置vsftpd伺服器及搭建Oracle伺服器

配置CentOS-Minimal網路 使用命令 [ls] 列出網路配置資料夾 [[email protected] ~]# ls /etc/sysconfig/network-scripts 使用命令 [vi] 文字編

Linux伺服器安裝配置Nginx伺服器

Nginx("engine x")是一款是由俄羅斯的程式設計師Igor Sysoev所開發高效能的 Web和 反向代理 伺服器,也是一個 IMAP/POP3/SMTP 代理伺服器。 在高連線併發的情況下,Nginx是Apache伺服器不錯的替代品。 Nginx 安裝 一、安裝編譯工具及庫檔案 yum -

Linux下安裝配置VSFTP伺服器

1、安裝vsftpd軟體包#yum -y install vsftpd db4 db4-utils 安裝完成後先關閉SELinux及iptables防火牆 2、啟動vsfptd伺服器#service vsftpd start 現在就可以用匿名使用者登入了。預設的匿名使用者為

Docker 安裝配置 Nginx伺服器(詳細)

  方法一、docker pull nginx(推薦) 查詢 Docker Hub 上的 nginx 映象 [email protected]:~/nginx$ docker search nginx NAME

CentOS 6.5安裝配置NFS伺服器

OS:centos 6.5 服務端:10.1.11.201 客戶端:10.1.11.202 10.1.11.203 10.1.11.204 1.服務端的配置 安裝必須的yum包: yum -y install nfs-utils rpcbind 建立共享目錄: mkdir /Udis

Linux中安裝配置FTP伺服器方法

配置檔案: 使用者登入控制:   anonymous_enable=YES,允許匿名使用者登入。   no_anon_password=YES,匿名使用者登入時不需要輸入密碼。   local_enable=YES,允許本地使用者登入。   deny_email_enable=YES,可以建立

linux 安裝配置DNS伺服器

VM虛擬的環境CENTOS 5.6 IP:192.168.1.170 本地XP系統 IP:192.168.1.108 一.。安裝DNS       LINUX安裝DNS主要要安裝2個程式:       yum install bind*                 

windows下安裝配置apache伺服器

9、正常情況下,走到第八步,算是安裝好了,但是可能第八步走不下路,啟動不了服務。。。我也遇到了。。。如下。。  a、點選啟動此服務無效 報錯 無法重現圖了。。。 b、 進入 apache 檔案的bin目錄中,點選ApacheMonitor 後 ,開啟管理視窗,點選start 也是報錯,

安裝配置ngrok伺服器

不說話,直接上程式碼; 一、安裝git 1、安裝git所用到依賴包 yum -y install zlib-devel openssl-devel perl hg cpio expat-devel gettext-devel curl curl

Linux之CentOS6.5安裝配置Tomcat7伺服器

Linux之CentOS6.5安裝Tomcat7 準備: 1、centos6.5 2、Tomcat7(Linux版) 3、secureCRT 4、FileZilla(用於為liunx傳檔案) 步驟: 1、secureCRT

python-django的安裝配置(mac

2、解壓Django-1.xx.yy.tar.gz ,進入解壓目錄執行命令 sudo python setup.py install 3、檢視是否安裝成功 django-admin.py --version 4、建立一個工程 djang

Nagios安裝配置(ubuntu)&調研

[[email protected] etc]# cat services.cfg  define service{         use                     local-service         host_name               node3        

CentOS 7.4 安裝配置Samba伺服器

[[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core)[[email protected] ~]# yum -y install samba

Oracle客戶端安裝配置、綠色Oracle客戶端配置使用PLSQL

安裝Oracle客戶端 準備工作,首先下載對應Oracle版本的客戶端,這個可以去Oracle官網下載,加壓完目錄如下: 點選setup.exe安裝,選擇安裝型別為管理員: 其他都可以設定為預設或者自定義,當Oracle客戶端安裝成功後,可以在wi

安裝配置DNS伺服器、DDNS的配置

DNS和DDNS的安裝和配置 一、DNS簡介 1、DNS伺服器的工作原理 域名服務(DNS)是一種分散式資料庫,它提供從機器名到數字IP地址的對映。 DNS服務最常用的軟體是BIND(Berkeley Internet Name Domain),

centos安裝配置tftp伺服器

PC機系統:Win7  虛擬機器linux系統:centosx86 1.tftp概論 TFTP(Trivial File Transfer Protocol,簡單檔案傳輸協議)是TCP/IP協議族中的一個用來在客戶機與伺服器之間進行簡單檔案傳輸的協議,提供不復雜、開銷不