C:xampp\apache\conf\extra\httpd-vhosts.conf
http
, port 80
[email protected]
thành email quản trị của bạnD:/dnpcuong/src/sunshine/public
thành đường dẫn gốc (root path) đến thư mục source code của bạnsunshine.local
thành tên miền bạn mong muốn, ví dụ: tenmiencuaban.local
<VirtualHost *:80> #Thay thế bằng email của Quản trị web của bạn ServerAdmin [email protected] #Thay thế bằng đường dẫn đến source của bạn DocumentRoot "D:/dnpcuong/src/sunshine/public" #Thay thế bằng tên trang web bạn mong muốn ServerName sunshine.local #Thay thế bằng tên file log bạn mong muốn ErrorLog "logs/sunshine.local-error.log" CustomLog "logs/sunshine.local-access.log" common #Thay thế bằng đường dẫn đến source của bạn <Directory "D:/dnpcuong/src/sunshine/public"> Options FollowSymLinks AllowOverride All DirectoryIndex index.php Require all granted </Directory> </VirtualHost>
https
, port 443
[email protected]
thành email quản trị của bạnD:/dnpcuong/src/sunshine/public
thành đường dẫn gốc (root path) đến thư mục source code của bạnsunshine.local
thành tên trang miền bạn mong muốn, ví dụ: tenmiencuaban.local
<VirtualHost *:443> #Thay thế bằng email của Quản trị web của bạn ServerAdmin [email protected] #Thay thế bằng đường dẫn đến source của bạn DocumentRoot "D:/dnpcuong/src/sunshine/public" #Thay thế bằng tên trang web bạn mong muốn ServerName sunshine.local #Thay thế bằng tên file log bạn mong muốn CustomLog "D:/dnpcuong/src/sunshine/logs/xampp.access.log" combined ErrorLog "D:/dnpcuong/src/sunshine/logs/xampp.error.log" #Bật chế độ bảo mật SLL và cung cấp chứng chỉ SSL SSLEngine on SSLCACertificateFile "C:/xampp/apache/conf/ssl.sunshine.local/ssl/ca_bundle.crt" SSLCertificateFile "C:/xampp/apache/conf/ssl.sunshine.local/ssl.crt/server.crt" SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.sunshine.local/ssl.key/server.key" #Thay thế bằng đường dẫn đến source của bạn <Directory "D:/dnpcuong/src/sunshine/public"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost>
C:\Windows\System32\drivers\etc\hosts
sunshine.local
bằng tên miền bạn đã cấu hình trong Step 1#Bổ sung địa chỉ IP ánh xạ với tên miền bạn mong muốn (Tương ứng với tên miền bạn đặt trong host ảo) 127.0.0.1 sunshine.local
http
, port 80
, truy cập địa chỉ: http://sunshine.localhttps
, port 443
, truy cập địa chỉ: https://sunshine.localThực hiện các bước tuần tự theo nội dung Bài học nhé!
Cùng nhau học tập, khám phá các kiến thức nền tảng về Lập trình web, mobile, database nhé.
Nền tảng kiến thức - Hành trang tới tương lai hân hạnh phục vụ Quý khách!
Khám phá, trải nghiệm ngay
Vui lòng đăng nhập để gởi bình luận!
Đăng nhậpChưa có bình luận nào!