MySQL Server 安裝後的設定

MySQL Server 安裝之後,除了要設定管理者 root 的密碼外,最好也要把一些用不到的資料庫 / 表加以移除,並加上一些權限的設定,這些繁雜的設定,可以使用 mysql_secure_installation 來解決。[@more@]# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we’ll need the current
password for the root user.  If you’ve just installed MySQL, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

# 輸入 root 的密碼,如果沒有設定過,直接按 Enter 鍵即可
Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

# 設定 root 的密碼
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 … Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

# 移除 anonymous 使用者
Remove anonymous users? [Y/n] y
 … Success!

Normally, root should only be allowed to connect from ‘localhost’.  This
ensures that someone cannot guess at the root password from the network.

# 取消 root 遠端登入
Disallow root login remotely? [Y/n] y
 … Success!

By default, MySQL comes with a database named ‘test’ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

# 移除 test 資料表
Remove test database and access to it? [Y/n] y
 – Dropping test database…
 … Success!
 – Removing privileges on test database…
 … Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

# 重新載入資料表權限
Reload privilege tables now? [Y/n] y
 … Success!

Cleaning up…

All done!  If you’ve completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

啟動 squid Proxy Server 出現的錯誤訊息

最近重新安裝一台 Server,安裝好 squid Proxy Server,按照之前的設定方式做了設定,啟動時卻一直出現錯誤。
# service squid start
正在啟動 squid:……………….. [失敗]

檢視 /var/log/message 中的訊息,發現如下的錯誤訊息
Sep 30 11:05:39 free squid[16500]: Squid Parent: child process 16516 started
Sep 30 11:05:39 free (squid): commonUfsDirOpenSwapLog: Failed to open swap log.
Sep 30 11:05:39 free squid[16500]: Squid Parent: child process 16516 exited with status 1
Sep 30 11:05:42 free squid[16500]: Squid Parent: child process 16522 started
Sep 30 11:05:43 free (squid): commonUfsDirOpenSwapLog: Failed to open swap log.
Sep 30 11:05:43 free squid[16500]: Squid Parent: child process 16522 exited with status 1
Sep 30 11:05:46 free squid[16500]: Squid Parent: child process 16529 started
Sep 30 11:05:46 free (squid): commonUfsDirOpenSwapLog: Failed to open swap log.
Sep 30 11:05:46 free squid[16500]: Squid Parent: child process 16529 exited with status 1
Sep 30 11:05:46 free squid[16500]: Exiting due to repeated, frequent failures

[@more@]解決的方式如下:
# vim /etc/squid/squid.conf
加入下面一行
 cache_swap_log /var/log/squid/swap.log squid

重新啟動 squid Proxy Server
 # service squid start
正在啟動 squid:.                                          [  確定  ]

安裝 EPSON Stylus Photo 1390 Series 噴墨網路印表機

學校辦公室使用的 EPSON Stylus Photo 1390 Series 噴墨印表機原本是接一台電腦上,然後用分享的方式來使用,但如果分享的電腦沒有開機,就會無法列印,而且分享的電腦主機執行速度會變慢,所以改用網路印表機的方式。
於是決定購買了零壹的 PU201 印表伺服器,來改善這樣的狀況。

底下是安裝的方式: [@more@]
以 Windows 7 為例:
1. 請下載公告上的EPSON Stylus Photo 1390 Series 驅動程式附檔,有分給 x86 和 x64,下載到桌面並解壓縮

2. 按 開始 設定 印表機

3. 在原本的印表機上 按滑鼠右鍵 ,選擇  刪除

4.   選擇  新增印表機 新增本機印表機

5. 選擇  建立新的連接埠 Standard TCP/IP Port 下一步

6. 在主機名稱或 IP 位址中,輸入 192.168.249.195 ,然後  下一步

7. 選擇  自訂 設定

8. 選擇  下一步

9.通訊協定選擇 LPR(L) ,佇列名稱輸入 USB ,最後按  確定

