維護記錄

出自金門農工維基館II
跳至導覽 跳至搜尋

湖濱散記II,2021升學專區,IT,UbuntuLinuxPos,山行,wiki語法練習區,文書技藝競賽,金門農工首頁,學生學習歷程系統, 維護記錄,lfDBParse,gtk9h.c

20201015-1217維護記錄

維護記錄

20120712 安裝圖形驗證碼Captcha


(一)察看版本:http://insecta.idv.tw/wiki/index.php/%E7%89%B9%E6%AE%8A:Version
:
產品 	版本
MediaWiki 	1.13.0
PHP 	5.2.6 (apache2handler)
MySQL 	5.0.27-log

(二)下載ConfirmEdit-MW1.13-37906.tar.gz
-bash-3.2# wget http://upload.wikimedia.org/ext-dist/ConfirmEdit-MW1.13-37906.tar.gz
:

2012-07-12 15:13:04 (128 KB/s) -- 已儲存 ‘ConfirmEdit-MW1.13-37906.tar.gz’ [122110/122110])

-bash-3.2#

(三)察看已安裝的extensions
-bash-3.2# pwd
/usr/local/apache2/htdocs/wiki
-bash-3.2# ls extensions
audio_player  flashmp3.php  GoogleMaps  README  slider
(四)解壓並移動目錄
-bash-3.2# tar xvzf ConfirmEdit-MW1.13-37906.tar.gz
ConfirmEdit/
ConfirmEdit/ConfirmEdit.php
ConfirmEdit/captcha.py
ConfirmEdit/MathCaptcha
ConfirmEdit/MathCaptcha.php
ConfirmEdit/FancyCaptcha.i18n.php
ConfirmEdit/FancyCaptcha.class.php
ConfirmEdit/MathCaptcha.class.php
ConfirmEdit/FancyCaptcha.php
ConfirmEdit/ConfirmEdit.i18n.php
ConfirmEdit/ConfirmEdit_body.php
-bash-3.2# mv ConfirmEdit extensions/
-bash-3.2#

(五)編輯LocalSettings.php:
-bash-3.2# vi LocalSettings.php
:
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );
$wgCaptchaClass = 'SimpleCaptcha';
-bash-3.2#

(六)重新啟動httpd
-bash-3.2# /usr/local/apache2/bin/httpd -k stop
-bash-3.2# ps ax|grep httpd
14638 pts/1    S+     0:00 grep httpd
-bash-3.2# /usr/local/apache2/bin/httpd -k start
-bash-3.2#
(七)SimpleCaptcha在註冊頁面已可運作。


20110414設定主機DNS

-bash-3.2# vi /etc/resolv.conf
-bash-3.2# cat /etc/resolv.conf
search idv.tw
nameserver 168.95.1.1
nameserver 168.95.192.1

20100402設定頁面編輯權限

login as: webadm
webadm@insecta.idv.tw's password: ************
Last login: Thu Apr  1 19:39:22 2010 from insecta.idv.tw
-bash-3.2#
-bash-3.2# cd wiki
-bash-3.2# vi LocalSettings.php
:
Restrict anonymous editing

$wgGroupPermissions['*']['edit'] = false;

:
-bash-3.2#

20100120查看database

-bash-3.2# ./mysql -p -uroot
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 987255 to server version: 5.0.27-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use insectawikidb;
Database changed
mysql> show tables;
+-------------------------+
| Tables_in_insectawikidb |
+-------------------------+
| mw_archive              |
| mw_category             |
| mw_categorylinks        |
| mw_externallinks        |
| mw_filearchive          |
| mw_hitcounter           |
| mw_image                |
| mw_imagelinks           |
| mw_interwiki            |
| mw_ipblocks             |
| mw_job                  |
| mw_langlinks            |
| mw_logging              |
| mw_math                 |
| mw_objectcache          |
| mw_oldimage             |
| mw_page                 |
| mw_page_props           |
| mw_page_restrictions    |
| mw_pagelinks            |
| mw_protected_titles     |
| mw_querycache           |
| mw_querycache_info      |
| mw_querycachetwo        |
| mw_recentchanges        |
| mw_redirect             |
| mw_revision             |
| mw_searchindex          |
| mw_site_stats           |
| mw_templatelinks        |
| mw_text                 |
| mw_trackbacks           |
| mw_transcache           |
| mw_updatelog            |
| mw_user                 |
| mw_user_groups          |
| mw_user_newtalk         |
| mw_watchlist            |
+-------------------------+
38 rows in set (0.03 sec)

mysql> mysql> desc mw_user;
+--------------------------+------------------+------+-----+----------------------------------+----------------+
| Field                    | Type             | Null | Key | Default                          | Extra          |
+--------------------------+------------------+------+-----+----------------------------------+----------------+
| user_id                  | int(10) unsigned | NO   | PRI | NULL                             | auto_increment |
| user_name                | varbinary(255)   | NO   | UNI |                                  |                |
| user_real_name           | varbinary(255)   | NO   |     |                                  |                |
| user_password            | tinyblob         | NO   |     |                                  |                |
| user_newpassword         | tinyblob         | NO   |     |                                  |                |
| user_newpass_time        | binary(14)       | YES  |     | NULL                             |                |
| user_email               | tinyblob         | NO   |     |                                  |                |
| user_options             | blob             | NO   |     |                                  |                |
| user_touched             | binary(14)       | NO   |     |                                  |                |
| user_token               | binary(32)       | NO   |     |                                  |                |
| user_email_authenticated | binary(14)       | YES  |     | NULL                             |                |
| user_email_token         | binary(32)       | YES  | MUL | NULL                             |                |
| user_email_token_expires | binary(14)       | YES  |     | NULL                             |                |
| user_registration        | binary(14)       | YES  |     | NULL                             |                |
| user_editcount           | int(11)          | YES  |     | NULL                             |                |
+--------------------------+------------------+------+-----+----------------------------------+----------------+
15 rows in set (0.03 sec)

mysql>

mysql> select user_id,user_name,user_email,user_editcount from mw_user order by user_editcount desc;
+---------+--------------------+--------------------------------+----------------+
| user_id | user_name          | user_email                     | user_editcount |
+---------+--------------------+--------------------------------+----------------+
|       2 | Wsn                | ?????????????????              |          19506 |
|      16 | Msnhinet8          | ?????????????????              |            280 |
|       1 | Root               |                                |            202 |
|       3 | Jason              |                                |            195 |
:
:
:
+---------+--------------------+--------------------------------+----------------+
112 rows in set (0.00 sec)

mysql>


20100104安裝Awstats 6.95版

(一)登入系統並下載awstats-6.5.zip

-bash-3.2# date
一  1月  4 23:28:10 CST 2010
-bash-3.2# pwd
/usr/local/apache2/htdocs
-bash-3.2# wget http://prdownloads.sourceforge.net/awstats/awstats-6.95.zip


(二)解開並查看說明


-bash-3.2# unzip awstats-6.95.zip
-bash-3.2# ls awstats-6.95
docs  README.TXT  tools  wwwroot


-bash-3.2# cat awstats-6.95/README.TXT
:
I - 1) Features

        A full log analysis enables AWStats to show you the following information:
        * Number of VISITS and UNIQUE VISITORS
        * Visits duration and last visits
        * Authenticated users, and last authenticated visits
        * Days of week and rush hours (pages, hits, KB for each day and hour)
        * Domains/countries of hosts visitors (pages, hits, KB)
        * Hosts list, last visits and unresolved IP addresses list
        * Most viewed, entry and exit pages
        * File types
        * Web compression statistics (for mod_gzip or mod_deflate)
        * Browsers used (pages, hits, kb for each browser)
        * OS used (pages, hits, KB for each OS)
        * Robot visits
        * Worm attacks
        * Search engines, keyphrases and keywords used to find your site
        * HTTP errors (Page not found with last referer, etc,)
        * Screen size report
        * Number of times your site is "added to favourites bookmarks"
        * Ratio of Browsers that support: Java, Flash, RealG2 reader,
          Quicktime reader, WMA reader, PDF reader
        * Cluster report for load balanced servers ratio
        * Other personalized reports...

        It supports the following features as well:
        * Can analyze all log formats
        * Works from command line and from a browser as a CGI (with dynamic
          filters capabilities for some charts)
        * Update of statistics can be made on demand from the web interface and
          not only from your scheduler
        * Unlimited log file size, support split log files (load balancing system)
        * Support 'nearly sorted' log files even for entry and exit pages
        * Reverse DNS lookup before or during analysis, supports DNS cache files
        * Country detection from IP location or domain name
        * WhoIS links
        * A lot of options/filters and plugins can be used
        * Multi-named web sites supported (virtual servers)
        * Cross Site Scripting Attacks protection
        * Several languages
        * No need of rare perl libraries
        * Dynamic reports as CGI output
        * Static reports in one or framed HTML or XHTML pages
        * Experimental PDF export
        * Look and colors can match your site design (CSS)
        * Help and tooltips on HTML reported pages
        * Easy to use (Just one configuration file to edit)
        * Analysis database can be stored in XML format (for XSLT processing, ...)
        * A Webmin module
        * Free (GNU GPL) with sources (perl scripts)
        * Available on all platforms

:

