This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| protected:member:data [2016/08/22 06:09] – [Apache2] dirty | protected:member:data [2016/09/21 09:32] (current) – removed dirty | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Linux server ====== | ||
| - | *增加使用者建議使用 adduser較useradd為佳 會自動設定目錄 密碼 以及shell(自動複製.bashrc) | ||
| - | *vi /etc/passwd 改使用者剛進去的位置, | ||
| - | *在/ | ||
| - | *刪除使用者建議使用 deluser 或 userdel -r 可依並刪除目錄 | ||
| - | *將A使用者加入B Group: gpasswd -a A B | ||
| - | *新增使用者並設定UID GID (為了符合mount 硬碟內資料的權限) | ||
| - | < | ||
| - | *新增apt source list | ||
| - | < | ||
| - | *至[[https:// | ||
| - | | ||
| - | < | ||
| - | deb-src http:// | ||
| - | 貼上至sources.list最末行,即完成增加更新主機列表的動作 | ||
| - | *改sudo權限的使用者 | ||
| - | < | ||
| - | |||
| - | ====== Apache2 ====== | ||
| - | ===== 使系統上所有使用者都擁有自己的個人網頁 ===== | ||
| - | < | ||
| - | cd / | ||
| - | ln -s ../ | ||
| - | ln -s ../ | ||
| - | </ | ||
| - | ===== 禁止瀏覽目錄 ===== | ||
| - | < | ||
| - | 將原指令 | ||
| - | < | ||
| - | < | ||
| - | Options Indexes FollowSymLinks MultiViews | ||
| - | </ | ||
| - | 改成 | ||
| - | < | ||
| - | < | ||
| - | Options -Indexes FollowSymLinks MultiViews | ||
| - | </ | ||
| - | 以及 | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | </ | ||
| - | 改成 | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | AddHandler cgi-script .cgi .pl .php | ||
| - | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI | ||
| - | </ | ||
| - | </ | ||
| - | ===== 限制瀏覽 ===== | ||
| - | 在想要保護的目錄下, | ||
| - | < | ||
| - | AuthName "Hi, there." | ||
| - | AuthUserFile [passwd path]/ | ||
| - | AuthType Basic | ||
| - | require valid-user | ||
| - | </ | ||
| - | 創建具瀏覽權限的名單 .passwd | ||
| - | < | ||
| - | htpasswd -c [passwd path]/ | ||
| - | htpasswd [passed path]/ | ||
| - | </ | ||
| - | ===== 使位於/ | ||
| - | 修改userdir.conf | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | AddHandler cgi-script .cgi .pl .php | ||
| - | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI | ||
| - | </ | ||
| - | 再增加以下區段 | ||
| - | < | ||
| - | AllowOverride FileInfo AuthConfig Limit | ||
| - | AddHandler cgi-script .cgi .pl .php | ||
| - | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec +ExecCGI | ||
| - | </ | ||
| - | </ | ||
| - | 重開apache即可 | ||
| - | < | ||
| - | ===== 自動轉向do ===== | ||
| - | 新增/ | ||
| - | < | ||
| - | SetHandler cgi-script | ||
| - | </ | ||
| - | </ | ||
| - | 在/ | ||
| - | < | ||
| - | ====== Ubuntu ====== | ||
| - | *[[http:// | ||
| - | *指令: | ||