10. 選擇  下一步

11.  選擇  從磁片安裝

12. 選擇  瀏覽

13. 搜尋位置請選擇  桌面 ,在解壓縮出來的 目錄上按滑鼠二下

14.  目錄按二下

15.  選擇 E_DF1BXP_TAIWAN.IN F,然後  開啟

16. 按  確定

17. 選擇  下一步

18. 選擇  使用目前安裝的驅動式 下一步

19.  下一步

20.  下一步

22. 終於完成

安裝手續繁雜,如果有安裝上的問題,請洽資訊組代為協助,造成不便,請見諒!

安裝好 Linux Server 後畫面一直出現的訊息

最近因為之前的 Linux Server 硬碟似乎有些問題,所以安裝了硬碟,重新安裝作業系統,原本這一台 lvnovo Server 在 CentOS 5.x 時,會因為硬碟介面卡比較特別,所以會抓不到硬碟,所以用了一些很特殊的方式,才安裝好 CentOS 5,害我一直不敢升級核心及作業系統到 CentOS 6.x。
不過,在 CentOS 6.x 之後,似乎已經解決掉這個問題了,整個安裝都沒有問題,但安裝完之後,螢幕上卻一直出現如下的訊息:
drivers/hid/usbhid/hid-core.c: can’t reset device, 0000:00:1d.0-1.1.3/input0, status -71

在 Console 和遠端一直出現,讓我根本無法操作,原本以為是我安裝的問題,又重新安裝了一次,問題還是一樣,於是就到網路上找了一下,果然也有人和我一樣,碰到相同的問題。[@more@]解決方式:
# echo -1 >/sys/module/usbcore/parameters/autosuspend

加入到 /etc/rc.d/rc.local
# vim /etc/rc.d/rc.local
echo -1 >/sys/module/usbcore/parameters/autosuspend

後記:
後來發現一直出現錯誤訊息的原因,有可能是 Server 上同時接著 USB 和 PS2 的鍵盤,移除 USB 的鍵盤後,似乎就恢復正常了!

校內 IPv6 環境設定

在縣內 IPv6 導入學校之前,學校有幸得到宜蘭大學的協助,先進行 IPv6 的試行計劃,因為學校的網路環境比較特別,在經過一番設定和測試之後,所有的網路設備都能以 IPv6 的網路環境正常運作。

但因為伺服器故障及更替,所以有些設定就無法正常使用了,今天特別把它們重新設定完成。並根據 台中縣網的 IPv6 測試網站 ,建立 自己學校的測試網站
[@more@]目前學校的 IPv6 網段分配如下:
2001:288:a229::/48
2001:288:a229:1::/64  伺服器網段
2001:288:a229:2::/64  行政網路
2001:288:a229:3::/64  教學網路
2001:288:a229:4::/64  電腦教室

如果是以 IPv4 連線,則會看到黑白的圖

程式也會依照 IPv6 網段的不同,而顯示來自的不同網段

 

Adobe Flash Player & Java Runtime 更新

Adobe Flash Player 和 Java Runtime 更新,這二項軟體漏洞層出不窮,但不安裝時又不行。

Adobe Flash Player 11.8.800.168 for IE
http://download.macromedia.com/get/flashplayer/current/licensing/win/install_flash_player_11_active_x.exe
Adobe Flash Player 11.8.800.168 for All Other Browsers(Firefox,Safari & Opera)
http://download.macromedia.com/get/flashplayer/current/licensing/win/install_flash_player_11_plugin.exe

Java Runtime Environment 7 Update 40
http://www.java.com/zh_TW/download/manual.jsp

關於個人保管的財產