I - 3) Files

        The distribution of AWStats package includes the following files:
        README.TXT                          This file
        docs/LICENSE                        GNU General Public Licence
        docs/*                              AWStats documentation (setup/usage...)
        wwwroot/cgi-bin/awstats.pl          THE MAIN AWSTATS PROGRAM (CLI/CGI)
        wwwroot/cgi-bin/awredir.pl          A tool to track exit clicks
        wwwroot/cgi-bin/awstats.model.conf  An model configuration file
        wwwroot/cgi-bin/lang                Directory with languages files
        wwwroot/cgi-bin/lib                 Directory with awstats reference info
        wwwroot/cgi-bin/plugins             Directory with optional plugins
        wwwroot/icon/browser                Directory with browsers icons
        wwwroot/icon/clock                  Directory with clock icons
        wwwroot/icon/cpu                    Directory with cpu icons
        wwwroot/icon/flags                  Directory with country flag icons
        wwwroot/icon/os                     Directory with OS icons
        wwwroot/icon/other                  Directory with all others icons
        wwwroot/classes                     Java applet for graphapplet plugin
        wwwroot/css                         Samples of CSS files
        wwwroot/js                          Javascript sources for "Misc" feature
        tools/*                             Other provided tools
        tools/webmin/awstats-x.x.wbm        A Webmin module for AWStats
        tools/xslt/awstats61.xsd            AWStats XML database schema descriptor
        tools/xslt/*                        Demo to manipulate AWStats XML database

(三)查看解開的資料夾內容
-bash-3.2# ls awstats-6.95
docs  README.TXT  tools  wwwroot
-bash-3.2# ls awstats-6.95/docs
awstats_benchmark.html  awstats_contrib.html   awstats_license.html   awstats_tools.html    COPYING.TXT  pad_awstats.htm
awstats_changelog.txt   awstats_extra.html     awstats.pdf            awstats_upgrade.html  images       pad_awstats.xml
awstats_compare.html    awstats_faq.html       awstats_security.html  awstats_webmin.html   index.html   styles.css
awstats_config.html     awstats_glossary.html  awstats_setup.html     awstats_what.html     LICENSE.TXT
-bash-3.2# ls awstats-6.95/tools
awstats_buildstaticpages.pl  awstats_exportlib.pl  httpd_conf          maillogconvert.pl   webmin
awstats_configure.pl         awstats_updateall.pl  logresolvemerge.pl  urlaliasbuilder.pl  xslt
-bash-3.2# ls awstats-6.95/wwwroot/
cgi-bin  classes  css  icon  js
-bash-3.2# ls awstats-6.95/wwwroot/cgi-bin/
awredir.pl  awstats.model.conf  awstats.pl  lang  lib  plugins
-bash-3.2#

(四)列出apache webserver 的log目錄
-bash-3.2# ls /usr/local/apache2/logs -l
總計 4891280
-rw-r--r-- 1 root root   57927153 2010-01-04 23:31 access_log
-rw-r--r-- 1 root root 4807109220 2009-12-31 06:36 access_log20091231
-rw-r--r-- 1 root root   15979209 2010-01-01 07:29 access_log_20100101
-rw-r--r-- 1 root root  122720448 2010-01-04 23:30 error_log
-rw-r--r-- 1 root root          6 2010-01-01 07:30 httpd.pid
-bash-3.2#


(五)移動awstats-6.95到/usr/local並改名為awstats

-bash-3.2# mv awstats-6.95 /usr/local

-bash-3.2# unzip awstats-6.95.zip

-bash-3.2# cd /usr/local
-bash-3.2# mv awstats awstats-6.5
-bash-3.2# mv awstats-6.95 awstats
-bash-3.2#

(六)執行安裝設定 perl awstats_configure.pl

-bash-3.2# cd /etc/awstats/
-bash-3.2# ls
awstats.insecta.idv.tw.conf
-bash-3.2# mv awstats.insecta.idv.tw.conf awstats.insecta.idv.tw.conf.65
-bash-3.2#


[root@localhost local]#  cd /usr/local/awstats/tools/
-bash-3.2# perl awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.8) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install
  Found Web server Apache config file '/usr/local/apache2/conf/httpd.conf'

-----> Check and complete web server config file '/usr/local/apache2/conf/httpd.conf'
  All AWStats directives are already present.

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> insecta.idv.tw

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>
Warning: A config file for this name already exists. Choose another one.
Your web site, virtual server or profile name:
> insecta.idv.tw

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.insecta.idv.tw.conf'
 Config file /etc/awstats/awstats.insecta.idv.tw.conf created.

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...


A SIMPLE config file has been created: /etc/awstats/awstats.insecta.idv.tw.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'insecta.idv.tw' with command:
> perl awstats.pl -update -config=insecta.idv.tw
You can also read your statistics for 'insecta.idv.tw' with URL:
> http://localhost/awstats/awstats.pl?config=insecta.idv.tw

Press ENTER to finish...

-bash-3.2#


(七)察看apache設定檔的新增內容
[root@localhost tools]# cat /usr/local/apache2/conf/httpd.conf

:
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>




(八)察看/usr/local/awstats/wwwroot/cgi-bin的pl CGI程式

-bash-3.2# ls /usr/local/awstats/wwwroot/cgi-bin
awredir.pl  awstats.model.conf  awstats.pl  lang  lib  plugins
-bash-3.2#




(九a)執行awstats記錄檔更新程式
-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Create/Update database for config "/etc/awstats/awstats.insecta.idv.tw.conf" by AWStats version 6.95 (build 1.943)
From data in log file "/var/log/httpd/mylog.log"...
Error: Couldn't open server log file "/var/log/httpd/mylog.log" : 沒有此一檔案或目錄
Setup ('/etc/awstats/awstats.insecta.idv.tw.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
-bash-3.2#



(九b)改錯,再執行awstats記錄檔更新程式
-bash-3.2# vi /etc/awstats/awstats.insecta.idv.tw.conf


:
LogFile="/usr/local/apache2/logs/access_log"
:
LogFormat=1
:
DNSLookup=1
:
LoadPlugin="decodeutfkeys"
:
AllowFullYearView=3
:

-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Create/Update database for config "/etc/awstats/awstats.insecta.idv.tw.conf" by AWStats version 6.95 (build 1.943)
From data in log file "/usr/local/apache2/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 122781)
Reverse DNS lookup for ::1 not available without ipv6 plugin enabled.
Jumped lines in file: 122781
 Found 122781 already parsed records.
Parsed lines in file: 32493
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 32493 new qualified records.
-bash-3.2#


(十a)修改排程使系統每天早上六點自動執行分析 Web Log 的工作
[root@localhost tools]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@localhost tools]# crontab -l
0 6 * * * perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=210.59.1.13 -update > /dev/null 2>&1
[root@localhost tools]#


(十b)察看產生的awstats記錄檔
-bash-3.2# ls /var/lib/awstats -l
總計 24244
-rw-r--r-- 1 root root  692072 2009-12-29 22:39 awstats012009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  235075 2010-01-04 23:48 awstats012010.insecta.idv.tw.txt
-rw-r--r-- 1 root root  686036 2009-12-29 23:03 awstats022009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  960450 2009-12-29 23:58 awstats032009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1602099 2009-12-30 01:05 awstats042009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 2057362 2009-12-30 16:22 awstats052009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1911232 2009-12-30 19:51 awstats062009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 2324327 2009-12-30 22:26 awstats072009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  234618 2009-12-29 20:46 awstats082008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1979914 2009-12-31 00:26 awstats082009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1027005 2009-12-29 21:11 awstats092008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1505939 2009-12-31 01:32 awstats092009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  807608 2009-12-29 21:37 awstats102008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1711409 2009-12-31 02:36 awstats102009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  781808 2009-12-29 21:59 awstats112008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1603964 2009-12-31 03:29 awstats112009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  699771 2009-12-29 22:24 awstats122008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 3869527 2010-01-01 07:27 awstats122009.insecta.idv.tw.txt
drwxr-xr-x 2 root root    4096 2009-12-31 06:40 backup
-rw-r--r-- 1 root root   23759 2010-01-04 23:48 dnscachelastupdate.insecta.idv.tw.txt
-bash-3.2#


(十一)修改awstats.pl的執行權限
-bash-3.2# chmod 777 /usr/local/awstats/wwwroot/cgi-bin/awstats.pl
-bash-3.2#

(十二) 察看結果 http://insecta.idv.tw/awstats/awstats.pl?config=insecta.idv.tw

200100101設定MP3支援

-bash-3.2# pwd
/usr/local/apache2/htdocs/wiki
-bash-3.2# date
五  1月  1 07:44:39 CST 2010
-bash-3.2# wget http://www.1pixelout.net/download/audio-player.zip
-bash-3.2# vi flashmp3.php
:
內容拷自http://www.mediawiki.org/wiki/Extension:FlashMP3
:
-bash-3.2# mv flashmp3.php extensions
-bash-3.2#

-bash-3.2# vi LocalSettings.php
:
$wgFileExtensions[] = 'mp3';
require_once('extensions/flashmp3.php');
$wgMaxUploadSize = '3MB';

-bash-3.2# unzip audio-player.zip
-bash-3.2# mv audio-player extensions/
-bash-3.2# cd extensions
-bash-3.2# mv audio-player audio_player

語法:
<flashmp3>Cicada.mp3|autostart=yes|loop=yes</flashmp3>

<flashmp3>Cicada.mp3|autostart=yes|loop=yes</flashmp3>

20100101 Awstats 操作

(一)登入執行Awstats記錄更新程式
login as: webadm
webadm@insecta.idv.tw's password: ************
Last login: Thu Dec 31 13:40:48 2009 from 60-250-218-149.hinet-ip.hinet.net
-bash-3.2#
-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Update for config "/etc/awstats/awstats.insecta.idv.tw.conf"
With data in log file "/usr/local/apache2/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 15888)
Jumped lines in file: 15888
 Found 15888 already parsed records.
Parsed lines in file: 26886
 Found 506 dropped records,
 Found 1 corrupted records,
 Found 0 old records,
 Found 26379 new qualified records.
-bash-3.2# date
五  1月  1 07:29:00 CST 2010
(二)停止httpd,再執行Awstats記錄更新程式
-bash-3.2# /usr/local/apache2/bin/apachectl stop
-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Update for config "/etc/awstats/awstats.insecta.idv.tw.conf"
With data in log file "/usr/local/apache2/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 42774)
Jumped lines in file: 42774
 Found 42774 already parsed records.
Parsed lines in file: 12
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 12 new qualified records.
(三)備份舊年度的httpd access_log
-bash-3.2# cd /usr/local/apache2/logs
-bash-3.2# ls
access_log  access_log20091231  error_log
-bash-3.2# mv access_log access_log_20100101

(四)重啟httpd
-bash-3.2# /usr/local/apache2/bin/apachectl start
-bash-3.2# ls
access_log  access_log20091231  access_log_20100101  error_log  httpd.pid
-bash-3.2#

(五)察看Awstats記錄
-bash-3.2# ls /var/lib/awstats -l
總計 24040
-rw-r--r-- 1 root root  692072 2009-12-29 22:39 awstats012009.insecta.idv.tw.txt
-rw-r--r-- 1 root root   31643 2010-01-01 07:29 awstats012010.insecta.idv.tw.txt
-rw-r--r-- 1 root root  686036 2009-12-29 23:03 awstats022009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  960450 2009-12-29 23:58 awstats032009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1602099 2009-12-30 01:05 awstats042009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 2057362 2009-12-30 16:22 awstats052009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1911232 2009-12-30 19:51 awstats062009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 2324327 2009-12-30 22:26 awstats072009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  234618 2009-12-29 20:46 awstats082008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1979914 2009-12-31 00:26 awstats082009.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1027005 2009-12-29 21:11 awstats092008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1505939 2009-12-31 01:32 awstats092009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  807608 2009-12-29 21:37 awstats102008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1711409 2009-12-31 02:36 awstats102009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  781808 2009-12-29 21:59 awstats112008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 1603964 2009-12-31 03:29 awstats112009.insecta.idv.tw.txt
-rw-r--r-- 1 root root  699771 2009-12-29 22:24 awstats122008.insecta.idv.tw.txt
-rw-r--r-- 1 root root 3869527 2010-01-01 07:27 awstats122009.insecta.idv.tw.txt
drwxr-xr-x 2 root root    4096 2009-12-31 06:40 backup
-rw-r--r-- 1 root root   23146 2010-01-01 07:29 dnscachelastupdate.insecta.idv.tw.txt
-bash-3.2#

(六)修改排程使系統每天早上六點自動執行分析 Web Log 的工作
-bash-3.2# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
-bash-3.2# crontab -l
0 6 * * * perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw -update > /dev/null 2>&1
-bash-3.2#


20091231 Awstats 使用combine Format

(一)修改/usr/local/apache2/conf/httpd.conf
-bash-3.2# vi /usr/local/apache2/conf/httpd.conf
:
    CustomLog "logs/access_log" combined
:
-bash-3.2#
(二)修改/etc/awstats/awstats.insecta.idv.tw.conf
-bash-3.2# vi /etc/awstats/awstats.insecta.idv.tw.conf
:
LogFormat=1
:
(三)重啟apache
-bash-3.2# /usr/local/apache2/bin/apachectl restart

(四)執行awstats記錄檔更新程式
-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Update for config "/etc/awstats/awstats.insecta.idv.tw.conf"
With data in log file "/usr/local/apache2/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access to last remembered record is out of file.
So searching it from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 845
 Found 11 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 834 new qualified records.
-bash-3.2#


20091229安裝Awstats 6.5版

  1. 安裝文件 http://insecta.idv.tw/awstats-6.5/docs
(一)登入系統並下載awstats-6.5.zip
login as: webadm
webadm@insecta.idv.tw's password: ************
Last login: Sun Dec 20 23:28:20 2009 from 60-250-218-149.hinet-ip.hinet.net
-bash-3.2# wget http://prdownloads.sourceforge.net/awstats/awstats-6.5.zip

(二)解開並查看說明
-bash-3.2# unzip awstats-6.5.zip

-bash-3.2# ls awstats-6.5
docs  README.TXT  tools  wwwroot
-bash-3.2# cat awstats-6.5/README.TXT

(三)查看解開的資料夾內容
-bash-3.2# ls awstats-6.5/
docs  README.TXT  tools  wwwroot
-bash-3.2# ls awstats-6.5/docs
awstats_benchmark.html  awstats_contrib.html   awstats_license.html   awstats_tools.html    COPYING.TXT  pad_awstats.htm
awstats_changelog.txt   awstats_extra.html     awstats.pdf            awstats_upgrade.html  images       pad_awstats.xml
awstats_compare.html    awstats_faq.html       awstats_security.html  awstats_webmin.html   index.html   styles.css
awstats_config.html     awstats_glossary.html  awstats_setup.html     awstats_what.html     LICENSE.TXT
-bash-3.2# ls awstats-6.5/tools
awstats_buildstaticpages.pl  awstats_exportlib.pl  logresolvemerge.pl  urlaliasbuilder.pl  xslt
awstats_configure.pl         awstats_updateall.pl  maillogconvert.pl   webmin
-bash-3.2# ls awstats-6.5/wwwroot/
cgi-bin  classes  css  icon  js
-bash-3.2# ls awstats-6.5/wwwroot/cgi-bin
awredir.pl  awstats.model.conf  awstats.pl  lang  lib  plugins
-bash-3.2#

(四)列出apache webserver 的log目錄
-bash-3.2# ls /usr/local/apache2/logs -l
總計 4805992
-rw-r--r-- 1 root root 4794061335 2009-12-29 20:17 access_log
-rw-r--r-- 1 root root  122443040 2009-12-29 20:15 error_log
-rw-r--r-- 1 root root          6 2009-12-20 23:28 httpd.pid
-bash-3.2#

(五)移動awstats-6.5到/usr/local並改名為awstats
-bash-3.2# mv awstats-6.5 /usr/local
-bash-3.2# cd /usr/local
-bash-3.2# mv awstats-6.5/ awstats
-bash-3.2#
-bash-3.2# cd /usr/local/awstats/tools/

(六)執行安裝設定 perl awstats_configure.pl

-bash-3.2# perl awstats_configure.pl

----- AWStats awstats_configure 1.0 (build 1.6) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).

-----> Running OS detected: Linux, BSD or Unix

-----> Check for web server install
  Found Web server Apache config file '/usr/local/apache2/conf/httpd.conf'

-----> Check and complete web server config file '/usr/local/apache2/conf/httpd.conf'
  Add 'Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"'
  Add 'Alias /awstatscss "/usr/local/awstats/wwwroot/css/"'
  Add 'Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"'
  Add 'ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"'
  Add '<Directory>' directive
  AWStats directives added to Apache config file.

-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.

-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ?
-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> insecta.idv.tw

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>

-----> Create config file '/etc/awstats/awstats.insecta.idv.tw.conf'
 Config file /etc/awstats/awstats.insecta.idv.tw.conf created.

-----> Restart Web server with '/sbin/service httpd restart'
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
正在停止 httpd:                                            [失敗]
正在啟動 httpd:                                            [失敗]

-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Or if you have several config files and prefer having only one command:
/usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...

A SIMPLE config file has been created: /etc/awstats/awstats.insecta.idv.tw.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'insecta.idv.tw' with command:
> perl awstats.pl -update -config=insecta.idv.tw
You can also read your statistics for 'insecta.idv.tw' with URL:
> http://localhost/awstats/awstats.pl?config=insecta.idv.tw

Press ENTER to finish...

-bash-3.2#
(七)察看apache設定檔的新增內容
-bash-3.2# cat /usr/local/apache2/conf/httpd.conf
:
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"

#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

(八)察看/usr/local/awstats/wwwroot/cgi-bin的pl CGI程式
-bash-3.2# ls /usr/local/awstats/wwwroot/cgi-bin
awredir.pl  awstats.model.conf  awstats.pl  lang  lib  plugins
-bash-3.2#

(九a)執行awstats記錄檔更新程式
-bash-3.2# /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
-bash: /usr/local/awstats/wwwroot/cgi-bin/awstats.pl: 拒絕不符權限的操作
-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Error: AWStats database directory defined in config file by 'DirData' parameter (/var/lib/awstats) does not exist or is not writable.
Setup ('/etc/awstats/awstats.insecta.idv.tw.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

(九b)改錯1,再執行awstats記錄檔更新程式
-bash-3.2# mkdir /var/lib/awstats
-bash-3.2# chmod 755 /var/lib/awstats
-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
Update for config "/etc/awstats/awstats.insecta.idv.tw.conf"
With data in log file "/var/log/httpd/mylog.log"...
Error: Couldn't open server log file "/var/log/httpd/mylog.log" : 沒有此一檔案或目錄
Setup ('/etc/awstats/awstats.insecta.idv.tw.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
-bash-3.2#

(九c)改錯2,再執行awstats記錄檔更新程式
-bash-3.2# vi /etc/awstats/awstats.insecta.idv.tw.conf

:
LogFile="/usr/local/apache2/logs/access_log"
:
LogFormat=4
:
DNSLookup=1
:
LoadPlugin="decodeutfkeys"
:

-bash-3.2#


(十)察看產生的awstats記錄檔
-bash-3.2# ls /var/lib/awstats -l
總計 8024
-rw-r--r-- 1 root root  692072 2009-12-29 22:39 awstats012009.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root  686036 2009-12-29 23:03 awstats022009.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root  960450 2009-12-29 23:58 awstats032009.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root 1602099 2009-12-30 01:05 awstats042009.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root  664214 2009-12-30 01:27 awstats052009.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root  234618 2009-12-29 20:46 awstats082008.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root 1027005 2009-12-29 21:11 awstats092008.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root  807608 2009-12-29 21:37 awstats102008.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root  781808 2009-12-29 21:59 awstats112008.insecta.idv.tw.tmp.16357
-rw-r--r-- 1 root root  699771 2009-12-29 22:24 awstats122008.insecta.idv.tw.tmp.16357
-bash-3.2#

(十一)修改awstats.pl的執行權限
-bash-3.2# chmod 777 /usr/local/awstats/wwwroot/cgi-bin/awstats.pl
-bash-3.2#

(十二) 修改產生的awstats記錄檔
-bash-3.2# cd /var/lib/awstats
-bash-3.2# mv awstats052009.insecta.idv.tw.tmp.16357 awstats052009.insecta.idv.tw
-bash-3.2# mv awstats052009.insecta.idv.tw awstats052009.insecta.idv.tw.txt
-bash-3.2# mv awstats042009.insecta.idv.tw.tmp.16357 awstats042009.insecta.idv.tw.txt
-bash-3.2# mv awstats032009.insecta.idv.tw.tmp.16357 awstats032009.insecta.idv.tw.txt
-bash-3.2# mv awstats022009.insecta.idv.tw.tmp.16357 awstats022009.insecta.idv.tw.txt
-bash-3.2# mv awstats012009.insecta.idv.tw.tmp.16357 awstats012009.insecta.idv.tw.txt
-bash-3.2# mv awstats082008.insecta.idv.tw.tmp.16357 awstats082008.insecta.idv.tw.txt
-bash-3.2# mv awstats072008.insecta.idv.tw.tmp.16357 awstats072008.insecta.idv.tw.txt
mv: 無法 stat ‘awstats072008.insecta.idv.tw.tmp.16357’: 沒有此一檔案或目錄
-bash-3.2# mv awstats092008.insecta.idv.tw.tmp.16357 awstats092008.insecta.idv.tw.txt
-bash-3.2# mv awstats102008.insecta.idv.tw.tmp.16357 awstats102008.insecta.idv.tw.txt
-bash-3.2# mv awstats112008.insecta.idv.tw.tmp.16357 awstats112008.insecta.idv.tw.txt
-bash-3.2# mv awstats122008.insecta.idv.tw.tmp.16357 awstats122008.insecta.idv.tw.txt

(十三) 察看結果 http://insecta.idv.tw/awstats/awstats.pl?config=insecta.idv.tw
問題無法看全年度報表
Error: Full year view has not been allowed from a browser (AllowFullYearView should be set to 3).

Setup ('/etc/awstats/awstats.insecta.idv.tw.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory). 

(十四)修改設定檔的 AllowFullYearView=3
-bash-3.2# vi /etc/awstats/awstats.insecta.idv.tw.conf
-bash-3.2# cat /etc/awstats/awstats.insecta.idv.tw.conf|grep Allow
# Warning: If you want to be able to use the "AllowToUpdateStatsFromBrowser"
AllowToUpdateStatsFromBrowser=0
#  1 - Allowed on CLI only, -Year- value in combo is not visible
#  2 - Allowed on CLI only, -Year- value in combo is visible but not allowed
AllowFullYearView=3
# AllowToUpdateStatsFromBrowser is set to 1.
AllowAccessFromWebToAuthenticatedUsersOnly=0
# AllowAccessFromWebToAuthenticatedUsersOnly is set to 1.
AllowAccessFromWebToFollowingAuthenticatedUsers=""
AllowAccessFromWebToFollowingIPAddresses=""
# set AllowToUpdateStatsFromBrowser to 1, you can change this parameter to 1.
# Allow AWStats to show correctly (in language charset) keywords/keyphrases
# Allow AWStats to correct a bad timezone for user of some IIS that use
-bash-3.2#

(十五)在背景執行awstats記錄檔更新程式
-bash-3.2# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw &
[1] 31710
-bash-3.2# Update for config "/etc/awstats/awstats.insecta.idv.tw.conf"
With data in log file "/usr/local/apache2/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access to last remembered record has fallen on another record.
So searching new records from beginning of log file...

-bash-3.2# ps ax|grep perl
31710 pts/1    R      1:51 perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=insecta.idv.tw
-bash-3.2#

(十六)發現 Sogou Spider, 220.181.61.211

20091220設定googlemap

webadm@insecta.idv.tw's password: ************
Last login: Fri Dec 18 02:27:17 2009 from 60-250-218-149.hinet-ip.hinet.net
-bash-3.2#
-bash-3.2# cd wiki
-bash-3.2# wget http://emiller.info/maps/GoogleMaps-0.9.4.zip
--2009-12-20 23:05:10--  http://emiller.info/maps/GoogleMaps-0.9.4.zip
正在查找主機 emiller.info... 74.50.50.230
正在連接 emiller.info|74.50.50.230|:80... 連上了。
已送出 HTTP 要求,正在等候回應... 301 Moved Permanently
位置: http://www.evanmiller.org/maps/GoogleMaps-0.9.4.zip [跟隨至新的 URL]
--2009-12-20 23:05:11--  http://www.evanmiller.org/maps/GoogleMaps-0.9.4.zip
正在查找主機 www.evanmiller.org... 74.50.50.230
繼續使用和 emiller.info:80 的連線。
已送出 HTTP 要求,正在等候回應... 200 OK
長度: 143285 (140K) [application/zip]
Saving to: `GoogleMaps-0.9.4.zip'

100%[======================================>] 143,285      104K/s   in 1.3s

2009-12-20 23:05:13 (104 KB/s) -- 已儲存 ‘GoogleMaps-0.9.4.zip’ [143285/143285])

-bash-3.2#
-bash-3.2# unzip GoogleMaps-0.9.4.zip
Archive:  GoogleMaps-0.9.4.zip
   creating: GoogleMaps/
  inflating: GoogleMaps/EditorsMap.js
  inflating: GoogleMaps/SpecialGoogleMapsKML.php
  inflating: GoogleMaps/color_select.js
   creating: GoogleMaps/export/
  inflating: GoogleMaps/export/GoogleMapsImgExporter.php
  inflating: GoogleMaps/export/GoogleMapsExporter.php
  inflating: GoogleMaps/export/GoogleMapsJsExporter.php
  inflating: GoogleMaps/export/GoogleMapsKmlExporter.php
  inflating: GoogleMaps/INSTALL
  inflating: GoogleMaps/GoogleMaps.body.php
  inflating: GoogleMaps/GoogleMaps.i18n.php
  inflating: GoogleMaps/LICENSE
   creating: GoogleMaps/images/
  inflating: GoogleMaps/images/sv_blend.png
 extracting: GoogleMaps/images/hue_blend.png
 extracting: GoogleMaps/images/button_map_close.gif
 extracting: GoogleMaps/images/button_map_open.gif
  inflating: GoogleMaps/GoogleMaps.php
   creating: GoogleMaps/css/
  inflating: GoogleMaps/css/color_select_ie.css
  inflating: GoogleMaps/css/color_select_ie6.css
  inflating: GoogleMaps/css/color_select.css
-bash-3.2#
-bash-3.2# mv GoogleMaps extensions/
-bash-3.2#

-bash-3.2# vi LocalSettings.php
:
$wgGoogleMapsKey = "於此加入Google Maps API Key ";
require_once( "$IP/extensions/GoogleMaps/GoogleMaps.php" );

2009年12月協助基隆私立光隆家商架站(210.59.1.13)的系統安裝記錄


參考文件

Awstats安裝

Extension:Embed Media


20201026讓image 檔可以上傳

0 # dnf install ImageMagick

1: vi LocalSettings.php
:
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

2:# vi /etc/php.ini
file_uploads = On
upload_tmp_dir = /tmp
upload_max_filesize = 3M
max_file_uploads = 20
session.upload_progress.enabled = On

3:# chown apache.apache -R images
4:# chmod 777 -R images
# stat images
  File: images
  Size: 74              Blocks: 0          IO Block: 4096   directory
Device: fd00h/64768d    Inode: 19212575    Links: 2
Access: (0777/drwxrwxrwx)  Uid: (   48/  apache)   Gid: (   48/  apache)
Context: unconfined_u:object_r:httpd_sys_content_t:s0
Access: 2020-10-26 01:50:46.131554574 -0400
Modify: 2020-10-14 22:45:21.810121344 -0400
Change: 2020-10-26 01:50:46.131554574 -0400
 Birth: -

20091122讓wav檔可以上傳

-bash-3.2# cat /usr/local/lib/php.ini|grep upload
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
;upload_tmp_dir =
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M
-bash-3.2#

-bash-3.2# pwd
/usr/local/apache2/htdocs/wiki
-bash-3.2# vi LocalSettings.php
:
$wgFileExtensions[] = 'wav';

20091101調整MediaWiki顯示時間


系統時間調整成功!Wsn 2009年11月1日 (日) 17:42 (CST)

  • 在LocalSettings.php的最後面加入如下文字即可。
#Set Default Timezone
$wgLocaltimezone = "Asia/Taipei";
$oldtz = getenv("TZ");
putenv("TZ=$wgLocaltimezone");
# Versions before 1.7.0 used $wgLocalTZoffset as hours.
# After 1.7.0 offset as minutes
$wgLocalTZoffset = date("Z") / 60;
putenv("TZ=$oldtz");

20090910 php rebulid 維護記錄

20080828資料備份與移轉

[oldwu@w3 htdocs]$ su
密碼:
[root@w3 htdocs]# cd /usr/local/apache2/htdocs/wiki/maintenance
[root@w3 maintenance]# php dumpBackup.php --current > ~webadm/tmp/export970828.x                                             ml
2008-08-28 08:40:45: wikidb-mw_ 99 pages (219.020/sec), 100 revs (221.232/sec),   
:
ok

[root@w3 maintenance]# php dumpBackup.php --full > ~webadm/tmp/20080828fullexport.xml


[root@w3 maintenance]# ls ~webadm/tmp
20080828fullexport.xml  export970828.xml  export.xml  images  images_m_abuse  images.tgz  m_abuse_export.xml
[root@w3 maintenance]#

[root@w3 wiki]# pwd
/usr/local/apache2/htdocs/wiki
[root@w3 wiki]# tar cvzf 20080828insectimage.tgz images


[root@insecta ~]# cd /usr/local/apache2/htdocs
[root@insecta htdocs]# ls
apache_pb22_ani.gif  apache_pb22.png  apache_pb.png  insecta  wiki
apache_pb22.gif      apache_pb.gif    index.html     i.php
[root@insecta htdocs]# cd insecta/
[root@insecta insecta]# ls
20080828fullexport.xml  20080828insectimage.tgz  export970828.xml
[root@insecta insecta]# cd ../wiki
[root@insecta wiki]# pwd
/usr/local/apache2/htdocs/wiki
[root@insecta wiki]# cd maintenance/
[root@insecta maintenance]# pwd
/usr/local/apache2/htdocs/wiki/maintenance
[root@insecta maintenance]# php importDump.php  /usr/local/apache2/htdocs/insecta/20080828fullexport.xml  
:4100 (7.12 pages/sec 18.90 revs/sec)
4200 (7.27 pages/sec 19.03 revs/sec)
4300 (7.42 pages/sec 19.15 revs/sec)
Done!
You might want to run rebuildrecentchanges.php to regenerate
the recentchanges page.

[root@insecta maintenance]# cat ../AdminSettings.sample > ../AdminSettings.php
[root@insecta maintenance]# vi ../AdminSettings.php
設定資料庫的登入帳號密碼
[root@insecta maintenance]# php  rebuildrecentchanges.php
Loading from page and revision tables...
$wgRCMaxAge=604800 (7 days)
Updating links and size differences...
Loading from user, page, and logging tables...
Flagging bot account edits...
Flagging auto-patrolled edits...
Done.
[root@insecta maintenance]#

[root@insecta insecta]# pwd
/usr/local/apache2/htdocs/insecta

[root@insecta insecta]# tar xvzf 20080828insectimage.tgz
[root@insecta insecta]# ls
20080828fullexport.xml  20080828insectimage.tgz  export970828.xml  images
[root@insecta insecta]#

[root@insecta images]# ls
0  1  2  3  4  5  6  7  8  9  a  archive  b  c  d  e  f  README  temp  testpic.JPG
[root@insecta images]# pwd
/usr/local/apache2/htdocs/insecta/images
[root@insecta images]# rm -rf thumb
[root@insecta images]# mkdir /usr/local/apache2/htdocs/insecta/imgTMP
[root@insecta images]# find . -type f -exec cp \{\}  /usr/local/apache2/htdocs/insecta/imgTMP \;
[root@insecta images]#

[root@insecta wiki]# pwd
/usr/local/apache2/htdocs/wiki
[root@insecta wiki]# php maintenance/importImages.php /usr/local/apache2/htdocs/insecta/imgTMP jpg
:
Importing 20080702南投新中橫塔塔加鞍部杜紅十星瓢蟲1c.JPG...done.
Found: 3673
Added: 3673

[root@insecta wiki]# cd maintenance/
[root@insecta maintenance]# php initStats.php --update
php initStats.php --update
Refresh Site Statistics

Counting total edits...14855
Counting number of articles...671
Counting total pages...4539
Counting number of users...1
Counting number of admins...1
Counting number of images...3673
Counting total page views...5

Updating site statistics...done.
[root@insecta maintenance]# php initStats.php --update
Refresh Site Statistics

Counting total edits...14855
Counting number of articles...671
Counting total pages...4539
Counting number of users...1
Counting number of admins...1
Counting number of images...3673
Counting total page views...5

Updating site statistics...done.
[root@insecta maintenance]#


20080829 tracert wikimedia.org

[root@insecta ~]# tracert wikimedia.org
traceroute to wikimedia.org (208.80.152.2), 30 hops max, 40 byte packets
 1  60-250-218-254.HINET-IP.hinet.net (60.250.218.254)  25.466 ms  25.959 ms  26.936 ms
 2  il-c6r1.router.hinet.net (168.95.172.198)  28.405 ms  29.385 ms  30.369 ms
 3  il-c12r2.router.hinet.net (211.22.127.78)  31.830 ms  32.840 ms  33.807 ms
 4  tp-crs11.router.hinet.net (220.128.2.210)  36.749 ms  38.244 ms  39.708 ms
 5  pr04-s2.tp.hinet.net (220.128.4.97)  41.416 ms  42.398 ms  43.400 ms
 6  r02-s2.tp.hinet.net (220.128.4.78)  44.864 ms  26.510 ms  28.910 ms
 7  r12-pa.us.hinet.net (211.72.108.121)  176.437 ms  171.404 ms  173.807 ms
 8  r11-pa.us.hinet.net (202.39.83.189)  160.796 ms  155.410 ms  157.830 ms
 9  206.111.12.165.ptr.us.xo.net (206.111.12.165)  160.237 ms  155.406 ms  157.789 ms
10  te-4-0-0.rar3.sanjose-ca.us.xo.net (207.88.12.61)  161.460 ms  156.389 ms  159.053 ms
11  te-3-0-0.rar3.la-ca.us.xo.net (207.88.12.62)  202.372 ms  196.806 ms  199.232 ms
12  te-11-4-0.rar3.dallas-tx.us.xo.net (207.88.14.41)  202.106 ms  196.226 ms  198.191 ms
13  207.88.14.42.ptr.us.xo.net (207.88.14.42)  230.641 ms  226.844 ms  229.497 ms
14  w006.z207088246.xo.cnc.net (207.88.246.6)  251.386 ms  247.513 ms  249.454 ms
15  rr.pmtpa.wikimedia.org (208.80.152.2)  249.448 ms  244.822 ms  246.769 ms
[root@insecta ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1F:C6:7D:48:7B
          inet addr:60.250.218.150  Bcast:60.250.218.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:c6ff:fe7d:487b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:785860 errors:0 dropped:0 overruns:0 frame:0
          TX packets:997730 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:82541123 (78.7 MiB)  TX bytes:1201800398 (1.1 GiB)
          Interrupt:18

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9322 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9322 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2957327 (2.8 MiB)  TX bytes:2957327 (2.8 MiB)

[root@insecta ~]#


如何加入圖片鏈結即產生圖片 修改LocalSettings.php [1]

[如何讓wiki可以上載圖片] 如何在wiki導航選單加入新的選項

核心編譯與系統更新

教學:Fedora 如何自動更新系統 (update) http://www.pczone.com.tw/vbb3/thread/41/102673/

http://slashdot.org/

http://digg.com/

http://openwetware.org/wiki/Main_Page

共筆 http://wiki.planetoid.info/index.php/%E5%85%B1%E7%AD%86%E9%A6%96%E9%A0%81

修改 $ vi ./LocalSettings.php

$wgSitename = "台灣昆蟲維基館";

人氣指數史

備份

頁面移轉

-bash-3.1# pwd
/usr/local/apache2/htdocs/wiki/maintenance

-bash-3.1# cat ../AdminSettings.php
<?php
:
$wgDBadminuser      = 'wikiadmin';
$wgDBadminpassword  = 'adminpass';
:
?>

-bash-3.1# php dumpBackup.php --current > ~/tmp/export.xml

[root@ad maintenance]# pwd
/usr/local/apache2/htdocs/wiki/maintenance
[root@ad maintenance]# ls *.xml
export.xml
[root@ad maintenance]# php importDump.php  export.xml

[root@ad maintenance]# php  rebuildrecentchanges.php
Loading from page and revision tables...
Updating links...
Done.
[root@ad maintenance]# pwd
/usr/local/apache2/htdocs/insect/maintenance
[root@ad maintenance]#


影像檔移轉


-bash-3.1# find . -type f -exec cp \{\} ~/tmp/images/ \;
-bash-3.1# cd ~/tmp
-bash-3.1# tar cvzf images.tgz images

[root@ad maintenance]# cd ~webadm/tmp
[root@ad tmp]# ftp 140.111.90.8
Connected to 140.111.90.8 (140.111.90.8).
220 (vsFTPd 2.0.4)
Name (140.111.90.8:webadm):
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd tmp
250 Directory successfully changed.
ftp> ls
227 Entering Passive Mode (140,111,90,8,48,230)
150 Here comes the directory listing.
-rw-r--r--    1 0        0         2860690 Aug 19 08:02 export.xml
drwxr-xr-x    2 0        0         1392640 Aug 19 08:29 images
-rw-r--r--    1 0        0        1593954670 Aug 19 08:37 images.tgz
226 Directory send OK.
ftp> bin
200 Switching to Binary mode.
ftp> mget images.tgz
mget images.tgz? y
227 Entering Passive Mode (140,111,90,8,170,34)
150 Opening BINARY mode data connection for images.tgz (1593954670 bytes).
226 File send OK.
1593954670 bytes received in 138 secs (1.1e+04 Kbytes/sec)
ftp> quit
221 Goodbye.
[root@ad tmp]#
[root@ad tmp]# tar xvzf images.tgz

[root@ad images]# pwd
/usr/local/apache2/htdocs/tmp/images
[root@ad images]# rm -f ???px*
[root@ad images]# rm -f ??px*
[root@ad images]# ls *|wc
   3530    3530  189890


[root@ad insect]# php maintenance/importImages.php /usr/local/apache2/htdocs/tmp/images jpg

上載ok

-bash-3.2# php initStats.php --update
Refresh Site Statistics

Counting total edits...4364
Counting number of articles...656
Counting total pages...4363
Counting number of users...1
Counting number of admins...1
Counting number of images...3450
Counting total page views...22

Updating site statistics...done.
-bash-3.2#

http://insecta.idv.tw/wiki

[root@insecta lnx]# wget http://download.wikimedia.org/mediawiki/1.13/mediawiki-1.13.0.tar.gz
[root@insecta lnx]# tar xvzf mediawiki-1.13.0.tar.gz \
[root@insecta lnx]# mv mediawiki-1.13.0 wiki
[root@insecta lnx]# mv wiki /usr/local/apache2/htdocs
[root@insecta lnx]# cd /usr/local/apache2/htdocs
[root@insecta htdocs]# cd wiki
[root@insecta wiki]# pwd
/usr/local/apache2/htdocs/wiki

SETUP: http://insecta.idv.tw/wiki/

[root@insecta wiki]# chmod a+w config
[root@insecta wiki]# mv config/LocalSettings.php .
[root@insecta wiki]# 

OK!


20091029資料備份

login as: webadm
webadm@insecta.idv.tw's password: ******
Last login: Thu Oct 29 20:28:01 2009 from 60-250-218-148.hinet-ip.hinet.net
-bash-3.2# cd wiki
-bash-3.2# pwd
/usr/local/apache2/htdocs/wiki
-bash-3.2# cd maintenance/
-bash-3.2# mkdir ~/tmp
-bash-3.2# php dumpBackup.php --full > ~webadm/tmp/20091029fullexport.xml
-bash-3.2# ls ~webadm/tmp -l
總計 139000
-rw-r--r-- 1 root root 142188822 2009-10-29 22:49 20091029fullexport.xml
-bash-3.2# df
檔案系統               1K-區段      已用     可用 已用% 掛載點
/dev/mapper/VolGroup00-LogVol00
                     234349200  40165636 182087260  19% /
/dev/sda1               194442     19420    164983  11% /boot
tmpfs                  1815536         0   1815536   0% /dev/shm
-bash-3.2#

-bash-3.2# ls *.tgz -l
-rw-r--r-- 1 root root 7871822461 2009-10-29 23:21 20091029insectimage.tgz
-rw-r--r-- 1 root root      39940 2009-09-10 07:28 phpcsv.tgz
-bash-3.2# tar cvzf 20091029insectimage.tgz images
-bash-3.2# mv 20091029insectimage.tgz ~/tmp
-bash-3.2# ls ~/tmp -l
總計 7833848
-rw-r--r-- 1 root root  142188822 2009-10-29 22:49 20091029fullexport.xml    --頁面備份檔
-rw-r--r-- 1 root root 7871822461 2009-10-29 23:21 20091029insectimage.tgz   --影像備份檔
-bash-3.2#

20130329頁面移轉至http://ht.kmvs.km.edu.tw/insecta3

[root@ht webadm]# cd /usr/local/apache2/htdocs/insecta3/maintenance
[root@ht maintenance]#
[root@ht maintenance]# ls ~webadm/data -l
總計 2448784
-rw-r--r--. 1 webadm webadm  195444736  3月 29 17:24 20130309fullexport.xml
-rw-r--r--. 1 webadm webadm 2312093696  3月 29 17:26 20130309insectimage.tgz

[root@ht maintenance]#  php importDump.php ~webadm/data/20130309fullexport.xml
PHP Warning:  XMLReader::read(): uploadsource://8466b6e34cf4b3d55ad12526e8507725:1: parser error : Document is empty in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): � in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): ^ in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): An Error Occured while reading in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
Set $wgShowExceptionDetails = true; in LocalSettings.php to show detailed debugging information.
[root@ht maintenance]# 

[root@ht webadm]# cd /usr/local/apache2/htdocs/insecta3/
[1]+  Done                    /usr/sbin/vsftpd  (wd: /home/webadm)
(wd now: /usr/local/apache2/htdocs/insecta3)
[root@ht insecta3]# ls ~webadm/data -l
總計 4528976
-rw-r--r--. 1 webadm webadm  196105077  4月  1 08:35 20130309fullexport.xml
-rw-r--r--. 1 webadm webadm    7265724  3月 29 17:32 insectawikidb.tgz
-rw-r--r--. 1 webadm webadm    2227134  3月 29 17:33 lifetype-1.2.8.tar.gz
-rw-r--r--. 1 webadm webadm   10826029  3月 29 17:33 mediawiki-1.15.1.tar.gz
-rw-r--r--. 1 webadm webadm   25867740  3月 29 17:33 mysql-5.0.27.tar.gz
-rw-r--r--. 1 webadm webadm       9282  3月 29 17:13 Untitled 1.odt
-rw-r--r--. 1 webadm webadm 4395352064  3月 29 17:34 wiki.tgz
[root@ht insecta3]# cd maintenance/
[root@ht maintenance]# php importDump.php ~webadm/data/20130309fullexport.xml
PHP Warning:  XMLReader::read(): uploadsource://851a6d457ae65aa424d1d7e568412cf6:1: parser error : Document is empty in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): � in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): ^ in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): An Error Occured while reading in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
Set $wgShowExceptionDetails = true; in LocalSettings.php to show detailed debugging information.
[root@ht maintenance]# 

4/1
[root@ht insecta3]# cd maintenance/
[root@ht maintenance]# php importDump.php ~webadm/data/20130309fullexport.xml
PHP Warning:  XMLReader::read(): uploadsource://6c3c9761c0d061231b0c7a54207b6627:1: parser error : Document is empty in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): � in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): ^ in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
PHP Warning:  XMLReader::read(): An Error Occured while reading in /usr/local/apache2/htdocs/insecta3/includes/Import.php on line 435
Expected <mediawiki> tag, got 
Backtrace:
#0 /usr/local/apache2/htdocs/insecta3/maintenance/importDump.php(286): WikiImporter->doImport()
#1 /usr/local/apache2/htdocs/insecta3/maintenance/importDump.php(245): BackupReader->importFromHandle(Resource id #65)
#2 /usr/local/apache2/htdocs/insecta3/maintenance/importDump.php(95): BackupReader->importFromFile('/home/webadm/da...')
#3 /usr/local/apache2/htdocs/insecta3/maintenance/doMaintenance.php(110): BackupReader->execute()
#4 /usr/local/apache2/htdocs/insecta3/maintenance/importDump.php(291): require_once('/usr/local/apac...')
#5 {main}
[root@ht maintenance]# 

20091031頁面移轉至http://ad.ilvs.ilc.edu.tw/ad

login as: webadm
webadm@insecta.idv.tw's password: ******
Last login: Fri Oct 30 19:38:17 2009 from 60-250-218-148.hinet-ip.hinet.net
-bash-3.2#
-bash-3.2# cd tmp
-bash-3.2# ls
20091029fullexport.xml  20091029insectimage.tgz
-bash-3.2# ftp 140.111.91.161  (即現在的ad.ilvs.ilc.edu.tw)
Connected to 140.111.91.161 (140.111.91.161).
220 (vsFTPd 2.0.5)
Name (140.111.91.161:webadm): webadm
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> mput 20091029fullexport.xml
mput 20091029fullexport.xml? y
227 Entering Passive Mode (140,111,91,161,216,254).
150 Ok to send data.
226 File receive OK.
142188822 bytes sent in 1.82e+03 secs (77.97 Kbytes/sec)
ftp>

在ad端的操作
-bash-3.2# pwd
/usr/local/apache2/htdocs
-bash-3.2# cd /usr/local/apache2/htdocs/ad/maintenance
-bash-3.2# pwd
/usr/local/apache2/htdocs/ad/maintenance
-bash-3.2# ls ~webadm/*.xml
/usr/local/apache2/htdocs/20091029fullexport.xml
-bash-3.2# php importDump.php /usr/local/apache2/htdocs/20091029fullexport.xml
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.05 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.04 revs/sec)
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.03 revs/sec)
100 (0.19 pages/sec 12.02 revs/sec)
100 (0.19 pages/sec 12.02 revs/sec)
100 (0.19 pages/sec 12.02 revs/sec)
100 (0.19 pages/sec 12.02 revs/sec)
200 (0.28 pages/sec 10.95 revs/sec)
200 (0.28 pages/sec 10.95 revs/sec)
300 (0.40 pages/sec 10.91 revs/sec)
300 (0.40 pages/sec 10.91 revs/sec)
400 (0.50 pages/sec 10.87 revs/sec)
500 (0.61 pages/sec 11.00 revs/sec)
500 (0.61 pages/sec 11.00 revs/sec)
600 (0.72 pages/sec 11.14 revs/sec)
600 (0.72 pages/sec 11.14 revs/sec)
700 (0.81 pages/sec 11.21 revs/sec)
700 (0.81 pages/sec 11.21 revs/sec)
700 (0.81 pages/sec 11.21 revs/sec)
700 (0.81 pages/sec 11.21 revs/sec)
800 (0.91 pages/sec 11.36 revs/sec)
800 (0.91 pages/sec 11.37 revs/sec)
900 (1.00 pages/sec 11.48 revs/sec)
900 (1.00 pages/sec 11.48 revs/sec)
1000 (1.04 pages/sec 11.41 revs/sec)
1000 (1.04 pages/sec 11.41 revs/sec)
1100 (1.13 pages/sec 11.56 revs/sec)
1100 (1.13 pages/sec 11.56 revs/sec)
1100 (1.13 pages/sec 11.56 revs/sec)
1100 (1.13 pages/sec 11.56 revs/sec)
1100 (1.13 pages/sec 11.56 revs/sec)
1100 (1.13 pages/sec 11.56 revs/sec)
1200 (1.20 pages/sec 11.60 revs/sec)
1200 (1.20 pages/sec 11.60 revs/sec)
1300 (1.28 pages/sec 11.72 revs/sec)
1300 (1.28 pages/sec 11.72 revs/sec)
1400 (1.36 pages/sec 11.84 revs/sec)
1500 (1.44 pages/sec 11.95 revs/sec)
1500 (1.44 pages/sec 11.96 revs/sec)
1600 (1.48 pages/sec 12.04 revs/sec)
1600 (1.48 pages/sec 12.04 revs/sec)
1600 (1.48 pages/sec 12.04 revs/sec)
1600 (1.48 pages/sec 12.04 revs/sec)
1600 (1.48 pages/sec 12.05 revs/sec)
1600 (1.48 pages/sec 12.05 revs/sec)
1600 (1.48 pages/sec 12.05 revs/sec)
1600 (1.48 pages/sec 12.05 revs/sec)
1700 (1.56 pages/sec 12.14 revs/sec)
1700 (1.56 pages/sec 12.14 revs/sec)
1800 (1.59 pages/sec 11.95 revs/sec)
1800 (1.59 pages/sec 11.95 revs/sec)
1900 (1.65 pages/sec 12.03 revs/sec)
1900 (1.65 pages/sec 12.03 revs/sec)
2000 (1.70 pages/sec 12.30 revs/sec)
2000 (1.70 pages/sec 12.30 revs/sec)
2100 (1.76 pages/sec 12.38 revs/sec)
2100 (1.76 pages/sec 12.38 revs/sec)
2200 (1.83 pages/sec 12.49 revs/sec)
2200 (1.83 pages/sec 12.49 revs/sec)
2300 (1.89 pages/sec 12.59 revs/sec)
2300 (1.89 pages/sec 12.59 revs/sec)
2400 (1.93 pages/sec 12.66 revs/sec)
2400 (1.93 pages/sec 12.66 revs/sec)
2500 (1.98 pages/sec 12.71 revs/sec)
2500 (1.98 pages/sec 12.71 revs/sec)
2600 (2.02 pages/sec 12.72 revs/sec)
2600 (2.02 pages/sec 12.72 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.01 pages/sec 12.38 revs/sec)
2700 (2.00 pages/sec 12.38 revs/sec)
2700 (2.00 pages/sec 12.38 revs/sec)
2700 (2.00 pages/sec 12.37 revs/sec)
2800 (2.06 pages/sec 12.46 revs/sec)
2800 (2.06 pages/sec 12.46 revs/sec)
:
3600 (2.30 pages/sec 12.43 revs/sec)
3600 (2.30 pages/sec 12.43 revs/sec)
3600 (2.30 pages/sec 12.43 revs/sec)
3600 (2.30 pages/sec 12.43 revs/sec)
3600 (2.30 pages/sec 12.43 revs/sec)
:
5000 (2.54 pages/sec 11.36 revs/sec)
5000 (2.53 pages/sec 11.36 revs/sec)
5000 (2.53 pages/sec 11.35 revs/sec)
:
9600 (4.02 pages/sec 12.06 revs/sec)
9700 (4.04 pages/sec 12.07 revs/sec)
9800 (4.08 pages/sec 12.09 revs/sec)
9900 (4.09 pages/sec 12.09 revs/sec)
10000 (4.12 pages/sec 12.11 revs/sec)
10100 (4.15 pages/sec 12.14 revs/sec)
:
10500 (4.24 pages/sec 12.19 revs/sec)
10600 (4.28 pages/sec 12.21 revs/sec)
10700 (4.31 pages/sec 12.23 revs/sec)
10800 (4.34 pages/sec 12.25 revs/sec)
10800 (4.34 pages/sec 12.25 revs/sec)
10900 (4.36 pages/sec 12.26 revs/sec)
11000 (4.39 pages/sec 12.28 revs/sec)
11100 (4.41 pages/sec 12.29 revs/sec)
11200 (4.43 pages/sec 12.29 revs/sec)
11300 (4.46 pages/sec 12.32 revs/sec)
11400 (4.49 pages/sec 12.34 revs/sec)
11500 (4.52 pages/sec 12.36 revs/sec)
11600 (4.55 pages/sec 12.38 revs/sec)
11700 (4.57 pages/sec 12.40 revs/sec)
11700 (4.57 pages/sec 12.40 revs/sec)
11700 (4.57 pages/sec 12.40 revs/sec)
11800 (4.59 pages/sec 12.40 revs/sec)
11900 (4.62 pages/sec 12.42 revs/sec)
12000 (4.58 pages/sec 12.35 revs/sec)
12100 (4.61 pages/sec 12.37 revs/sec)
12200 (4.60 pages/sec 12.33 revs/sec)
12300 (4.63 pages/sec 12.35 revs/sec)
12400 (4.63 pages/sec 12.36 revs/sec)
12500 (4.66 pages/sec 12.38 revs/sec)
12500 (4.66 pages/sec 12.38 revs/sec)
12600 (4.68 pages/sec 12.39 revs/sec)
12700 (4.71 pages/sec 12.42 revs/sec)
12700 (4.71 pages/sec 12.42 revs/sec)
12800 (4.74 pages/sec 12.44 revs/sec)
12900 (4.76 pages/sec 12.45 revs/sec)
13000 (4.79 pages/sec 12.48 revs/sec)
:
13700 (4.98 pages/sec 12.61 revs/sec)
13800 (5.01 pages/sec 12.63 revs/sec)
13900 (5.04 pages/sec 12.65 revs/sec)
14000 (5.06 pages/sec 12.67 revs/sec)
14100 (5.09 pages/sec 12.70 revs/sec)
14200 (5.03 pages/sec 12.55 revs/sec)
14300 (5.05 pages/sec 12.57 revs/sec)
14400 (5.08 pages/sec 12.59 revs/sec)
Done!
You might want to run rebuildrecentchanges.php to regenerate
the recentchanges page.
-bash-3.2#
-bash-3.2# php  rebuildrecentchanges.php
DB connection error: Access denied for user 'root'@'localhost' (using password: NO) (localhost)

-bash-3.2# cat rebuildrecentchanges.php
<?php
/**
 * Rebuild link tracking tables from scratch.  This takes several
 * hours, depending on the database size and server configuration.
 *
 * @file
 * @todo document
 * @ingroup Maintenance
 */

