2016年3月7日 星期一

linux系統權限

常用的linux文件權限:
444 r--r--r--
600 rw-------
644 rw-r--r--
666 rw-rw-rw-
700 rwx------
744 rwxr--r--
755 rwxr-xr-x
777 rwxrwxrwx
從左至右,1-3位數字代表文件所有者的權限,4-6位數字代表同組用戶的權限,7-9數字代表其他用戶的權限。
而具體的權限是由數字來表示的,讀取的權限等於4,用r表示;寫入的權限等於2,用w表示;執行的權限等於1,用x表示;
通過4、2、1的組合,得到以下幾種權限:0(沒有權限);4(讀取權限);5(4+1 |讀取+執行);6(4+2 |讀取+寫入);7(4+ 2+1 |讀取+寫入+執行)
以755為例:
1-3位7等於4+2+1,rwx,所有者俱有讀取、寫入、執行權限;
4-6位5等於4 +1+0,rx,同組用戶具有讀取、執行權限但沒有寫入權限;
7-9位5,同上,也是rx,其他用戶具有讀取、執行權限但沒有寫入權限。
rwx權限數字解釋
chmod也可以用數字來表示權限如chmod 777 file
語法為:chmod abc file
其中a,b,c各為一個數字,分別表示User、Group、及Other的權限。
r=4,w=2,x=1
若要rwx屬性則4+2+1=7;
若要rw-屬性則4+2=6;
若要rx屬性則4+1=7。
範例:
chmod a=rwx file

chmod 777 file
效果相同
chmod ug=rwx,o=x file

chmod 771 file
效果相同
若用chmod 4755 filename可使此程序具有root的權限

出處:http://www.111cn.net/sys/linux/59979.htm

APACHE PHP關閉Shell Script 網站可能漏洞


ubuntu請至APACHE 更改以下位置的php.ini

第一步:
/etc/php5/apache2/php.ini

第二步:  (增加以下內容)
disable_functions=exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source


第三步: (關閉以下兩項目)
allow_url_fopen=Off
allow_url_include=Off

第四步: (重啟服務)
/etc/init.d/apache2 restart



出處:http://www.cyberciti.biz/faq/linux-unix-apache-lighttpd-phpini-disable-functions/

2016年2月1日 星期一

Excel 2010 無法貼上資料

請至微軟下載修正程式
https://support.microsoft.com/zh-tw/kb/2488238

2016年1月3日 星期日

關閉Apache2 目錄瀏覽及導引

1.只要刪除
/etc/apache2/sites-available/default 中的 Indexes 來停用目錄列表之功能

1 NameVirtualHost *
2 <VirtualHost *>
3  ServerAdmin webmaster@localhost
4  DocumentRoot /var/www/
5  <Directory />
6    Options FollowSymLinks
7    AllowOverride None
8  </Directory>
9  <Directory /var/www/>
10    Options Indexes FollowSymLinks MultiViews
11    AllowOverride None
12    Order allow,deny
13    allow from all
14    # This directive allows us to have apache2's default start page
15    # in /apache2-default/, but still have / go to the right place
16    #RedirectMatch ^/$ /apache2-default/
17  </Directory>


2.將錯誤的流量轉移至首頁
  1. 網站轉到指定頁面,在網站根目錄增加「.htaccess」檔案,若在其他目錄,就必須在各目錄建立「.htaccess」檔案。
  2. 將錯誤訊息403/404的訪客流量導引至首頁,也可以引導到指定網址。
    ErrorDocument 403 http://OOO.OOO.tw/
    ErrorDocument 404 http://OOO.OOO.tw/
  3. 檔案.htaccess設定完成後,只有根目錄的錯誤訊息會被轉址,其它子目錄並被轉址,因此還要將apache2.conf裡面的AllowOverride參數做設定。

    <Directory "/var/www">
    ..........
    AllowOverride None
    ......
    </Directory>

    改成

    <Directory /var/www">
    .........
    AllowOverride All
    ..........
    </Directory>
  4. 設定完成後,要重新啟動apache即可。

2015年12月29日 星期二

APACHE2 性能調教


提升效能限制,可以提高成以下設定: 

<IfModule prefork.c> 
# number of server processes to start 
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#startservers 
StartServers 128 
# minimum number of server processes which are kept spare 
http://httpd.apache.org/docs/2.2/mod/prefork.html#minspareservers 
MinSpareServers 16 
# maximum number of server processes which are kept spare 
http://httpd.apache.org/docs/2.2/mod/prefork.html#maxspareservers 
MaxSpareServers 64 
# highest possible MaxClients setting for the lifetime of the Apache process. 
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#serverlimit 
ServerLimit 2048 
# maximum number of server processes allowed to start 
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients 
MaxClients 2048 
# maximum number of requests a server process serves 
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild 
MaxRequestsPerChild 10000 
</IfModule> 

重啟 apache 請先 stop 再 start。 



出處文章
http://mepopedia.com/forum/read.php?146,419

2015年11月5日 星期四

新裝字型無法顯現在應用程式

1.字型安裝方法開啟 [控制台] 中的 [字型]。 在 [檔案] 功能表上,按一下 [安裝新字型]。 在 [磁碟機] 上,按一下想要的磁碟機。 在 [資料夾] 上,連按兩下包含想要新增的字型之資料夾。在 [字型清單] 上,按一下要新增的字型,再按 [確定]。
2.把 c:\windows\systen32\FNTCACHE.DAT砍掉再重新開機

2015年6月4日 星期四

Synology 空間升級方式

環境說明:
原是2BAY  兩顆2TB硬碟做RAID 1 。

升級更換方式:
1.準備兩顆 4TB以上硬碟。
2.將其中一顆原2TB硬碟熱抽拔起,系統會出現告警聲。
3.更換新硬碟後,並設定修復動作後讓它同步。
4.等同步完成後,再將第2顆舊的2TB熱抽拔除並更換。
5.再等它同步完成後,它就會自動擴增空間動作(顯示新增硬碟)即可完成升級空間!