<?xml version="1.0" encoding="UTF-8" ?><!-- generator=Zoho Sites --><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><atom:link href="https://www.daihockhonggiay.com/blogs/tag/website/feed" rel="self" type="application/rss+xml"/><title>Đại học Không Giấy - Blog #website</title><description>Đại học Không Giấy - Blog #website</description><link>https://www.daihockhonggiay.com/blogs/tag/website</link><lastBuildDate>Wed, 10 Sep 2025 03:36:59 -0700</lastBuildDate><generator>http://zoho.com/sites/</generator><item><title><![CDATA[Giới thiệu về dịch vụ WEB và cách cài đặt hệ thống Website]]></title><link>https://www.daihockhonggiay.com/blogs/post/gioi-thieu-ve-dich-vu-web-va-cach-cai-dat-he-thong-website</link><description><![CDATA[<img align="left" hspace="5" src="https://www.daihockhonggiay.com/53.jpg"/>Dịch vụ Web là: dịch vụ liên kết trang siêu văn bản. Dùng để truyền thông tin tới người dùng một cách đa dạng và phong phú như Video, văn bản, hình ảnh… Khi dữ liệu truyền sẽ được phân mảnh thành các MTU, 1MTU = 1500 Byte]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_bdY6jNLiS4WKDdUIwUCDZg" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_kRbWTxcxSEyJlPnowcKWZQ" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"></style><div data-element-id="elm_jI1_-4DvRNGNEOfJUFb_MQ" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"></style><div data-element-id="elm_nHkL3LgbTJSzDoS_IdQi4Q" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_nHkL3LgbTJSzDoS_IdQi4Q"].zpelem-text { border-style:none; } </style><div class="zptext zptext-align-center " data-editor="true"><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">I. Giới thiệu về dịch vụ WEB</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">1. Dịch vụ Web là:</span>&nbsp;dịch vụ liên kết trang siêu văn bản. Dùng để truyền thông tin tới người dùng một cách đa dạng và phong phú như Video, văn bản, hình ảnh…</span></p><ul><li style="text-align:left;"><span style="font-size:12pt;">Dịch vụ Web dùng 2 giao thức để gửi dữ liệu tới người dùng đó là HTTP (không bảo mật) và HTTPS (có bảo mật).</span></li><li style="text-align:left;"><span style="font-size:12pt;">Để dịch vụ Web hoạt động được nó phải có 2 thành phần: Web Server và Web Client</span></li><li style="text-align:left;"><span style="font-size:12pt;">Web Server là nơi cung cấp dữ liệu Web. Người ta xây dựng lên một Website tĩnh hoặc động để người dùng truy cập vào. Web Server sẽ chạy ở Port 80 hoặc 443. Các phần mềm cài đặt trên Web Server như: Apache, PHP, Mariadb, PHPMyadmin, Code Web</span></li><li style="text-align:left;"><span style="font-size:12pt;">Web Client là phía người dùng. Người dùng mở IE hoặc Firefox truy cập vào tên miền của trang Web.</span></li></ul><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">2. Cơ chế hoạt động</span></span></p><ul><li style="text-align:left;"><span style="font-size:12pt;">Bước 1: Người dùng truy cập tên miền Website bằng Web Client là IE hoặc Firefox. Web Client sẽ sinh ra một Port cao và dữ liệu từ tầng Application sẽ chuyển xuống tầng Transport.</span></li><li style="text-align:left;"><span style="font-size:12pt;">Bước 2:. Đồng thời Web Client sẽ nhờ DNS Client phân giải hộ tên miền ra địa chỉ IP Web Server.</span></li><li style="text-align:left;"><span style="font-size:12pt;">Bước 3: Transport thấy dữ liệu là Web nó sẽ sử dụng giao thức TCP đóng Port nguồn là Port cao và Port đích là Port Web Server. Port Web Server là 80 (http) hoặc 443 (https). Sau đó sẽ truyền xuống tầng Internet.</span></li><li style="text-align:left;"><span style="font-size:12pt;">Bước 4: Dữ liệu sẽ được tầng Internet đóng IP máy mình và IP máy Web Server (IP Web Server được DNS Client nhờ DNS Server phân giải hộ).</span></li><li style="text-align:left;"><span style="font-size:12pt;">Bước 5: Sau khi dữ liệu đóng IP sẽ đưa xuống tầng Network Access. Tầng này sẽ dùng giao thức MAC kết hợp với các giao thức khác để truyền gói tin tới Swicht, tới Router và tới Máy chủ Web Server.</span></li><li style="text-align:left;"><span style="font-size:12pt;">Bước 6: Sau khi dữ liệu tới được Web Server nó sẽ được chuyển lên tầng Internet để kiểm tra IP, nếu đúng sẽ chuyển lên tầng Transport và chuyển lên tầng Application theo Port 80 hoặc 443.</span></li><li style="text-align:left;"><span style="font-size:12pt;">Bước 7: Webserver sẽ xử lý yêu cầu và Sau đó dữ liệu được đóng lại và gửi xuống đường truyền. Gói tin sẽ truyền lại tới máy Web Client</span></li><li style="text-align:left;"><span style="font-size:12pt;">Bước 8: Khi Client nhận được nó sẽ được Transport chuyển lên IE hoặc Firefox đúng vào Port cao khi khởi tạo (do có Port cao này nên ta có thể mở nhiều cửa sổ trên một trình duyệt với nhiều Website khác nhau mà không sợ bị trùng).</span></li></ul><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">II. Triển khai cài đặt</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">- Các bạn phải đặt địa chỉ IP tĩnh và kết nối CRT vào Server Linux. Lệnh kiểm tra ip: ip addr</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 1: Cài đặt Apache</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# yum install httpd * -y</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 2: Khởi động Apache</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# systemctl start httpd</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# systemctl enable httpd&nbsp; (khởi động cùng hệ thống)</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">Mở Port 80 cho giao thức http Firewall</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">firewall-cmd --permanent --zone=public --add-port=80/tcp</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">firewall-cmd --reload</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">firewall-cmd --list-all</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 3: Cài đặt PHP</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# yum install php * -y</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 4: khởi động lại Apache</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# systemctl restart httpd&nbsp;</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 5: Cài đặt MYSQL Server</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# yum install mariadb-server mariadb * -y</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 6: start mysql server lên</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]#systemctl start mariadb</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 7: đổi lại mật khẩu của tài khoản Root quản trị Mysql server</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# /usr/bin/mysqladmin -u root password 123456a@</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 8: Cấu hình để MySQl Server khởi động mỗi khi khởi động lại Server</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]#systemctl enable mariadb</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 9: Cài đặt các gói bổ sung cho PHP-MYSQL</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# yum install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc -y *&nbsp;<em>(php-imap gói này cài sau)</em></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 10: Sau khi cài xong, ta tiến hành khởi động lại Apache</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# systemctl restart httpd</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 11: Cài đặt PhpMyAdmin</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">+ Download gói cài đặt phpmyadmin về và dùng WinSCP để Transfer vào thư muc: /var/www/html/.</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Giải nén gói cài đặt phpMyAdmin-3.5.1-all-languages.tar.gz</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@ centos01~]# cd /var/www/html/</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@ centos01html]#tar -zxvf phpMyAdmin-3.5.1-all-languages.tar.gz</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Đổi tên thư mục sau khi giải nén</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@ centos01html]# mv phpMyAdmin-3.5.1-all-languages admin</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Di chuyển tới thư mục admin:</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@ centos01 html]#cd admin</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">Đổi tên tập tin config.sample.inc.php thành config.inc.php</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@ centos01phpmyadmin]# mv config.sample.inc.php config.inc.php</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Tùy chỉnh lại file cấu hình như sau:</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@ centos01 phpmyadmin]# vi config.inc.php</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">Tìm dòng $cfg['Servers'][$i]['auth_type'] = 'cookie'; sửa thành $cfg['Servers'][$i]['auth_type'] = 'http';</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">Khởi động lại dịch vụ: systemctl restart httpd</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">+ Hoặc tải giói PHPMyAdmin trực tiếp từ Internet về</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]# cd /var/www/html</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 html]#wget -c&nbsp;<a href="http://nchc.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.8/phpMyAdmin-3.4.8-english.tar.gz">http://nchc.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.8/phpMyAdmin-3.4.8-english.tar.gz</a></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 html]# tar&nbsp; xvfz&nbsp; phpMyAdmin-3.5.1-english.tar.gz</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 html]# mv phpMyAdmin-3.5.1-all-languages&nbsp; phpmyadmin</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 html]# cd phpmyadmin</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 phpmyadmin]# cp config.sample.inc.php&nbsp; config.inc.php</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 phpmyadmin]# vi config.inc.php</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">Sau đó sửa: $cfg['Servers'][$i]['auth_type'] = ‘http‘; # mặc định nó là cookies</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 phpmyadmin]# service httpd restart</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 12: vào httpd thêm tên file: index.php</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">[root@centos01 ~]#vi /etc/httpd/conf/httpd.conf</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">Gõ lệnh set nu và tìm đến dòng ở vị trí 164 và chèn thêm index.php</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 13: truy cập vào&nbsp;<a href="http://12.0.0.2/admin/">http://12.0.0.2/admin/</a>&nbsp;để tạo Database tên là anln</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 14: add Database</span></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 15: Dùng WinsCP để copy Website vào:</span>&nbsp;/var/www/html</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 16: Vào file Connec:</span>&nbsp;/var/www/html/Connect =&gt; sửa mật khẩu và tên cơ sở dữ liệu: $ketnoi = mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;123456a@&quot;) và mysql_select_db(&quot;anln&quot;, $ketnoi ) Chú ý trên Hosting phải sửa cả tên Root tương ứng với tài khoản.</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;"><span style="font-weight:700;">Bước 17: Sửa file functions:</span>&nbsp;/var/www/html/Website/Gio_hang</span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">require('/var/www/html/Connect/Connect.php');</span></p><p><span style="color:inherit;"></span></p><p style="text-align:left;margin-bottom:20px;"><span style="font-size:12pt;">Video tham khảo</span></p></div>
</div></div></div></div></div><div data-element-id="elm_Wje7sh1Yv1hteg8Wd33Qvw" data-element-type="section" class="zpsection zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_Wje7sh1Yv1hteg8Wd33Qvw"].zpsection{ border-style:none; } </style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_ivyati6lBkyBT4wXQAt4yQ" data-element-type="row" class="zprow zprow-container zpalign-items-flex-start zpjustify-content-flex-start zpdefault-section zpdefault-section-bg " data-equal-column=""><style type="text/css"> [data-element-id="elm_ivyati6lBkyBT4wXQAt4yQ"].zprow{ border-style:none; box-shadow:0px 0px 0px 0px #000000; } </style><div data-element-id="elm_fMDsN1qYITC9Lk2bcMToZw" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- zpdefault-section zpdefault-section-bg "><style type="text/css"> [data-element-id="elm_fMDsN1qYITC9Lk2bcMToZw"].zpelem-col{ border-style:none; box-shadow:0px 0px 0px 0px #000000; } </style><div data-element-id="elm_Z4u92rYeLSYz3mi2o5p0UA" data-element-type="iframe" class="zpelement zpelem-iframe "><style type="text/css"> [data-element-id="elm_Z4u92rYeLSYz3mi2o5p0UA"].zpelem-iframe{ border-style:none; border-radius:1px; box-shadow:0px 0px 0px 0px #000000; } </style><div class="zpiframe-container zpiframe-align-center"><iframe class="zpiframe " src="https://www.youtube.com/embed/oCYXmmzDS4Y" width="560" height="315" align="center" allowfullscreen frameBorder="0"></iframe></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Fri, 03 May 2019 02:34:58 +0700</pubDate></item></channel></rss>