/** */
require_once( "commandLine.inc" );
require_once( "rebuildrecentchanges.inc" );
$wgTitle = Title::newFromText( "Rebuild recent changes script" );

$wgDBuser                       = $wgDBadminuser;
$wgDBpassword           = $wgDBadminpassword;

rebuildRecentChangesTable();

print "Done.\n";
exit();


-bash-3.2# php  rebuildrecentchanges.php
Loading from page and revision tables...
$wgRCMaxAge=604800 (7 days)
Updating links and size differences...
Loading from user, page, and logging tables...
Flagging bot account edits...
Flagging auto-patrolled edits...
Done.
-bash-3.2#

20130330影像檔移轉至http://ht.kmvs.km.edu.tw/insecta3

將20130309insectimage.tgz傳到ht

[root@ht htdocs]# mv ~webadm/data/20130309insectimage.tgz .
[root@ht htdocs]# tar xvzf 20130309insectimage.tgz 
:
images/f/f9/20080720北橫巴博庫魯山紹德龜金花蟲1d.JPG
[root@ht htdocs]# cd images
[root@ht images]# pwd
/usr/local/apache2/htdocs/images
[root@ht images]# ls
0  2  4  6  8  a        b  d        e  README  thumb
1  3  5  7  9  archive  c  deleted  f  temp    tmp
[root@ht images]# ls tmp
[root@ht images]# rm -rf thumb
[root@ht images]# ls temp
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
[root@ht images]# rm -rf temp
[root@ht images]# ls deleted/
1  2  3  4  5  6  8  9  a  b  c  d  g  h  i  j  k  l  m  n  o  p  q  r  s  t
[root@ht images]# rm -rf deleted/
[root@ht images]# 
[root@ht images]# mkdir ../img20130330
[root@ht images]# find . -type f -exec cp \{\} /usr/local/apache2/htdocs/img20130330/ \;
[root@ht images]# cd ..
[root@ht htdocs]# pwd
/usr/local/apache2/htdocs
[root@ht htdocs]# ls img20130330/ -l|wc
  16920  152273 1795471
