เนื่องจากผมต้องการ Share file บน HTTP Server (Apache2) โดยอยากให้มี User และ password
1. ทำการ update repo และติดตั้ง apache2 , apache2-utils เพิ่มเติม
root@linux:~#sudo apt-get update root@linux:~#sudo apt-get install apache2 apache2-utils -y
2. ทำการสร้าง Account สำหรับเข้าใช้งาน
root@linux:~# htpasswd -c /etc/apache2/.htpasswd user-share New password: Re-type new password: Adding password for user user-share root@linux:~#
3. ทำการ Configure Site บน Apache2 สำหรับการเข้าใช้งาน
root@linux:~# vi /etc/apache2/sites-enabled/000-default.conf
4. ทำการ Restart Apache2
root@linux:~#/etc/init.d/apache2 restart * Restarting web server apache2 [ OK ] root@linux:~#
5. จากนั้นลองเรียก URL path ที่ทำการ Configure ข้างต้นและใส่ user และ password ที่ได้ตั้งไว้ครับ
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPCfnijJi3eBkzIUg-F3YHvMLGlYVSZcgsqKGr_eNmfR-DkCrM79c11hgoO85HBZonf0DBfvoEcf5pDXu-sLXrUlDdmaGP1SC6R4aipKlrL3nQFhTW0P8o6k5WnTER4Kn_WjXNBe5PAShZ/s640/authen-http-2.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLos3br7yf0pe9MbO3basHbDr2mHgKTJosEHBsFHCQ-xygqQPb0sjqVaHAiV0-jHNmSpHPqRcGrIXVKMk9PKr3MD75naNRmYQPcyWVwglZ-8JS6OPj1mS6SSceYDYWHaP0laQ1gAEJ8KGO/s640/authen-http-3.png)
เสร็จเรียบร้อยครับ
URL Refer:
https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04
No comments:
Post a Comment