Open ghost opened 6 years ago
Thêm một box. List box tại Vagrant Cloud
Xem list box đã cài
Xóa box đã add
Tạo box mới
Cài đặt 1 plugin
Xem danh sách các plugin đã cài
Xóa plugin đã cài
Khởi động máy ảo
Kết nối với máy ảo từ máy thật
Chạy lại máy ảo khi chỉnh sửa Vagrantfile
Dừng chạy máy ảo
Chạy các cấu hình của proviser trong Vagrant
Phiên bản của box hiện tại. Xem danh sách box tại Vagrant box list
Cấu hình địa chỉ IP cho box trong mạng private. Ta có thể truy cập box trong mạng cục bộ.
Cấu hình IP cho box trong mạng public. Có thể truy cập box trên mạng toàn cầu. Mặc định box sẽ không có cấu hình IP trong public_network.
Cấu hình các thư mục chia sẽ giữa máy chủ và máy khách
Cấu hình giao diện khởi động vào máy ảo và cài đặt bộ nhớ tối đa cho máy ảo.
Cài đặt apache
Mở apache. Vào địa chỉ 192.168.33.20 để thấy trang mặc đinh của Apache
Dừng Apache. Vào lại 192.168.33.20 trang mặc định của Apache không xuất hiện
Kiểm tra phiên bản hiện tại của Apache
Add repo chứa PHP Cài đặt package php7.2 và các module kèm theo
Vào /var/www/html tạo file index.php và thêm hàm phpinfo() Vào http://192.168.33.20/index.php để kiểm tra các thông tin về các config trong PHP
Vào /var/www/html tạo file hello.php Vào http://192.168.33.20/hello.php để kiểm tra kết quả
Cài đặt Mysql
Nhập mật khẩu cho tài khoản root
Kiểm tra phiên bản hiện tại của MySql
Kết nối mysql thông qua terminal bằng tài khoản root
Cài đặt MySql Workbench
Hướng dẫn tại How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
Tạo 2 thư mục site1.com và site2.com
Cấp quyền cho 2 thư mục site1.com và site2.com
Tạo 2 file demo cho site1.com và site2.com
Site1.com/index.html
Site2.com/index.html
Tạo file Virtual Host mới từ file Host của Apache
Kích hoạt file Virutal Host, Reload lại Apache2 để hoàn thành
Thiết lập file Hosts ở Local .
2 domain site1.com và site2.com cùng trỏ tới địa chỉ IP 192.168.33.20 từ máy host
Kiểm tra trên trình duyệt
LGTM 👍
Vagrant
Vagrant box
Add box
Thêm một box. List box tại Vagrant Cloud
List box
Xem list box đã cài
Remove box
Xóa box đã add
Export box
Tạo box mới
Vagrant plugins
Install plugin
Cài đặt 1 plugin
List plugins
Xem danh sách các plugin đã cài
Uninstall plugin
Xóa plugin đã cài
Vagrant up
Khởi động máy ảo
Vagrant SSH
Kết nối với máy ảo từ máy thật
Vagrant reload
Chạy lại máy ảo khi chỉnh sửa Vagrantfile
Vagrant halt
Dừng chạy máy ảo
Vagrant provision
Chạy các cấu hình của proviser trong Vagrant
Vagrantfile
config.vm.box
Phiên bản của box hiện tại. Xem danh sách box tại Vagrant box list
config.vm.network "private_network"
Cấu hình địa chỉ IP cho box trong mạng private. Ta có thể truy cập box trong mạng cục bộ.
config.vm.network "public_network"
Cấu hình IP cho box trong mạng public. Có thể truy cập box trên mạng toàn cầu. Mặc định box sẽ không có cấu hình IP trong public_network.
config.vm.synced_folder
Cấu hình các thư mục chia sẽ giữa máy chủ và máy khách
config.vm.provider
Cấu hình giao diện khởi động vào máy ảo và cài đặt bộ nhớ tối đa cho máy ảo.
Webserver
Apache
Install Apache
Cài đặt apache
Start Apache
Mở apache. Vào địa chỉ 192.168.33.20 để thấy trang mặc đinh của Apache
Stop Apache
Dừng Apache. Vào lại 192.168.33.20 trang mặc định của Apache không xuất hiện
Check Version
Kiểm tra phiên bản hiện tại của Apache
PHP
Install PHP
Add repo chứa PHP Cài đặt package php7.2 và các module kèm theo
Show phpinfor
Vào /var/www/html tạo file index.php và thêm hàm phpinfo() Vào http://192.168.33.20/index.php để kiểm tra các thông tin về các config trong PHP
Show php hello world
Vào /var/www/html tạo file hello.php Vào http://192.168.33.20/hello.php để kiểm tra kết quả
Mysql
Install Mysql
Cài đặt Mysql
Nhập mật khẩu cho tài khoản root
Check version
Kiểm tra phiên bản hiện tại của MySql
Connect Mysql via terminal
Kết nối mysql thông qua terminal bằng tài khoản root
Connect Mysql via Mysql Workbench
Cài đặt MySql Workbench
Config Vhost
Hướng dẫn tại How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
Create the Directory Structure
Tạo 2 thư mục site1.com và site2.com
Grant Permissions
Cấp quyền cho 2 thư mục site1.com và site2.com
Create Demo Pages for Each Virtual Host
Tạo 2 file demo cho site1.com và site2.com
Site1.com/index.html
Site2.com/index.html
Create New Virtual Host Files
Tạo file Virtual Host mới từ file Host của Apache
Enable the New Virtual Host Files
Kích hoạt file Virutal Host, Reload lại Apache2 để hoàn thành
Set Up Local Hosts File (Optional)
Thiết lập file Hosts ở Local .
2 domain site1.com và site2.com cùng trỏ tới địa chỉ IP 192.168.33.20 từ máy host
Testing
Kiểm tra trên trình duyệt