[root@ht htdocs]# 

[root@ht htdocs]# cd insecta3/
[root@ht insecta3]# php maintenance/importImages.php /usr/local/apache2/htdocs/img20130330

:
20130330am10:30停電中斷


:
Importing 20080831宜蘭烘爐地山杜紅十星瓢蟲2b.JPG...done.
Importing 20080702玉山塔塔加至排雲山莊段未知蝗1a.JPG...done.
Importing 20090830新竹縣尖石鄉鎮西堡哈露斯民宿台灣長臂金龜1e.JPG...done.
Importing 20090222宜蘭員山鄉往草埤的隘界路琉璃蛺蝶1d.JPG...done.
Importing 20080323宜蘭縣大礁溪北岸農路未知種大蚊1a.JPG...done.
:
Importing 20080816宜蘭縣龍潭湖斯文豪大蝸牛1p.JPG...done.
Importing 20080427宜蘭縣員山鄉冷埤二叉黑條蠅虎1a.JPG...done.
Importing 20090307宜蘭縣冬山鄉照安路底溪谷一點同緣椿象1d.JPG...done.
Importing 20091017宜蘭縣員山鄉大礁溪福安宮矮仙丹上的大琉璃紋鳳蝶1b.JPG...done.
Importing 20080816宜蘭縣龍潭湖斯文豪大蝸牛1g.JPG...done.

