馬仔資訊隨手記
Would you like to react to this message? Create an account in a few clicks or log in to continue.
馬仔資訊隨手記

馬仔資訊隨手記


您沒有登錄。 請登錄註冊

安裝 Debian8.5

向下  內容 [第1頁(共1頁)]

1安裝 Debian8.5 Empty 安裝 Debian8.5 周三 7月 20, 2016 8:08 am

Admin


Admin

安裝 vi 加強版 #操作 vi 怪怪的,所以安裝加強版
apt-get install vim

更新系統
apt-get -y update #更新你電腦內的 套件庫 索引
apt-get -y upgrade #更新你已安裝套件到最新版本
apt-get dist-upgrade #更新核心等等重要的東西

apt-get 套件安裝、移除、升級好工具
http://chentunglee.blogspot.tw/2009/12/apt-get.html
apt-get remove #自動移除套件,並留下設定檔

apt-get --purge remove #自動移除套件,不保留設定檔

ls /var/cache/apt/archives -la
清除下載後的套件
apt-get clean

useradd -m xyz # 新增使用者xyz -m的參數是在 /home 下建立使用者 xyz 的家目錄

tail -f /var/log/xxxxxxx #檢視目前最新的紀錄檔

https://kinhorse.666forum.com

2安裝 Debian8.5 Empty 回復: 安裝 Debian8.5 周二 7月 26, 2016 4:14 am

Admin


Admin

安裝 apache2
apt-get install apache2

