2010年12月29日 星期三

Processmaker

OS:CentOS 5.5

Requirements:
httpd
php  php-devel  php-mysql
mysql  mysql-server
processmaker v1.6-427

1. 安裝相依套件
        yum  install  httpd  php  php-devel  php-mysql  mysql  mysql-server
        service  mysqld  start; chkconfig   mysqld  on
        mysqladmin  -u  root  password  '管理者密碼'

2. 修改processmaker組態
        cp  processmaker/etc/pmos.conf  /etc/httpd/conf.d/
        vi  /etc/httpd/conf.d/pmos.conf
        ...
        NameVirtualHost your_ip_address
        ...
        <VirtualHost your_ip_address >
        ServerName "your_processmaker_server"
        ...
        cp  -r  processmaker/  /opt/
        service  httpd  restart; chkconfig   httpd  on

3. 修改資料夾權限
        chmod  777  /opt/processmaker/compiled/
        chmod  777  /opt/processmaker/shared/
        chmod  -R  777  /opt/processmaker/workflow/

4. 圖形安裝processmaker
        開啟瀏覽器  http://your_processmaker_server
        確認沒有紅色的訊息













5. 安裝




安裝完成,點擊"Finish installation"即可切換登入頁








6. 登入預設帳號/密碼 (admin / admin)

2010年12月19日 星期日

Cacti Client 簡易設定 (二)

CentOS 5.5

1. 安裝SNMP
yum  install  net-snmp  net-snmp-utils  net-snmp-devel

2. 設定snmp
vi  /etc/snmp/snmpd.conf
view    systemview    included   .1.3.6.1.2.1
service  snmpd  start; chkconfig snmpd  on

3. 至cacti網站新增linux主機控管(Devices)














4. 手動新增"Associated Data Queries"






5. 建立圖表















6. 將剛建立的Devices加入Graph Trees瀏覽






7. 完成

Cacti Client 簡易設定 (一)

Windows server 2003

1. 安裝SNMP
新增/移除windows元件  -->  Management and Monitoring Tools















2. 開啟SNMP service,新建一個"群體"名稱



















3. 至cacti網站新增windows主機控管(Devices)














4. 建立之後,頁面左上角會出現建立圖表的連結






5. 選擇要建立監控資源的圖表












6. 將剛建立的Devices加入Graph Trees瀏覽







7. 完成

2010年12月18日 星期六

網管工具 - cacti

OS:CentOS 5.5

Requirement:
httpd
php  php-mysql  php-snmp  php-gd
mysql  mysql-server
cacti

1. 安裝相依套件
        yum  install httpd  php  php-mysql  mysql  mysql-server

2. 安裝Cacti
        rpm  -ivh  http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
        yum  install  cacti*

3. 建立cacti使用的資料庫
        service  mysqld  start
        mysqladmin  -u  root  password  '管理者密碼'
        mysql  -u  root  -p
        create  database  cacit;
        quit
        mysql  -u  root  -p  cacti  <  /var/www/cacti/cacti.sql
        mysql  -u  root  -p
        grant  all  on  cacti.*  to  cacti@localhost  identified  by  'cacti';
        flush  privileges;
        quit

4. 配置cacti組態檔
        vi  /var/www/cacti/include/config.php
        $database_type = "mysql";
        $database_default = "cacti";
        $database_hostname = "localhost";
        $database_username = "cacti";
        $database_password = "cacti";

5. 開啟瀏覽器,安裝cacti
http://localhost/cacti/



























6. 檢視相關設定是否正確

















7. 登入(預設 admin/admin),第一次登入會強制更改密碼














參考文章:
http://cacti.xxoo.net/
http://actychen.blogspot.com/2007/11/cacti-server.html

2010年12月14日 星期二

用微軟套件包兒裝Joomla

微軟推出套件包這已不是現在式,
但是這東西真不錯用,
現在除了Appserv外又有新選擇"WebPI"

OS:windows server 2003 sp2

0. 在安裝webPI前建議將OS升級至目前最新版本

1. 下載webPI安裝檔,安裝webPI
http://www.microsoft.com/web/downloads/platform.aspx

2. 使用webPI自動安裝Joomla

























3. 輸入資料庫(MySQL)管理者密碼















4. 完成















5. 測試 -- 前台











6. 測試 -- 後台














參考文章:
http://www.microsoft.com/web/downloads/platform.aspx
http://easyhost.tw/node/8

2010年12月2日 星期四

舊內容新包裝 - JAWStats

OS:CentOS 5.5

Requirment:
httpd
php  php-mysql  php-devel
mysql  mysql-server
awstats
jawstats

1. 安裝相依套件
        yum  install  httpd  php  php-devel  php-mysql  mysql  mysql-server