Found: 11725
Added: 11725
-bash-3.2#
全部轉移完成


20091031影像檔移轉至http://140.111.91.161/ad

將20091029insectimage.tgz傳到ad

-bash-3.2# cd insecta20091031
-bash-3.2# pwd
/usr/local/apache2/htdocs/insecta20091031
-bash-3.2# ls -l
總計 7694848
-rw-r--r-- 1 root root 7871822461 2009-10-31 20:54 20091029insectimage.tgz
-bash-3.2#
-bash-3.2# tar xvzf 20091029insectimage.tgz
:
images/f/f9/20090319宜蘭高商黃粉紅斑瘤蛾1l.JPG
images/f/f9/20090325南湖大山勝光防火巷蠍蛉1d.JPG
images/f/f9/20090523宜蘭縣大礁溪上游河畔未知蠅虎1b.JPG
images/f/f9/20081115花蓮和平站至澳花瀑布長尾鞭蠍1b.JPG
images/f/f9/20080720北橫巴博庫魯山紹德龜金花蟲1d.JPG
-bash-3.2#
-bash-3.2# pwd
/usr/local/apache2/htdocs/insecta20091031/images
-bash-3.2# ls
0  1  2  3  4  5  6  7  8  9  a  archive  b  c  d  deleted  e  f  README  temp  thumb  tmp
-bash-3.2# rm -rf thumb
-bash-3.2# ls temp
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
-bash-3.2# ls tmp
-bash-3.2# rm -rf temp
-bash-3.2# rm -rf deleted