apache的設定,設定使用者網頁路徑
vi /etc/apache2/mods-available/userdir.conf
代碼:
<IfModule mod_userdir.c>
        UserDir public_html
        UserDir disabled root

        <Directory /home/*/public_html>
                AllowOverride FileInfo AuthConfig Limit Indexes
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                <Limit GET POST OPTIONS>
                        Require all granted
                </Limit>
                <LimitExcept GET POST OPTIONS>
                        Require all denied
                </LimitExcept>
        </Directory>
</IfModule>
可以將上述兩個 public_html 修改成 www 較為簡短
將 Indexes 刪除,避免目錄中沒有 index.htm (首頁) 而被瀏覽者看到目錄中所有的檔案或資料夾

service apache2 restart #重新啟動 apache
a2enmod userdir #預設個人網頁存放 public_html ,若出現 404 錯誤訊息,必須執行這個指令。啟用個人網頁模組


避免 /var/www/html 的目錄中沒有 index.htm (首頁) 而被瀏覽者看到目錄中所有的檔案或資料夾
vi /etc/apache2/apache2.conf #修改 apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews #將 Indexes 刪除
AllowOverride None
Order allow,deny
allow from all
</Directory>
service apache2 restart #重新啟動 apache



Admin 在 周二 7月 26, 2016 4:46 am 作了第 3 次修改

https://kinhorse.666forum.com

3安裝 Debian8.5 Empty 回復: 安裝 Debian8.5 周二 7月 26, 2016 4:31 am

Admin


Admin

vsftpd
apt-get install vsftpd #安裝vsftpd

vi /etc/vsftpd.conf #修改vsftpd.conf
https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-on-ubuntu-12-04

anonymous_enable=YES (YES可以匿名登入ftp,如果修改NO,則取消匿名登入)

#chroot_local_user=YES
將上一行 # 刪除,則可以讓使用者無法離開自己的家目錄,讓使用者無法任意進入系統的目錄。

將 # local_umask=022 前面的 #(註解)拿掉,使用者上傳後的檔案權限才是755;如果 #(註解)沒有刪除,預設上傳的檔案權限為700,如果檔案權限為700,上傳網頁資料就無法瀏覽 >_<

將 # local_enable=Yes 前面的 #(註解)拿掉,可以讓使用者登入ftp

將 # write_enable=YES 前面的 #(註解)拿掉,才可以讓使用者寫入檔案

/etc/init.d/vsftpd restart #啟動 vsftpd

500 OOPS: vsftpd: refusing to run with writable root inside chroot() #使用ftp傳輸軟體出現錯誤訊息無法登入
allow_writeable_chroot=YES #在vsftpd.conf設定檔內自行新增以下指令,要求vsftpd讓使用者在對自己的家目錄有寫入的權限下仍然允許連線。
參考資料:
http://ifresh.cc/solution-to-vsftpd-refusing-to-run-with-writable-root-inside-chroot/

不安全的伺服器, 它不支援透過 TLS 的 FTP #使用FileZilla檔案傳輸軟體出現的訊息
http://www.powerweb.tw/modules/news/V221.html


anonymous_enable=YES (YES可以匿名登入ftp,如果修改NO,則取消匿名登入)
service vsftpd restart #啟動 vsftpd
匿名者預設登入的根目錄是以 ftp 這個使用者的家目錄為主,可以使用『 finger ftp 』來查閱
/srv/ftp #預設匿名根目錄
http://linux.vbird.org/linux_server/0410vsftpd.php#anon_home

https://kinhorse.666forum.com

4安裝 Debian8.5 Empty 回復: 安裝 Debian8.5 周五 7月 29, 2016 4:39 am

Admin


Admin

安裝 MySQL
apt-get install mysql-server php5-mysql

安裝 PHP
apt-get install php5 libapache2-mod-php5 php5-mcrypt
vi /etc/apache2/mods-enabled/dir.conf #修改一下路徑設定檔,將index.php往前移

service apache2 restart #重啟Apache

安裝 phpMyadmin
apt-get install phpMyadmin

http://xxx.xxx.xxx/phpmyadmin

vi /etc/apache2/conf-enabled/phpmyadmin.conf #修改 phpmyadmin 預設網頁路徑
Alias /phpadmin /usr/share/phpmyadmin

service apache2 restart #重啟Apache

https://kinhorse.666forum.com

5安裝 Debian8.5 Empty 回復: 安裝 Debian8.5 周五 7月 29, 2016 5:31 am

Admin


Admin

練習安裝 phpBB3 論壇
用命令列管理MySQL使用者
在文字指令中,輸入 mysql -uroot -p
mysql > create user 'kitty'@'localhost' identified by '12345678'; #建立MySQL使用者kitty,並設定密碼

mysql > create database phpbb; #建立資料庫

給予使用者使用該資料庫的權限
SQL 語法:
代碼:
grant all privileges on phpbb.* to kitty@localhost IDENTIFIED BY '12345678';

mysql > exit #離開

到竹貓星球,下載 phpBB3 ,安裝 phpBB3 論壇來測試 (OK)
http://www.phpbb-tw.net/phpbb/viewforum.php?f=6
http://phpbb-tw.net/phpbb/download/phpBB-3.1.9.zip

phpBB-3.1.9.zip是zip的壓縮檔,預設並沒有安裝解zip的檔案,請執行以下指令
apt-get install unzip #安裝解zip的檔案

unzip phpBB-3.1.9.zip #unzip是解zip檔案的指令
解壓縮後,將phpBB-3.1.9.zip目錄下的phpBB3 搬移到 /var/www/html

apt-get install Imagemagick #安裝 Imagemagick 支援

http://xxx.xxx.xxx.xxxx/phpBB3 #進行安裝

chmod 777 cache/ files/ store/
chmod 777 images/avatars/upload/ config.php

https://kinhorse.666forum.com

6安裝 Debian8.5 Empty 回復: 安裝 Debian8.5 周五 7月 29, 2016 7:55 am

Admin


Admin

samba 安裝設定

apt-get install samba #apt安裝samba

備份 smb.conf
cp /etc/samba/smb.conf /etc/samba/smb.conf.old

編輯Samba設定檔
vi /etc/samba/smb.conf

[global] #設定整體的環境

workgroup = Ubuntu #群組名稱自訂,會出現在Windows的網路芳鄰中
netbios name = kitty #電腦名稱自訂,若不設,預設為HostName。最好設定一下。

拒絕存取的檔案 (最後一定要加上/)
veto files = /*.eml/*.nws/*.HTT/desktop.ini/riched20.dll/*.com/*.exe/*.mp3/*.EXE/*.COM/*.MP3/
delete veto files = yes

以下設定共用的資源

[homes] #使用者存取自己目錄的設定
comment = Home Directories #comment為說明
browseable = no #使用者的目錄,要需要讓人瀏覽嗎
writable = yes #要新增此行,使用者可以寫入自己的目錄。
valid users = %S #一定要有這一行,要不然 >_<

執行 testparm 命令,測試一下smb.conf 的語法是否正確。如果您看到 “Loaded services file OK.”的話,基本上就沒語法的設定問題了。

service smbd restart #重新啟動Samba

測試:
在桌面〔我的電腦〕上,按下滑鼠右鍵 → 連線網路磁碟機,在資料夾的欄位上輸入 \\ip(電腦名稱)\帳號 後,會跳出一個認證視窗。

輸入帳號及密碼,密碼正確,卻一直登入不進>_<,因為沒有登入samba的密碼 (如果大量建立使用者帳號,建議使用 webmin ,內建有組態 Unix 和 Samba 使用者自動同步。並安裝 openwebmail 使用 Open WebMail 變更密碼的時候,順便變更 samba 密碼 )

smbpasswd -a 使用者 #建立 samba 使用者的密碼的指令

測試成功 ^_^

中斷網路磁碟機
在桌面〔我的電腦〕上,按下滑鼠右鍵 → 中斷網路磁碟機

備註:使用 useradd -m 使用者,建立使用者帳號,如果使用 openwebmail 來變更密碼,因為預設並沒有給予登入samba的密碼,所以,
密碼如果變更成功,會出現 500 Internal Server Error 錯誤的網頁,關閉此錯誤的頁面,重新回到 openwebmail 的登入頁面,以變更後的密碼登入。

參考資料:
http://wdpsestea.blogspot.tw/2014/02/samba.html
http://www.suse.url.tw/sles10/lesson14.htm


如果 Samba 無法跑出認證視窗,在 smb.conf 的設定檔中,將 map to guest = bad user 註解起來。

security = user :使用者必須要有帳密才可登入,與 「map to guest = bad user」意思相反,所以這兩者只有擇一設定
http://myip.tw/itsmw/index.php?title=Ob2d_samba

https://kinhorse.666forum.com

回頂端  內容 [第1頁(共1頁)]

這個論壇的權限:
無法 在這個版面回復文章