教你快速安裝 Redhat Linux 7.3…
特點及功能如下
使用單純的結構,以提供主流服務,系統將不安裝 X-Window 接口。
redhat7.4安裝教程、具備 ProFtp、Sendmail、Webmail、web 及數據庫 (MySQL) 的服務。
可使用瀏覽器在線上做系統管理 (WebMin)、數據庫維護 (phpMyAdmin) 及流量監控 (Mrtg)。
每天與時間服務器對時。
每周自動更新系統的套件。
redhat centos、Redhat Linux 7.3 的安裝重點
安裝類型 (Installation Type): 選取 “服務器(Server)”
碟碟分割的順序及容量:
(請注意 /home 與 /var 的容量,如要做郵件服務器,則 /home 應該比較大,如要做網頁服務器,則 /var 應該比較大)
redhat 安裝?- /boot: 64MB 或 128MB
- /home: 依用途設為硬盤總容量的 “二分之一” 或 “四分之一”
- /var: 依用途設為硬盤總容量的 “二分之一” 或 “四分之一”
- SWAP: 實體內存的兩倍
redhat9?- /: 剩余的容量
選擇時區 (Time Zone Selection): 選取 “Asia/Taipei”
選擇套件群組 (Package Group Selection):
- 取消 “Classic X Window System”
redhat7、- 選取 “SQL Database Server”
- 選取 “Web Server”
- 選取 “DNS Name Server”
- 選取 “選擇個別套件 (Select individual packages)”
fedora linux。選擇個別套件 (Individual Package Selection):
Applications/Databases
- 選取 “mysql”
- 選取 “mysql-devel”
linux。- 選取 “mysql-server”
- 選取 “mysqlclient9″
- 取消 “postgresql”
- 取消 “postgresql-libs”
- 取消 “postgresql-server”
Development/Languages
- 選取 “perl-DBD-MySQL”
- 選取 “perl-suidperl”
- 選取 “php-mysql”
套件相依性 (Package Dependencies): 選取Do not install packages that have dependencies
然后等他安裝到好,重新開機之后,再登入系統。
安裝 qe
qe 是一個類似 pe2 的文字編輯器,讓你可以很容易上手。安裝步驟:
cd /tmp
wget http://here.vixual.net/files/linux/redhat7.3/qe/qe-0.2.0-3.i386.rpm
wget http://here.vixual.net/files/linux/redhat7.3/qe/qe.pro
rpm -ivh qe-0.2.0-3.i386.rpm
cp qe.pro /usr/share/qe/
安裝 Apt 并更新系統
Apt 可以讓你很方便地更新系統,或安裝其它套件。安裝步驟:
cd /tmp
wget http://here.vixual.net/files/linux/redhat7.3/apt-get/apt-0.5.5cnc5-fr0.rh73.2.i386.rpm
wget http://here.vixual.net/files/linux/redhat7.3/apt-get/apt-devel-0.5.5cnc5-fr0.rh73.2.i386.rpm
rpm -Uvh apt-0.5.5cnc5-fr0.rh73.2.i386.rpm
rpm -Uvh apt-devel-0.5.5cnc5-fr0.rh73.2.i386.rpm
第一次更新系統 (可能會花滿長一段時間喔):
apt-get update
apt-get -y upgrade
apt-get clean
要讓系統每周都能自動更新一次:
請于 [/etc/cron.weekly] 新增指令檔 “upgrade.sh”,內容如下:
#!/bin/bash
apt-get update
apt-get -y dist-upgrade
apt-get clean
更改檔案屬性為 755:
chmod 755 /etc/cron.weekly/upgrade.sh
安裝 IMap
IMap 讓你的系統有 POP3 及 IMap 的收信功能。使用 Apt 安裝本套件:
apt-get -y install imap
以一般用戶帳號代替 root 登入
新增一個一般用戶的帳號 “admin” (或你想用其它的帳號):
useradd admin
passwd admin
輸入兩次密碼即可完成。
將 root 的郵件轉寄給 admin,請編輯 /root/.forward,將內容改成:
admin
新增網站管理者帳號
新增一個 “webmaster” 帳號,用來管理網站:
useradd webmaster
passwd webmaster
將 “webmaster” 設為 [/var/www] 目錄的擁有者:
chown -R webmaster.webmaster /var/www
安裝 ProFTP
ProFTP 比系統的 WuFTP 安全性還要高,又容易設定,當然要安裝來用囉。同樣使用 Apt 安裝本套件:
apt-get -y install proftpd
設定用戶 webmaster 從 FTP 登入后,其根目錄為 [/var/www],其它用戶登入,其根目錄為自己的家目錄。請編輯 /etc/proftpd.conf,搜尋
DefaultRoot ~ !adm
改成:
DefaultRoot /var/www webmaster
DefaultRoot ~
安裝 WebMin
WebMin 是一套功能強大的 Linux 管理套件,可以讓你從瀏覽器管理系統。安裝步驟:
cd /tmp
wget http://here.vixual.net/files/linux/redhat7.3/webmin/webmin-1.180-1.noarch.rpm
rpm -ivh webmin-1.180-1.noarch.rpm
設定 SMTP 寄信認證
避免自己的服務器變成被別人亂寄垃圾信,所以要設寄信認證。設定步驟:
編輯 /etc/mail/sendmail.mc,搜尋:
dnl TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
改成 (將前面的 dnl 刪除):
TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
繼續搜尋:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
改成:
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')
重新制作 /etc/sendmail.cf:
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
以上的設定必須在下次重新啟動 sendmail 才會生效。
設定磁盤配額
如果要限制服務器上用戶的磁盤用量,就必須設定磁盤配額。請編輯 /etc/fstab,在欲設定磁盤配額的分割區加上兩個參數 “usrquota” 及 “grpquota”,例如:
LABEL=/home /home ext3 defaults 1 2
改成:
LABEL=/home /home ext3 defaults,usrquota,grpquota 1 2
以上的設定必須在下次重新開機才會生效。
更改系統啟動的服務項目
執行 “ntsysv”,僅允許下列的服務啟動:
- atd
- crond
- httpd
- ipop3
- iptables
- keytable
- mysqld
- named
- network
- proftpd
- random
- sendmail
- sshd
- syslog
- webmin
- xinetd
減少虛擬終端機數量
編輯 /etc/inittab,搜尋終端機設定,將項目 3 ~ 6 設為注解 (在前面加上 #):
# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6
增加網絡安全性
編輯 /etc/sysctl.conf,在最下面加入下列幾行:
# Enable ignoring ping request
net.ipv4.icmp_echo_ignore_all = 1
# Enable ignoring broadcasts request
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Disables IP source routing
net.ipv4.conf.all.accept_source_route = 0
# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies = 1
# Disable ICMP Redirect Acceptance
net.ipv4.conf.all.accept_redirects = 0
# Enable bad error message Protection
net.ipv4.icmp_ignore_bogus_error_responses = 1
# Enable IP spoofing protection, turn on Source Address Verification
net.ipv4.conf.all.rp_filter = 1
# Log Spoofed Packets, Source Routed Packets, Redirect Packets
net.ipv4.conf.all.log_martians = 0
重新開機
sync;sync;sync;reboot
變更郵件的目錄
為了要精確計算用戶的磁盤配額,所以必須把郵件的目錄移到 [/home]。執行步驟:
mv /var/spool/mail /home
ln -s /home/mail /var/spool/mail
掃描磁盤并啟用磁盤配額
quotacheck -avug
quotaon -av
時間同步
Ntp 可以讓系統與遠端的服務器對時,以調整服務器的時間。使用 Apt 安裝本套件:
apt-get -y install ntp
第一次對時:
ntpdate -s time.stdtime.gov.tw
hwclock --systohc
讓系統每天自動對時一次:
于 /etc/cron.daily/ 新增指令檔 “ntpdate.sh”,內容如下:
#!/bin/sh
ntpdate -s time.stdtime.gov.tw
hwclock --systohc
更改檔案屬性為 755:
chmod 755 /etc/cron.daily/ntpdate.sh
安裝 phpMyAdmin
phpMyAdmin 是一套很方便的 MySQL 數據庫管理程式。安裝步驟:
cd /tmp
wget http://here.vixual.net/files/linux/redhat7.3/phpMyAdmin/phpMyAdmin-2.5.5-pl1-tw.tgz
cd /var/www/html
tar -xzvf /tmp/phpMyAdmin-2.5.5-pl1-tw.tgz
變更 MySQL 的管理者密碼
使用下列指令進入 MySQL,并開啟 MySQL 的系統數據庫:
mysql mysql
于 MySQL 中,輸入下列指令變更 root 的密碼,并限定 root 只能從本機登入:
use mysql;
update user set password=password("新密碼") where user="root";
delete from user where user="root" and host<>"localhost";
delete from user where user="";
delete from db where user="";
flush privileges;
exit;
加強 ssh 的安全性
請編輯 /etc/ssh/sshd_config,搜尋相關字串,并做下列設定:
#限定用戶只能使用 SSH2 協定
Protocol 2
#禁止 root 使用 SSH 登入
PermitRootLogin no
#最多可以同時開啟 10 個連線要求
MaxStartups 10
欲從遠端登入系統時,請使用 admin 帳號,必要時,才用 “su -” 指令改為 root 執行。
安裝 Webmail
安裝 Mrtg
請參考 Archive2003060501 。
安裝完畢
線上系統管理(WebMin)網址: http://host.example.com:10000/
數據庫維護(phpMyAdmin)網址: http://host.example.com/phpMyAdmin/index.php
Open Webmail 網址: http://host.example.com/cgi-bin/openwebmail/openwebmail.pl
流量監控(Mrtg)網址: http://host.example.com/mrtg/index.html
磁盤配額的管理,請透過 WebMin。
請按贊:
喜歡 加載中...
相關
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态