-bash-3.2# find . -type f -exec cp \{\} ~/insecta20091031/img2/ \;


-bash-3.2# ls -l img2|wc
  11727   93810 1245029
-bash-3.2#
-bash-3.2# pwd
/usr/local/apache2/htdocs/insecta20091031/img2
-bash-3.2# ls *|wc
  11726   11726  682166
-bash-3.2#

-bash-3.2# ls * -l|wc
  11726   93808 1245014
-bash-3.2#
-bash-3.2# pwd
/usr/local/apache2/htdocs/insecta20091031/img2
-bash-3.2# cd ~webadm/ad
-bash-3.2# pwd
/usr/local/apache2/htdocs/ad
-bash-3.2# php maintenance/importImages.php /usr/local/apache2/htdocs/insecta20091031/img2 jpg
:
Importing 20080831宜蘭烘爐地山杜紅十星瓢蟲2b.JPG...done.
Importing 20080702玉山塔塔加至排雲山莊段未知蝗1a.JPG...done.
Importing 20090830新竹縣尖石鄉鎮西堡哈露斯民宿台灣長臂金龜1e.JPG...done.
Importing 20090222宜蘭員山鄉往草埤的隘界路琉璃蛺蝶1d.JPG...done.
Importing 20080323宜蘭縣大礁溪北岸農路未知種大蚊1a.JPG...done.
:
Importing 20080816宜蘭縣龍潭湖斯文豪大蝸牛1p.JPG...done.
Importing 20080427宜蘭縣員山鄉冷埤二叉黑條蠅虎1a.JPG...done.
Importing 20090307宜蘭縣冬山鄉照安路底溪谷一點同緣椿象1d.JPG...done.
Importing 20091017宜蘭縣員山鄉大礁溪福安宮矮仙丹上的大琉璃紋鳳蝶1b.JPG...done.
Importing 20080816宜蘭縣龍潭湖斯文豪大蝸牛1g.JPG...done.