每個在學校任職的老師都會因為使用一些設備,而負有財產保管的責任,這個也是無法避免的事。
自己保持的一個信念就是,當自已因為職務離職時,一定會保管的財產交接清楚再行離職,因為自己不希望,離職之後還一直被問到關於財產的事。
不過也許是學校沿襲習慣的關係,我發覺這一種觀念並不是每個人都有,有些人離職之後常常財產並沒有移交清楚。也許是每個老師工作上都很忙碌,不清楚自己負責保管的是什麼東西,所以才會有這樣的問題,也有可能是我自己的問題,並沒有把每一項東西都跟老師解釋清楚,以致於老師不清楚用途,也疏於了解自己保管是哪些東西。

二台服役最久的伺服器終於掛點

學校的伺服器中,唯一只有二台是使用 SCSI 硬碟的伺服器,在服務 10 多年後,終於掛點了。
一台是放置學校全校授權光碟的伺服器,一台是放置一些舊的班級網頁的伺服器,不過還好的是,授權光碟伺服器的光碟 ISO 檔,剛做完備份不久,而放置舊的班級網頁那一台,則已經出現狀況很久了,在預料之中。

感覺這好像是人生一樣,總是有那些階段,也許該來的總是會來。

Snort Rule 更新

原本用來擔任入侵偵測系統的主機,是透過 oinkmaster 來更新 Snort Rule,不過最近(其實應該有一段時間了,只是自己懶惰,沒有積極處理),常常會在信箱收到如下的錯誤訊息:

 http://www.snort.org/pub-bin/oinkmaster.cgi/*oinkcode*/snortrules-snapshot-2860.tar.gzResolving www.snort.org… 23.23.143.164
Connecting to www.snort.org|23.23.143.164|:80… connected.
HTTP request sent, awaiting response… 403 Forbidden
2013-09-07 23:30:03 ERROR 403: Forbidden.

猜想可能是 Snort Rule 下載的路徑已經做了更改,所以登入 Snort 官方網站,終於找到了解決方式:[@more@]

修改 /etc/snort/oinkmaster.conf(路徑可能會依安裝的方式而有不同)
# vim /etc/snort/oinkmaster.conf
url = http://www.snort.org/pub-bin/oinkmaster.cgi/<oinkcode here>/snortrules-snapshot-2931.tar.gz

紅字的部分就是 oinkcode 碼

進行測試
# /usr/local/bin/oinkmaster.pl -C /etc/snort/oinkmaster.conf -o /etc/snort/rules/
Loading /etc/snort/oinkmaster.conf
Downloading file from http://www.snort.org/pub-bin/oinkmaster.cgi/*oinkcode*/snortrules-snapshot-2931.tar.gz…



  -> protocol-ftp.rules
    -> protocol-icmp.rules
    -> protocol-imap.rules
    -> protocol-nntp.rules
    -> protocol-pop.rules
    -> protocol-rpc.rules
    -> protocol-scada.rules
    -> protocol-services.rules
    -> protocol-snmp.rules
    -> protocol-telnet.rules
    -> protocol-tftp.rules
    -> protocol-voip.rules
    -> pua-adware.rules
    -> pua-other.rules
    -> pua-p2p.rules
    -> pua-toolbars.rules
    -> server-apache.rules
    -> server-iis.rules
    -> server-mail.rules
    -> server-mssql.rules
    -> server-mysql.rules
    -> server-oracle.rules
    -> server-other.rules
    -> server-samba.rules
    -> server-webapp.rules

OK,收工了!

Evernote 推出 Evernote 5

暑假期間去上了 Evernote 的課,覺得獲益菲淺,平時也會拿 Evernote 來做一些記錄。
目前 Evernote 推出了 Evernote 5,有興趣的人可以下載下來升級,我是比較習慣直接用 Web 版。
新功能介紹網頁:
http://evernote.com/intl/zh-tw/evernote/whats_new/windows/?utm_source=silverpop&utm_medium=email&utm_campaign=090313_windows_announce_zhtw

新版的介面

 

個人覺得 Evernote 是一項不錯的服務,也感謝縣網提供參加研習的老師一年份的專業版序號,希望這一項服務能長長久久,才不會整理了一堆資料後,突然不能用了。