分類彙整:Linux

CentOS vsftpd FTP Server 安裝設定

安裝 vsftpd yum install vsftpd 編輯 vsftpd 設定檔 vi /etc/vsftpd/vsftpd.conf 伺服器環境有關的設定: use_localtime=YES connect_from_port_20=YES listen=YES #使用 stand alone 方式啟動 vsftpd ftpd_banner=文字說明 banner_file=/path/file #指定純文字檔作為使用者登入伺服器時所顯示的歡迎訊息connect_timeout=60 data_connection_timeout=300 idle_session_timeout=300  max_clients=10 #設定同一時間,最多有多少 client max_per_ip=3 #同一個 IP 同一時間可允許多少連線 local_max_rate=1000000 #限制實體用戶的下載流量,單位是 bytes/second pasv_enable=YES pasv_min_port=65400 pasv_max_port=65410 #使用 65400 到 … 繼續閱讀

發表於 Linux, Server | 發表迴響

IIS 7.5 + PHP5 + MySQL + SQLSRV 3.0

Server環境: Windows server 2008 R2 sp1 x64 安裝 Microsoft SQL Server 2012 Native Client x64 安裝 dotNetFramework_4_Full_x86_x64.exe 安裝 ODBC:mysql-connector-odbc-5.1.11-winx64.msi (非必要) MySQL安裝: 安裝mysql-installer-community-5.5.27.2.msi 安裝PHP for Windows: 下載 php-5.3.17-nts-Win32-VC9-x86.msi:http://windows.php.net/download/ 安裝 php-5.3.17-nts-Win32-VC9-x86.msi,選擇 fastcgi 安裝到 C:\PHP\ 1. 這是php的安裝包,單純安裝並不能運行php,還需要伺服器(IIS、Apache等)的支援。 2. nts,也就是None-Thread Safe即非執行緒安全,在執行時不進行執行緒(thread)安全檢查反之,Thread Safe就是執行緒安全,執行時會進行執行緒(thread)安全檢查,以防止有新要求就啟動新執行緒的 CGI 執行方式耗盡系統資源。 … 繼續閱讀

發表於 Server, 未分類 | 發表迴響

LAMP安裝

yum –y update shutdown –r now 設定iptables 時間校正 yum –y install ntp 安裝ntp套件 ntpdate –u time.stdtime.gov.tw ; /sbin/hwclock -w 校正系統時間,並同步寫入bios 安裝apache、php、mysql yum –y install httpd php mysql mysql-server php-mysql php-gd php-mbstring php-mcrypt Apache設定 vi /etc/httpd/conf/httpd.conf 將ServerTokens 的OS改為Prod chkconfig httpd on … 繼續閱讀

發表於 Server | 發表迴響

Postfix 郵件 Log 分析工具 pflogsumm

安裝 yum -y install postfix-pflogsumm 分析今天 pflogsumm -d today /var/log/maillog 分析昨天 pflogsumm -d yesterday /var/log/maillog 分析全部 pflogsumm /var/log/maillog 分析多檔 pflogsumm /var/log/maillog /var/log/maillog.1 分析 postfix今天的 maillog,並且寄信通知 pflogsumm -d today /var/log/mailllog | mail -s ‘郵件主旨’ user@localhost ex. pflogsumm -d today /var/log/mailllog | … 繼續閱讀

發表於 Linux | 發表迴響

CentOS 6.2 網卡安裝"Error, some other host already uses address"解決辦法

vi /etc/sysconfig/network-scripts/ifup-eth 註解掉下面的内容,然后再執行ifup eth0 if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then echo {1}quot;Error, some other host already uses address ${IPADDR}." exit 1 fi 改為 #if ! /sbin/arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR} ; then #   echo {1}quot;Error, some other host already uses address ${IPADDR}." #   exit 1 #fi  

發表於 Linux | 發表迴響

Linux 常用指令

系統類 指令 說明 範例 setup 系統設定工具 chkconfig 管理系統服務預設開機啟動與否 chkconfig –list | more top 動態觀察程序的變化 top -d 1 ps 系統的行程表 pstree 列出目前系統上面所有的程序樹的相關性 pstree -Aup cat /etc/services service –status-all 網路類 指令 說明 範例 ifconfig 看 IP 和網路介面卡 ifup 或 ifdown 啟動 / … 繼續閱讀

發表於 Linux | 發表迴響

iptables

vi /etc/sysconfig/iptables # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j … 繼續閱讀

發表於 Linux | 發表迴響

CentOS 6.2 Mail建置流程 Postfix+dovecot

關閉SELinux vi /etc/sysconfig/selinux SELINUX=enforcing 改成 SELINUX=disabled 設定yum vi /etc/yum.repos.d/CentOS-Base.repo 利用vi搜尋/取代功能 :%s/mirror.centos.org\/centos/ftp.isu.edu.tw\/pub\/Linux\/CentOS/g :%s/mirrorlist/#mirrorlist/g :%s/#baseurl/baseurl/g 設定完後,執行: yum –y update 立即更新系統套件 完成後請重新開機 shutdown –r now 網路校時 yum -y install ntp 安裝NTP /usr/sbin/ntpdate tock.stdtime.gov.tw 執行網路校時 /usr/sbin/hwclock -w 將時間寫入BIOS vi /etc/crontab 01 5 * * … 繼續閱讀

發表於 Server | 發表迴響

Test a POP server by using telnet

telnet: > telnet localhost pop3 telnet: Trying 192.168.1.X telnet: Connected to pop.example.com. telnet: Escape character is ‘^]’. server: +OK InterMail POP3 server ready. client: USER MyUsername server: +OK please send PASS command client: PASS MyPassword server: +OK MyUsername is welcome … 繼續閱讀

發表於 Linux | 發表迴響

新增與刪除使用者

useradd USERNAME       增加一名為USERNAME的帳號 userdel USERNAME        刪除USERNAME這個帳號 [root@localhost ~]# useradd power "useradd" 跟 "userdel" 這兩個指令都只有 root 可以使用 passwd [USERNAME]    更改USERNAME的密碼,若無參數,則改自己的密碼。 [root@localhost ~]# passwd power Changing password for user power New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated … 繼續閱讀

發表於 Linux | 發表迴響