Found: 11725
Added: 11725
-bash-3.2#
全部轉移完成


20091114安裝ftp伺服程式

-bash-3.2# yum install vsftpd

-bash-3.2# yum install vsftpd
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.i386 0:2.0.5-21.fc8 set to be updated
updates-newkey/filelists_db                                                                           | 6.9 MB     05:19
Error: pkgKey 4828 doesn't exist in repo updates
-bash-3.2#

login as: webadm
webadm@insecta.idv.tw's password: ******
Last login: Sat Nov 14 21:16:51 2009 from 60-250-218-148.hinet-ip.hinet.net
-bash-3.2# wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.1.tar.gz
--2009-11-14 21:39:36--  ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.1.tar.gz
           => `vsftpd-2.2.1.tar.gz'
正在查找主機 vsftpd.beasts.org... 93.93.130.44
正在連接 vsftpd.beasts.org|93.93.130.44|:21... 連上了。
以 anonymous 的身分登入... 登入完成!
==> SYST ... 完成。    ==> PWD ... 完成。
==> TYPE I ... 完成。  ==> CWD /users/cevans ... 完成。
==> SIZE vsftpd-2.2.1.tar.gz ... 185226
==> PASV ... 完成。    ==> RETR vsftpd-2.2.1.tar.gz ... 完成。
長度: 185226 (181K)

100%[======================================>] 185,226     89.3K/s   in 2.0s

2009-11-14 21:39:44 (89.3 KB/s) - 已儲存‘vsftpd-2.2.1.tar.gz’ [185226]

-bash-3.2#
-bash-3.2# tar xvzf vsftpd-2.2.1.tar.gz
access.c     dummyinc     ftppolicy.h    netstr.h          privops.c        secbuf.c      str.c         tunables.h
access.h     EXAMPLE      hash.c         oneprocess.c      privops.h        secbuf.h      str.h         TUNING
ascii.c      FAQ          hash.h         oneprocess.h      privsock.c       SECURITY      strlist.c     twoprocess.c
ascii.h      features.c   INSTALL        opts.c            privsock.h       secutil.c     strlist.h     twoprocess.h
AUDIT        features.h   ipaddrparse.c  opts.h            ptracesandbox.c  secutil.h     sysdeputil.c  utility.c
banner.c     filesize.h   ipaddrparse.h  parseconf.c       ptracesandbox.h  session.h     sysdeputil.h  utility.h
banner.h     filestr.c    LICENSE        parseconf.h       README           SIZE          sysstr.c      vsf_findlibs.sh
BENCHMARKS   filestr.h    logging.c      port              README.security  SPEED         sysstr.h      vsftpd.8
BUGS         ftpcmdio.c   logging.h      postlogin.c       README.ssl       ssl.c         sysutil.c     vsftpd.conf
builddefs.h  ftpcmdio.h   ls.c           postlogin.h       readwrite.c      ssl.h         sysutil.h     vsftpd.conf.5
Changelog    ftpcodes.h   ls.h           postprivparent.c  readwrite.h      sslslave.c    tcpwrap.c     vsftpver.h
COPYING      ftpdataio.c  main.c         postprivparent.h  RedHat           sslslave.h    tcpwrap.h     xinetd.d
COPYRIGHT    ftpdataio.h  Makefile       prelogin.c        REFS             standalone.c  TODO
defs.h       ftppolicy.c  netstr.c       prelogin.h        REWARD           standalone.h  tunables.c
-bash-3.2# cd vsftpd-2.2.1
-bash-3.2# pwd
/usr/local/apache2/htdocs/vsftpd-2.2.1
-bash-3.2# make
-bash-3.2# cat INSTALL
INSTALL
=======

This file details how to build and install / run vsftpd from the vsftpd
distribution .tar.gz file.

Step 1) Build vsftpd.

Switch to the directory created when you unpacked the vsftpd .tar.gz file.
e.g.:

cd vsftpd-1.1.2

edit "builddefs.h" to handle compile-time settings (tcp_wrappers build,
etc).

Just type "make" (and mail me to fix it if it doesn't build ;-).
This should produce you a vsftpd binary. You can test for this, e.g.:

[chris@localhost vsftpd]$ ls -l vsftpd
-rwxrwxr-x    1 chris    chris       61748 Sep 27 00:26 vsftpd

Step 2) Satisfy vsftpd pre-requisites
2a) vsftpd needs the user "nobody" in the default configuration. Add this
user in case it does not already exist. e.g.:

[root@localhost root]# useradd nobody
useradd: user nobody exists

2b) vsftpd needs the (empty) directory /usr/share/empty in the default
configuration. Add this directory in case it does not already exist. e.g.:

[root@localhost root]# mkdir /usr/share/empty/
mkdir: cannot create directory `/usr/share/empty': File exists

2c) For anonymous FTP, you will need the user "ftp" to exist, and have a
valid home directory (which is NOT owned or writable by the user "ftp").
The following commands could be used to set up the user "ftp" if you do not
have one:

[root@localhost root]# mkdir /var/ftp/
[root@localhost root]# useradd -d /var/ftp ftp

(the next two are useful to run even if the user "ftp" already exists).
[root@localhost root]# chown root.root /var/ftp
[root@localhost root]# chmod og-w /var/ftp

Step 3) Install vsftpd config file, executable, man page, etc.

Running "make install" will try to copy the binary, man pages, etc. to
somewhere sensible.
Or you might want to copy these things by hand, e.g.:
cp vsftpd /usr/local/sbin/vsftpd
cp vsftpd.conf.5 /usr/local/man/man5
cp vsftpd.8 /usr/local/man/man8

"make install" doesn't copy the sample config file. It is recommended you
do this:
cp vsftpd.conf /etc

Step 4) Smoke test (without an inetd).

vsftpd can run standalone or via an inetd (such as inetd or xinetd). You will
typically get more control running vsftpd from an inetd. But first we will run
it without, so we can check things are going well so far.
Edit /etc/vsftpd.conf, and add this line at the bottom:

listen=YES

This tells vsftpd it will NOT be running from inetd.
Right, now let's try and run it!
Log in as root.
Make sure you are not running other FTP servers (or vsftpd will not be able
to use the FTP port, 21).
Run the binary from wherever you put it, e.g.:

[root@localhost root]# /usr/local/sbin/vsftpd &
[1] 2104

If all is well, you can now connect! e.g.:

[chris@localhost chris]$ ftp localhost
Connected to localhost (127.0.0.1).
220 (vsFTPd 1.1.1)
Name (localhost:chris): ftp
331 Please specify the password.
Password:
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,229,133)
150 Here comes the directory listing.
d--x--x--x    2 0        0            4096 Jan 14  2002 bin
d--x--x--x    2 0        0            4096 Apr 21 20:52 etc
drwxr-xr-x    2 0        0            4096 Apr 21 20:52 lib
drwxr-sr-x    2 0        50           4096 Jul 26 22:58 pub
226 Directory send OK.
ftp>