2. 設定Apache,並開機啟動
        vi  /etc/httpd/conf/httpd.conf
        ServerTokens  Prod
        KeepAlive  On
        MaxKeepAliveRequests  500
        <Directory  "/var/www/html">
             Options  FollowSymLinks
        </Directory>
        AddHandler  cgi-script  .cgi  .pl
        /etc/init.d/httpd  restart; chkconfig  httpd  on

3. 設定MySQL,並開機啟動
        /etc/init.d/mysqld  restart
        mysqladmin  -u  root  password  '管理者密碼'
        chkconfig  mysqld  on

4. 下載Awstats程式,並安裝
        wget  http://prdownloads.sourceforge.net/awstats/awstats-7.0-1.noarch.rpm
        rpm  -qpR  awstats-7.0-1.noarch.rpm
        rpm  -ivh  awstats-7.0-1.noarch.rpm

5. 配置Awstats
        cp  /usr/local/awstats/tools/httpd_conf  /etc/httpd/conf.d/awstats.conf
        cd  /etc/awstats/
        cp  awstats.model.conf  awstats.localhost.conf
        vi  /etc/awstats/awstats.localhost.conf
        LogFile="/var/log/httpd/access_log"
        LogType=W
        LogFormat=1
        SiteDomain="localhost"
        HostAliases="localhost 127.0.0.1 REGEX[myserver\.com$]"
        Lang="tw"

6. 執行Awstats網站分析
        perl  /usr/local/awstats/wwwroot/cgi-bin/awstats.pl  -config=localhost

7. 測試,排成自動分析
開啟瀏覽器  http://your web server/awstats/awstats.pl?config=localhost
crontab  -e
0 3 * * * /usr/bin/perl  /usr/local/awstats/wwwroot/cgi-bin/awstats.pl  -config=localhost  -update
      
8. 安裝JAWStats
        cd  ~
        wget  http://static.jawstats.com/src/archive/jawstats-0.6beta.tar.gz
        mkdir  /var/www/html/jawstats
        tar  -zxvf  jawstats-0.6beta.tar.gz  -C  /var/www/html/jawstats

9. 配置JAWStats
        cd  /var/www/html/jawstats
        cp  config.dist.php  config.php
        vi  config.php
        <?php
          // core config parameters
          $sDefaultLanguage      = "zh-tw";
          ...
          // individual site configuration
          $aConfig["localhost"] = array(
            "statspath"   => "/usr/local/awstats/wwwroot/cgi-bin/",
            "siteurl"     => "http://localhost",
            "sitename"    => "localhost"
            "language"    => "zh-tw"
          );
        ...
        ?>

10. 測試
        開啟瀏覽器  http://your web server/jawstats

參考文章:
http://linux.vbird.org/linux_server/0360apache.php
http://awstats.sourceforge.net/
http://www.jawstats.com/
http://ssorc.tw/rewrite.php/read-1110.html
http://www.jefflei.com/post/906.html

Tomcat + SSL

今天介紹安全的tomcat,
因為tomcat是使用java語法,所以需要java的環境,
因為要做的是"安全的"tomcat,所以需要SSL支援。

OS:CentOS 5.5

Requirment:
JDK
tomcat
openssl  openssl-devel

1. 安裝JAVA環境
請至JAVA下載JDK最新程式
chmod  +x  jdk-6u22-linux-i586-rpm.bin
./jdk-6u22-linux-i586-rpm.bin

2. 設定環境變數
vi  /etc/profile
...
JAVA_HOME=/usr/java/jdk1.6.0_22/
export  JAVA_HOME
...
source  /etc/profile
java  -version

3. 安裝Tomcat
wget  http://ftp.asia.edu.tw/ftp/Apache/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
tar  -zxvf  apache-tomcat-6.0.29.tar.gz
mv  apache-tomcat-6.0.29 /usr/local/

4. 啟動Tomcat,測試
/usr/local/apache-tomcat-6.0.29/bin/startup.sh
開啟瀏覽器  http://your tomcat server:8080/

5. 設定tomcat manager管理者帳號密碼
/usr/local/apache-tomcat-6.0.29/bin/shutdown.sh
vi  tomcat-users.xml
...
<role rolename="manager"/>
<user username="admin" password="iproyaya" roles="manager"/>
</tomcat-users>
/usr/local/apache-tomcat-6.0.29/bin/startup.sh
開啟瀏覽器  http://your tomcat server:8080/manager/html

6. 安裝OpenSSL
yum  install  openssl  openssl-devel

