Skip to content

PlusMagi's Blog By Pitt Phunsanit

Plus emotional magic to the knowledge of logic.

  • About’s Pitt
Close Button
PlusMagi's Blog By Pitt Phunsanit Backend,Cloud Computing,Cybersecurity NGINX: password

NGINX: password

2004-12-062004-12-06| phunsanitphunsanit| 0 Comment | 07:00
Categories:
  • Backend
  • Cloud Computing
  • Cybersecurity

สามารถตั้ง username, password ให้เว็บไซต์หรือโฟลเดอร์อย่าง phpMyAdmin ได้เหมือนกัน

  1. สร้าง password file .htpasswd ก่อนโดยจริง ๆ มันคือตัวเดียวกับของ Apache สามารถใช้ command
    sudo htpasswd -c /etc/phpmyadmin/.htpasswd {username}
    เหมือนกันสามารถอ่านวิธีสร้างไฟล์นี้ได้จาก Apache: password หรือ
    1. ไปที่ folder ที่เก็บไฟล์เว็บไซต์หรือโฟลเดอร์ที่ต้องการ เช่น
      cd /etc/phpmyadmin/
    2. สร้างไฟล์รหัสผ่านโดยใช้คำสั่ง
      sudo htpasswd -c .htpasswd {username} เช่น
      sudo htpasswd -c .htpasswd pitt_p
      ระบุรหัสผ่านและยืนยันรหัสผ่าน
    3. สร้าง user เพิ่มเติมโดยไม่มี -c เช่น
      sudo htpasswd .htpasswd pitt
      จนกว่าจะครบ
  2. ไปที่ nginx config เช่น
    cd /etc/nginx/sites-available
  3. เปิดไฟล์ config เว็บไซต์ที่ต้องการ เช่น
    sudo nano pitt.plusmagi.com.conf เพิ่ม

    PHP

    ...
    server {
    ... location /phpmyadmin { auth_basic "Administrator’s Area"; auth_basic_user_file /etc/phpmyadmin/.htpasswd; }
    ...
    }
    ...
    
  • แล้ว save โดน CTRL + X และ Y
  • เทสคอนฟิกเกอเรชั่นโดยใช้
    nginx -t
  • รีสตาร์ทเอนจินเอกซ์ โดย
    sudo service nginx restart
  • เข้า url ที่ต้องการ ควรจะมีการถามยูสเซอร์ พาสเวิร์ด
  • อ่านเพิ่มเติม

    • Apache: password
    • Restricting Access with HTTP Basic Authentication/
    Tags: Authentication, Confluence, Download, Features, Login, Password, Release Train Engineer, Username, นโยบายสาธารณะ

    แนะแนวเรื่อง

    PREVIOUS Previous post: qBittorrent
    NEXT Next post: ไผ่ปล้องยาวกระบอกยักษ์ (Giant Internode Bamboo)

    Projects

    • Statement Columns Mapping Helper
    • PlusMagi Blocks
    • PlusMagi Site Search
    • PlusMagi Tags Reindex
    • jQuery Plus Repeater

    Recent Posts

    • Language & Runtime (C#, .NET 10, CLR, GC, Memory Management)
    • windows, mac, linux ในการเขียนโปรแกรม
    • C#: upgrade to .net Core
    • Linux: .NET SDK / Runtime
    • ระฆังทิเบต หรือ ขันทิเบต (Tibetan Singing Bowl)

    Archives

    Categories

    • Ai (792)
      • AI Robotics (1)
      • AI Strategy (1)
      • AI/ML Infrastructure (1)
      • Data Cleaning (1)
      • DeFi (1)
      • GNSS (1)
      • GNSS Technology (1)
      • Historical Data Analysis (1)
      • IoT Data Management (1)
      • ระบบวิเคราะห์ (1)
      • เทคโนโลยี GNSS (1)
      • เทคโนโลยีภูมิสารสนเทศ (1)
    • Backend (3,155)
      • Accessibility Technology (1)
      • Advanced Architecture (1)
      • Advanced JavaScript (1)
      • Agile Methodology (1)
      • Angular (5)
      • Api Integration (5)
      • Automation Testing (1)
      • C# Programming (5)
      • CAD/CAM (1)
      • Clean Architecture (1)
      • CMS Development (1)
      • Codeigniter (1)
      • Coding Theory (1)
      • Concurrency (5)
      • CSS Frameworks (1)
      • Data Structures (5)
      • Debugging Tools (3)
      • Design Patterns (5)
      • Development (1)
      • Digital Design (1)
      • Front-End Architecture (2)
      • Front-End Development (1)
      • Frontend Testing (1)
      • Game Development (1)
      • HTML5 (6)
      • Joget Development (1)
      • Jquery (24)
      • Localization (l10n) (1)
      • Low-code Platform (1)
      • Microservices Architecture (1)
      • Object-oriented Programming (5)
      • Object-oriented Programming (oop) (1)
      • Oop (1)
      • PHP Performance (1)
      • Pure JavaScript (1)
      • Scripting (1)
      • Software Design (1)
      • Software Design Pattern (1)
      • Software Quality Assurance (1)
      • Systems Programming (1)
      • Technical Design (1)
      • Technical Specification (1)
      • UI/UX Backend (1)
      • UI/UX Design (6)
      • UML (1)
      • User Experience (UX) (1)
      • Version Control (1)
      • Version Control System (1)
      • Web Development Tools (1)
      • Web Services (1)
      • สถาปัตยกรรมซอฟต์แวร์ (2)
    • Business (1,168)
      • Business Process Automation (1)
      • Business Process Management (1)
      • Business Process Modeling (1)
      • Career Planning (1)
      • Career Strategy (1)
      • Email Marketing (1)
      • Finance Tech (1)
      • Finance Technology (1)
      • Financial Modeling (4)
      • Financial Systems (1)
      • Financial Technology (fintech) (1)
      • Global Strategy (1)
      • Global Studies (1)
      • Good Governance (1)
      • HR Management (1)
      • Information Management (1)
      • Logistics Tech (1)
      • Marketing Strategy (1)
      • Quality Management (1)
      • Quantitative Finance (1)
      • Real Estate Investment (1)
      • Real Estate Tech (1)
      • SEO (1)
      • SEO Content (1)
      • Technical Analysis (26)
      • Technical Finance (1)
      • Technical Leadership (1)
      • Technical Skillset (1)
      • Technical Writing (29)
      • การจัดการวิกฤต (1)
      • การทำงาน (1)
      • การบริหารจัดการทรัพย์สิน (1)
      • การบริหารอาคาร (1)
      • การสื่อสารดิจิทัล (1)
      • การเงินดิจิทัล (1)
      • การเงินธุรกิจ (1)
      • จริยธรรมวิชาชีพ (1)
      • ประกันชีวิต (1)
      • ประกันภัยรถยนต์ (1)
      • สินทรัพย์ปลอดภัย (1)
      • อาชีพ (1)
    • Cloud Computing (1,390)
      • AWS (1)
      • Cloud Infrastructure (1)
      • Configuration Management (3)
      • Decentralized Systems (1)
      • DevOps Tools (1)
      • Distributed Computing (1)
      • Embedded Linux (1)
      • High Availability (1)
      • Home Lab (1)
      • IoT Systems (1)
      • IT Operations (1)
      • Legacy Systems Integration (1)
      • Linux Guides (1)
      • Machine Learning Operations (1)
      • Mlops (1)
      • Network Protocols (1)
      • Network Technology (1)
      • Network Tools (1)
      • Observability (3)
      • Open Source (1)
      • P2P Technology (1)
      • Scalability (1)
      • System Automation (1)
      • System Control (1)
      • System Engineering (1)
      • System Logging (1)
      • System Monitoring (1)
      • System Performance (1)
      • System Reliability (1)
      • System Simulation (1)
      • System Specialist (2)
      • Troubleshooting (1)
      • Web Hosting (1)
      • Web Server (1)
      • Wi-fi Technology (1)
      • Windows Automation (1)
    • Cybersecurity (653)
      • Data Forensics (1)
      • Email Security (1)
      • Identity Management (1)
      • Intellectual Property (1)
      • Iot Security (1)
      • Legal Technology (1)
      • PDPA Compliance (1)
      • Penetration Testing (1)
      • Real Estate Law (1)
      • Security Engineering (1)
      • Signal Intelligence (1)
      • Technical Compliance (2)
      • กฎหมาย รัฐบาล (1)
      • ความปลอดภัยทางกายภาพ (1)
      • ความปลอดภัยทางไซเบอร์ (1)
      • ความรับผิดทางกฎหมาย (2)
      • นิติวิทยาศาสตร์ดิจิทัล (1)
      • ระบบความปลอดภัยอาคาร (1)
      • ระบบป้องกันสัญญาณ (1)
    • Database (3,238)
      • Caching (1)
      • Concurrency Control (1)
      • Data Governance (19)
      • Data Structuring (1)
      • Data Types (1)
      • Database Analysis (1)
      • Database Caching (1)
      • Database ORM (1)
      • Database Protocols (1)
      • Database Standards (1)
      • Nosql (1)
      • Pl/pgsql (1)
      • PostgreSQL Database (1)
      • PostgreSQL Performance (1)
      • Postgresql Theory (1)
      • Postgresql Tuning (1)
      • Sql Tutorial (1)
      • Storage Technology (1)
    • Psychology (565)
      • Biological Psychology (1)
      • Child Development (1)
      • Ergonomics (1)
      • First Aid (1)
      • Health Wellness (8)
      • Healthtech (1)
      • Personal Development (7)
      • Psychology Informatics (1)
      • Sleep Science (1)
      • Soft Skills Development (1)
      • Survival Skills (1)
      • Technology Psychology (1)
      • Toxicology (1)
      • การจัดการข้อมูลสุขภาพ (1)
      • การดูแลตัวเอง (1)
      • การนอนหลับ (1)
      • การปฐมพยาบาล (1)
      • การเลี้ยงดูบุตร (1)
      • การแพทย์ทางเลือก (1)
      • การแพทย์เชิงป้องกัน (1)
      • ความปลอดภัยในบ้าน (1)
      • จริยธรรมทางการแพทย์ (1)
      • จิตวิทยาพัฒนาการ (1)
      • ทักษะการทำงาน (1)
      • วิทยาศาสตร์การแพทย์ (1)
      • สมุนไพร (1)
      • สุขภาพ โภชนาการ (1)
      • สุขภาพองค์รวม (1)
      • เทคโนโลยีสุขภาพ (1)
    • Technology (2,165)
      • Academic Publishing (1)
      • Academic Writing (1)
      • Aerospace Systems (1)
      • Ai Ethics (1)
      • Animation (1)
      • Anime Analysis (1)
      • Astrophysics (1)
      • Aviation Systems (1)
      • Best Practices (6)
      • Cabinetry (1)
      • Chemistry (1)
      • Chemistry Safety (1)
      • Climate Change Adaptation (1)
      • Communication Skills (7)
      • Community Development (1)
      • Conservation Tech (1)
      • Content Management System (2)
      • Cosmology (1)
      • Critical Thinking (1)
      • Cultural Informatics (1)
      • Defense Technology (1)
      • Digital Art (1)
      • Digital Humanities (1)
      • Digital Literacy (1)
      • Digital Preservation (1)
      • Disaster Management (1)
      • Emergency System (1)
      • Fantasy Analysis (1)
      • Film History (1)
      • Film Studies (1)
      • Food Science (1)
      • Food Technology (1)
      • Forensic Science (1)
      • Geography (1)
      • Geopolitics (1)
      • History Science (1)
      • Home Appliances (1)
      • Hospitality Tech (2)
      • Industrial Iot (1)
      • Information Theory (1)
      • Interior Design (1)
      • Iot (25)
      • IoT Data (1)
      • Iot Development (1)
      • Landscape Architecture (1)
      • Logic (1)
      • Mermaid.js (1)
      • Military Hardware (1)
      • Military Survival (1)
      • Military Tech (1)
      • Mining Industry (1)
      • Music Analysis (1)
      • Mythology (1)
      • Productivity Tools (2)
      • Propaganda (1)
      • Research Methodology (1)
      • Sci-fi Analysis (1)
      • Search Engine Technology (1)
      • Search Rescue (1)
      • SEO Technical (2)
      • Smart Building (1)
      • Smart Home (2)
      • Smart Mobility (1)
      • Social Computing (1)
      • Space Communication (1)
      • Surveying (1)
      • Surveying Engineering (1)
      • System Biology (1)
      • System Specialization (6)
      • Tech Review (1)
      • Technical Communication (6)
      • Technical Concept (1)
      • Technical Deep Dive (11)
      • Technical Development (2)
      • Technical Ethics (1)
      • Technical Guide (7)
      • Technical Guides (1)
      • Technical Reporting (1)
      • Technical Skill Development (1)
      • Technical Skills (7)
      • Technical Tutorial (1)
      • Technology Analysis (1)
      • Technology Comparison (1)
      • Technology Development (1)
      • Technology Integration (1)
      • Technology Leadership (1)
      • Technology Learning (1)
      • Technology System Design (1)
      • Tips And Tricks (14)
      • Travel Guide (1)
      • Underwater Communication (1)
      • UNESCO (1)
      • Veteran Affairs (1)
      • Weaponry Analysis (1)
      • การตกแต่งภายใน (1)
      • การทหาร (1)
      • การออกแบบภูมิทัศน์ (1)
      • การเกษตร (1)
      • ความปลอดภัยทางโครงสร้าง (1)
      • ความปลอดภัยทางไฟฟ้า (1)
      • ความมั่นคงระหว่างประเทศ (1)
      • ความรู้พื้นฐาน (1)
      • งานหัตถกรรม (1)
      • ดนตรี (1)
      • นิติวิทยาศาสตร์ (1)
      • ประวัติศาสตร์เทคโนโลยี (1)
      • พลังงานสะอาด (1)
      • พันธุศาสตร์ (1)
      • พืชพรรณ (1)
      • พุทธ (1)
      • ภูมิทัศน์ (1)
      • ยานยนต์ไฟฟ้า (1)
      • ระบบทหาร (1)
      • ระบบนำทาง (1)
      • ระบบยานยนต์ (1)
      • ระบบอาคารอัจฉริยะ (1)
      • ระบบเทคโนโลยี (1)
      • ระบบโครงสร้าง (1)
      • ระบบไฟฟ้า (1)
      • ระบบไอที (1)
      • วรรณคดีไทย (1)
      • วิทยาศาสตร์อวกาศ (1)
      • วิศวกรรมการทหาร (1)
      • วิศวกรรมยั่งยืน (1)
      • วิศวกรรมสถาปัตยกรรม (1)
      • สงครามเวียดนาม (1)
      • สถาปัตยกรรมโบราณ (1)
      • สถาปัตยกรรมไทย (1)
      • สาธารณูปโภค (1)
      • หุ่นยนต์ (1)
      • อาวุธเคมี (1)
      • เคมีภัณฑ์ (1)
      • เครื่องประดับ (1)
      • เครื่องใช้ไฟฟ้า (1)
      • เทคโนโลยี จริยธรรม (1)
      • เทคโนโลยี ปรัชญา (1)
      • เทคโนโลยีการแพทย์ (1)
      • เทคโนโลยีรถยนต์ (1)
      • เทคโนโลยีระบบข้อมูล (1)
      • เทคโนโลยีอาคาร (1)
      • เอเชียศึกษา (1)
      • โบราณคดี (1)
      • โลหะวิทยา (1)
      • ไซไฟ (1)
    • Uncategorized (1)

    Sirat WordPress Theme By VWThemes

    Scroll Up
    Go to mobile version