Step 5) Run from an inetd of some kind (optional - standalone mode is now
recommended)

You may want to run the binary from an inetd of some kind, because this can
give you extra features - e.g. xinetd has a lot of settings. (Note that
vsftpd's inbuilt listener covers most of the more useful xinetd settings).

5a) If using standard "inetd", you will need to edit /etc/inetd.conf, and add
a line such as:

ftp stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/vsftpd

(Make sure to remove or comment out any existing ftp service lines. If you
don't have tcp_wrappers installed, or don't want to use them, take out the
/usr/sbin/tcpd part).

inetd will need to be told to reload its config file:
kill -SIGHUP `pidof inetd`

5b) If using "xinetd", you can follow a provided example, by looking at the
file EXAMPLE/INTERNET_SITE/README. Various other examples show how to leverage
the more powerful xinetd features.


Step 6) Set up PAM for local logins (optional)

If you are running vsftpd on a PAM enabled machine, you will need to have a
/etc/pam.d/ftp file present, otherwise non-anonymous logins will fail. [NOTE -
if you have an older version of PAM, that file might be /etc/pam.conf]

For a standard setup, you can just copy a provided example file:
cp RedHat/vsftpd.pam /etc/pam.d/ftp


Step 7) Customize your configuration

As well as the above three pre-requisites, you are recommended to install a
config file. The default location for the config file is /etc/vsftpd.conf.
There is a sample vsftpd.conf in the distribution tarball. You probably want
to copy that to /etc/vsftpd.conf as a basis for modification, i.e.:

cp vsftpd.conf /etc

The default configuration allows neither local user logins nor anonymous
uploads. You may wish to change these defaults.

Other notes
===========

Tested platforms (well, it builds)
- Any modern, well featured platform should work fine! Recent versions of
the platforms listed below, and often older ones, should work fine.
- Fedora Core
- RedHat Linux
- RedHat Enterprise Linux
- Solaris / GNU tools (Solaris 8 or newer)
- SuSE Linux
- Debian Linux
- OpenBSD
- FreeBSD
- NetBSD
- HP-UX / GNU tools
- IRIX / GNU tools
- AIX / GNU tools
- Mac OS X (note; older versions have setgroups() problem. 10.3.4 reported OK)

-bash-3.2#

vsftp安裝

-bash-3.2# useradd nobody
useradd:使用者 nobody 已存在
-bash-3.2# mkdir /usr/share/empty/
mkdir: 無法建立目錄‘/usr/share/empty/’: 檔案已存在
-bash-3.2# mkdir /var/ftp/
-bash-3.2# useradd -d /var/ftp ftp
useradd:使用者 ftp 已存在
-bash-3.2# chown root.root /var/ftp
-bash-3.2# chmod og-w /var/ftp
-bash-3.2# make install
if [ -x /usr/local/sbin ]; then \
                install -m 755 vsftpd /usr/local/sbin/vsftpd; \
        else \
                install -m 755 vsftpd /usr/sbin/vsftpd; fi
if [ -x /usr/local/man ]; then \
                install -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
        elif [ -x /usr/share/man ]; then \
                install -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
        else \
                install -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
install: 無法建立普通檔案 ‘/usr/local/man/man8/vsftpd.8’: 沒有此一檔案或目錄
install: 無法建立普通檔案 ‘/usr/local/man/man5/vsftpd.conf.5’: 沒有此一檔案或目錄
make: *** [install] Error 1
-bash-3.2#
-bash-3.2# su
[root@insecta vsftpd-2.2.1]# make install
if [ -x /usr/local/sbin ]; then \
                install -m 755 vsftpd /usr/local/sbin/vsftpd; \
        else \
                install -m 755 vsftpd /usr/sbin/vsftpd; fi
if [ -x /usr/local/man ]; then \
                install -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
        elif [ -x /usr/share/man ]; then \
                install -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
        else \
                install -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
install: 無法建立普通檔案 ‘/usr/local/man/man8/vsftpd.8’: 沒有此一檔案或目錄
install: 無法建立普通檔案 ‘/usr/local/man/man5/vsftpd.conf.5’: 沒有此一檔案或目錄
make: *** [install] Error 1
[root@insecta vsftpd-2.2.1]#
[root@insecta vsftpd-2.2.1]# mkdir /usr/local/man/man8/
[root@insecta vsftpd-2.2.1]# mkdir /usr/local/man/man5/
[root@insecta vsftpd-2.2.1]# make install
if [ -x /usr/local/sbin ]; then \
                install -m 755 vsftpd /usr/local/sbin/vsftpd; \
        else \
                install -m 755 vsftpd /usr/sbin/vsftpd; fi
if [ -x /usr/local/man ]; then \
                install -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
        elif [ -x /usr/share/man ]; then \
                install -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
        else \
                install -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
                install -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
if [ -x /etc/xinetd.d ]; then \
                install -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi
[root@insecta vsftpd-2.2.1]#
[root@insecta vsftpd-2.2.1]# cp vsftpd.conf /etc
[root@insecta vsftpd-2.2.1]#

[root@insecta vsftpd-2.2.1]# vi /etc/vsftpd.conf
:

listen=YES
:
[root@insecta vsftpd-2.2.1]# /usr/local/sbin/vsftpd &
[1] 21471
[root@insecta vsftpd-2.2.1]#
[root@insecta vsftpd-2.2.1]# ftp localhost
Connected to localhost (127.0.0.1).
220 (vsFTPd 2.2.1)
Name (localhost:webadm): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
ftp> ls
227 Entering Passive Mode (127,0,0,1,124,127).
150 Here comes the directory listing.
226 Directory send OK.
ftp> quit
221 Goodbye.
[root@insecta vsftpd-2.2.1]#

[root@insecta ftp]# cat /etc/vsftpd.user_list
cat: /etc/vsftpd.user_list: 沒有此一檔案或目錄
[root@insecta ftp]# vi /etc/vsftpd.user_list
[root@insecta ftp]# cat /etc/vsftpd.user_list
root
bin
webadm
[root@insecta ftp]# vi /etc/vsftpd.chroot_list
[root@insecta ftp]# cat /etc/vsftpd.user_list
root
bin
webadm
[root@insecta ftp]# cat /etc/vsftpd.chroot_list
oldwu
[root@insecta ftp]#
[root@insecta ftp]# ps ax |grep ftp
21946 pts/1    S      0:00 /usr/local/sbin/vsftpd
[root@insecta ftp]# kill -9 21946
[root@insecta ftp]# /usr/local/sbin/vsftpd &
[2] 22126
[1]   已砍掉               /usr/local/sbin/vsftpd
[root@insecta ftp]# ftp localhost
Connected to localhost (127.0.0.1).
220 Welcome to TW Insecta FTP service.
Name (localhost:webadm): oldwu
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> quit
221 Goodbye.
[root@insecta ftp]# ftp localhost
Connected to localhost (127.0.0.1).
220 Welcome to TW Insecta FTP service.
Name (localhost:webadm): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> quit
221 Goodbye.
[root@insecta ftp]#
[root@insecta ftp]# service iptables stop
iptables: Flushing firewall rules:                         [  確定  ]
iptables: Setting chains to policy ACCEPT: nat             [  確定  ]
iptables: Unloading modules:                               [  確定  ]
[root@insecta ftp]#


[root@insecta var]# cat /etc/pam.d/vsftpd
#%PAM-1.0
#auth       required    pam_listfile.so item=user sense=deny file=/etc/vsftpd.ftpusers onerr=succeed
#auth       required    pam_stack.so service=system-auth
#auth       required    pam_shells.so
#account    required    pam_stack.so service=system-auth
#session    required    pam_stack.so service=system-auth
auth       sufficient   /lib/security/$ISA/pam_ldap.so
auth       required     /lib/security/$ISA/pam_unix.so
account    sufficient   /lib/security/$ISA/pam_ldap.so
account    required     /lib/security/$ISA/pam_unix.so
password   sufficient   /lib/security/$ISA/pam_ldap.so
password   required     /lib/security/$ISA/pam_unix.so

[root@insecta var]# cp /etc/pam.d/vsftpd /etc/pam.d/ftp

[root@insecta var]# ftp localhost
Connected to localhost (127.0.0.1).
220 Welcome to TW Insecta II  FTP service.
Name (localhost:webadm): webadm
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> user
(username) oldwu
331 Please specify the password.
Password:
230 Login successful.
ftp> ls
227 Entering Passive Mode (127,0,0,1,250,143).
150 Here comes the directory listing.
drwxrwxr-x    5 500      500          4096 Mar 14  2008 OOH680_m12_native_packed-1_zh-TW.9286
-rw-rw-r--    1 500      500      155863201 Sep 09  2008 OOo_2.4.0_LinuxIntel_install_zh-tw.tar.gz
drwxr-xr-x    4 0        0            4096 Aug 28  2008 insecta
drwxr-xr-x   10 0        0            4096 Sep 10 08:39 lnx
drwxr-xr-x    2 500      500          4096 Aug 22  2008 下載
drwxr-xr-x    2 500      500          4096 Aug 22  2008 公共
drwxr-xr-x    2 500      500          4096 Aug 22  2008 圖片
drwxr-xr-x    2 500      500          4096 Aug 22  2008 影片
drwxr-xr-x    2 500      500          4096 Aug 22  2008 文件
drwxr-xr-x    3 500      500          4096 Sep 09  2008 桌面
drwxr-xr-x    2 500      500          4096 Aug 22  2008 模板
drwxr-xr-x    2 500      500          4096 Aug 22  2008 音樂
226 Directory send OK.
ftp> quit

終於成功了,要有/etc/pam.d/ftp

HowToKeepSystemWork

20130309 Insecta Data Backu 0402ImportDump


[root@insecta ~]# cd /usr/local/apache2/htdocs/wiki
[root@insecta wiki]# cd maintenance/
[root@insecta maintenance]# mkdir /root/tmp
[root@insecta maintenance]# php dumpBackup.php --full > /root/tmp/20130309fullexport.xml

2013-03-09 08:13:07: insectawikidb-mw_ 22580 pages (134.218/sec), 53447 revs (317.695/sec), ETA 2013-03-09 08:13:11 [max 54891]

[root@insecta maintenance]# 
[root@insecta wiki]# tar cvzf 20130309insectimage.tgz images
[root@insecta tmp]# ls /root/tmp -l
總計 12843756
-rw-r--r-- 1 root root   222093504 2013-03-09 16:13 20130309fullexport.xml
-rw-r--r-- 1 root root 12917050280 2013-03-09 17:05 20130309insectimage.tgz
[root@insecta tmp]# 
[root@ht webadm]# cd /usr/local/apache2/htdocs/insecta3/maintenance/
[root@ht maintenance]# php importDump.php ~webadm/xml/20130403fullexport.xml 
100 (0.10 pages/sec 7.44 revs/sec)
Write failed: Broken pipe
[webadm@insecta ~]$ ls
1         Untitled 1.odt  下載  圖片  文件  模板
20130324  xml.tgz         公共  影片  桌面  音樂
[webadm@insecta ~]$ 

模板:目全覽