7. 建立Tomcat使用的憑證
/usr/local/apache-tomcat-6.0.29/bin/shutdown.sh
/usr/java/jdk1.6.0_22/bin/keytool  -genkey  -alias  tomcat  -keyalg  RSA
輸入 keystore 密碼:  
重新輸入新密碼: 
您的名字與姓氏為何?
  [Unknown]:localhost  
您的編制單位名稱為何?
  [Unknown]:  
您的組織名稱為何?
  [Unknown]:  
您所在的城市或地區名稱為何?
  [Unknown]:  
您所在的州及省份名稱為何?
  [Unknown]:  
該單位的二字國碼為何
  [Unknown]:  
CN=localhost, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown 正確嗎?
  [否]:  y
輸入 <tomcat> 的主密碼
(RETURN 如果和 keystore 密碼相同):

8. 開啟Tomcat SSL機制
vi  /usr/local/apache-tomcat-6.0.29/conf/server.xml
...
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
SSLEnabled="true"
keystoreFile="/usr/local/apache-tomcat-5.5.27/conf/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS" />
...

9. 重新啟動Tomcat,驗證
/usr/local/apache-tomcat-6.0.29/bin/startup.sh
netstat  -tnulp  |  grep  8443
開啟瀏覽器  https://your tomcat server:8443/

參考文章:

2010年12月1日 星期三

FreeRADIUS + AD 帳號驗證

今天終於完成 radius + AD 的帳號驗證
趕快記下來~


OS:CentOS 5.5


環境說明;
Domain:TEST.COM
DC:dc.test.com (192.168.173.104)
Radius:rads.test.com (192.168.173.103)


Requirment:
samba
krb5-server
freeradius2  freeradius2-utils


1. 設定主機對應IP
        vi  /etc/sysconfig/network
        HOSTNAME=rads.test.com
        vi  /etc/hosts
        192.168.173.104         dc.test.com
        192.168.173.103         rads.test.com


2. 設定Samba作為對AD的溝通橋樑
        yum  install  samba
        vi  /etc/samba/smb.conf
        [global]
        workgroup = test
        realm = TEST.COM
        netbios name = rads
        security = ads
        password server = dc.test.com  [DC的FQDN]
        winbind separator = +
        idmap uid = 10000-20000  [設定網域帳號id範圍]
        idmap gid = 10000-20000  [設定網域群組id範圍]
        winbind enum users = yes
        winbind enum groups = yes
        nt acl support = yes
        winbind cache time = 0
        template shell = /bin/bash
        template homedir = /home/%U
        winbind use default domain = yes


3. 設定kerberos認證機制,AD使用kerberos認證機制
        vi  /etc/krb5.conf
        ...
        [libdefaults]
        default_realm = TEST.COM
        dns_lookup_realm = false
        dns_lookup_kdc = false
        ticket_lifetime = 24h
        forwardable = yes


        [realms]
        TEST.COM = {
        kdc = dc.test.com:88
        admin_server = dc.test.com:749
        default_domain = test.com
        }


        [domain_realm]
        .example.com = EXAMPLE.COM
        example.com = TEST.COM
        ...
        yum  install  krb5-server
        vi  /var/kerberos/krb5kdc/kdc.conf
        ...
        [realms]
        TEST.COM = {
        ...


4. 測試Samba與kdc是否可以正常溝通
        kinit  administrator@TEST.COM


5. 將Radius Server加入Domain
        /etc/init.d/smb  start; chkconfig smb on
        net  rpc  join  -U  administrator














6. 修改系統帳號驗證
        vi  /etc/nsswitch.conf
        passwd:     files winbind
        shadow:     files winbind
        group:      files winbind


7. 檢驗是否有匯入AD帳號
        /etc/init.d/winbind  start; chkconfig winbind on
        wbinfo  -u  (或是 getent  passwd)
        ntlm_auth  --request-nt-key  --domain=TEST  --username=administrator  --password=AD管理者密碼


8. 安裝FreeRADIUS套件
        yum  install  freeradius2  freeradius2-utils


9. 加入ntlm_auth驗證模組至radius
        vi  /etc/raddb/modules/ntlm_auth
        exec ntlm_auth {
           wait = yes
           program = "/path/to/ntlm_auth --request-nt-key --domain=TEST --username=%{mschap:User-Name} --password=%{User-Password}"
        }

10. 修改radius驗證機制
        vi  /etc/raddb/sites-enabled/default
        authenticate {
        ...
        ntlm_auth
        ...
        }
        vi  /etc/raddb/sites-enabled/inner-tunnel
        authenticate {
        ...
        ntlm_auth
        ...
        }

11. 修改/etc/raddb/users
        DEFAULT     Auth-Type = ntlm_auth

12. 測試帳號驗證機制
        radiusd  -X
        radtest user password localhost 0 testing123