Sau khi boot vào chế độ single mode và tiến hành đổi mật khẩu tài khoản root bằng lệnh passwd thì báo lỗi: " cannot identify you"
Để xử lý lỗi này ta tiến hành tắt dịch vụ SELINUX bằng cách mở tập tin /etc/sysconfig/selinux
Trong mục SELINUX chỉnh thành "disabled"
Khởi động lại máy chủ và vào lại chế độ single mode để tiến hành đổi mật khẩu bằng lệnh passwd
Thứ Sáu, 7 tháng 7, 2017
Thứ Tư, 14 tháng 6, 2017
Quản lý và giới hạn CPU trên từng process trên Ubuntu
Bước 1: Cài công cụ CPUTool
Code:
$ sudo apt install cputool
Code:
# cputool --cpu-limit 50 -p 8275
Bước 3: Để giới hạn CPU của một nhóm các tiến trình liên quan
Tìm các tiến trình liên quan đến ứng dụng
Code:
# pidof apache2 9592 3643 3642 3641 3640 3638 3637 1780
Code:
# cputool --cpu-limit 20 -P 1780
Code:
# cputool --load-limit 3.5 --rsync -av /home/tecmint /backup/`date +%Y-%m-%d`/
Các cách phòng chống WANNACRY ransomware
Cách 1. Cập nhật Windows
Đây là điều đầu tiên các bạn cần làm đối với máy tính hay VPS/Server của mình. Trong một số trường hợp, việc cập nhật tốn quá nhiều thời gian và có thể gây ra lỗi do mất kết nối. Các bạn có thể tải các bản cập nhật đặc biệt theo các đường dẫn dưới đây.
Windows 10 x64 1607
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/03/windows10.0-kb4013429-x64_delta_24521980a64972e99692997216f9d2cf73803b37.msu
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/03/windows10.0-kb4013429-x64_delta_24521980a64972e99692997216f9d2cf73803b37.msu
Windows 8 (security update)
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x86_a0f1c953a24dd042acc540c59b339f55fb18f594.msu
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x86_a0f1c953a24dd042acc540c59b339f55fb18f594.msu
Windows XP x64 Edition (Security Update for Windows XP SP2 for x64-based Systems)
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-enu_f24d8723f246145524b9030e4752c96430981211.exe
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-enu_f24d8723f246145524b9030e4752c96430981211.exe
Windows Server 2008 (Security Update for Windows Server 2008 for Itanium-based Systems)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-ia64_83a6f5a70588b27623b11c42f1c8124a25d489de.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-ia64_83a6f5a70588b27623b11c42f1c8124a25d489de.msu
Windows Vista (Windows Vista Security Update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
Windows Server 2008 (Windows Server 2008 Security Update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
Windows Server 2003, Windows Server 2003, Datacenter Edition (x64 system for Windows Server 2003 security update custom support)
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-cht_23a0e14eee3320955b6153ed7fab2dd069d39874.exe
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-cht_23a0e14eee3320955b6153ed7fab2dd069d39874.exe
Windows 8 (Windows 8 security update for x64 system)
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x64_f05841d2e94197c2dca4457f1b895e8f632b7f8e.msu
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x64_f05841d2e94197c2dca4457f1b895e8f632b7f8e.msu
Windows XP Embedde (XPe Windows XP SP3 Security Update Custom Support)
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-embedded-custom-cht_c3696d39aab12713c4bd4e30b8e17f0a03fd8089.exe
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-embedded-custom-cht_c3696d39aab12713c4bd4e30b8e17f0a03fd8089.exe
Windows XP (Windows XP SP3 Security Update Custom Support)
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-custom-cht_a84b778a7caa21af282f93ea0cdada0f7abb7d6a.exe
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-custom-cht_a84b778a7caa21af282f93ea0cdada0f7abb7d6a.exe
Windows Server 2003, Windows Server 2003, Datacenter Edition, Windows Server 2003 Security Update Custom Support)
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x86-custom-Cht_71a7359d308c8bda7638b4dc4ea305e7e22cc4c2.exe
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x86-custom-Cht_71a7359d308c8bda7638b4dc4ea305e7e22cc4c2.exe
Windows Vista (Windows Vista Security Update for x64 Systems)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
Windows Server 2008 (x64 system for Windows Server 2008 security update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
Windows XP Embedded (WES09 and POSReady 2009 Security Update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windowsxp-kb4012598-x86-embedded-cht_a827a40579d7de4c78efeca91d25ec0762e1c5be.exe
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windowsxp-kb4012598-x86-embedded-cht_a827a40579d7de4c78efeca91d25ec0762e1c5be.exe
Cách 2. Tắt SMB trong Windows
Để tắt SMB trong Windows các bạn có thể sử dụng 1 trong 2 cách sau đây
Để tắt SMB trong Windows các bạn có thể sử dụng 1 trong 2 cách sau đây
Sử dụng Power Shell với quyền Administrator
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB2 -Type DWORD -Value 0 -Force
Sử dụng CMD với quyền Administrator
sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi sc.exe config mrxsmb10 start= disabled sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi sc.exe config mrxsmb20 start= disabled
Sau khi thực hiện xong các bạn nên restart lại máy để cập nhật cấu hình.
Cách 3. Cài đặt Anti Ransomware của Bitdefender
Đây là bản miễn phí, các bạn có thể tải về tại https://www.bitdefender.com/solutions/anti-ransomware-tool.html
Đây là bản miễn phí, các bạn có thể tải về tại https://www.bitdefender.com/solutions/anti-ransomware-tool.html
Thứ Hai, 12 tháng 6, 2017
Nâng cấp Virtuozzo Automator
Bước 1: Nâng cấp Virtuozzo Automator Management Panel, ta ssh vào máy ảo container đang chạy Virtuozzo Automator và gõ lệnh sau:
Bước 2: Nâng cấp Virtuozzo Automator Agent, ta thực hiện trên từng máy chủ Hardware node
Code:
# yum groupupdate "VA Management Node" "VA Control Center"
Code:
# yum groupupdate "VA Agent"
Thứ Sáu, 19 tháng 5, 2017
Hướng dẫn cài đặt Zend Optimizer cho PHP 5.2.x trên Windows
Bước 1: Để cài Zend optimizer vào link này tải :http://www.zend.com/en/products/load...r?package=1453
Bước 2: Giải nén ra và chép file ZendOptimizer.dll vào thư mục ext tại vị trí C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\
Bước 3: Mở file php.ini của PHP 5.2.x và thêm vào cuối file dòng sau
[Zend]
zend_extension_ts="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\Zen dOptimizer.dll"
Bước 2: Giải nén ra và chép file ZendOptimizer.dll vào thư mục ext tại vị trí C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\
Bước 3: Mở file php.ini của PHP 5.2.x và thêm vào cuối file dòng sau
[Zend]
zend_extension_ts="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\Zen dOptimizer.dll"
Thứ Tư, 17 tháng 5, 2017
Hướng dẫn cấu hình switch Juniper EX2200
Vào chế độ cấu hình
sw> configure
sw#
Hiển thị thông tin tất cả các cổng switchsw# show | display set
Tạo một VLAN cho switchsw#set vlans Vinacis-Metro-1 vlan-id 1217
sw#commit
Gán cổng switch vào VLAN
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching port-mode access
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Xóa cổng khỏi VLAN
sw#delete interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Cấu hình trunk trên một interface
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching port-mode trunk
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-1
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-2
sw#commit
Bật SNMP trên switch
sw#set snmp contact "VinaCIS"
sw#set snmp name “Private”
sw#set snmp description “Office”
sw#set snmp location “Rack SE30” contact “email@vinacis.com”
sw#set snmp community public authorization read-only
sw#set snmp client-list list0 210.211.x.x/32
sw#set snmp community public client-list-name list0
sw#commit
sw#show snmp
sw> configure
sw#
Hiển thị thông tin tất cả các cổng switchsw# show | display set
Tạo một VLAN cho switchsw#set vlans Vinacis-Metro-1 vlan-id 1217
sw#commit
Gán cổng switch vào VLAN
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching port-mode access
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Xóa cổng khỏi VLAN
sw#delete interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Cấu hình trunk trên một interface
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching port-mode trunk
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-1
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-2
sw#commit
Bật SNMP trên switch
sw#set snmp contact "VinaCIS"
sw#set snmp name “Private”
sw#set snmp description “Office”
sw#set snmp location “Rack SE30” contact “email@vinacis.com”
sw#set snmp community public authorization read-only
sw#set snmp client-list list0 210.211.x.x/32
sw#set snmp community public client-list-name list0
sw#commit
sw#show snmp
Thứ Tư, 10 tháng 5, 2017
Cài đặt tính năng S3 Object storage cho Virtuozzo 6.0
Tính năng S3 Object Storage bao gồm các role sau:
- Object server: lưu trữ dữ liệu được nhận từ S3 gateway. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- Name server: lưu thông tin metada của bucket bao gồm object name, ACL, dung lượng, vị trí, người sở hữu. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- S3 gateway: đóng vai trò là proxy giữa người dùng cuối và các máy chủ object. Nó nhận và xử lý các yêu cầu bằng giao thức Amazon S3 và sử dụng nginx Web server cho các kết nối từ bên ngoài. S3 gateway quản lý việc chứng thực tài khoản user và kiểm tra phân quyền ACL checks. Bản thân nó không sinh ra dữ liệu
- Block level: là virtuozzo storage
Với bài lab này ta triển khai cài đặt 3 role Object Server, Name Server và S3 gateway trên 3 hardware node đang chạy thuộc cụm Virtuozzo 6.0 với thông tin 3 node như sau
Server name: rs00360 - Storage IP: 172.16.10.24 - WAN IP: 103.199.9.24
Server name: rs00361 - Storage IP: 172.16.10.25 - WAN IP: 103.199.9.25
Server name: rs00362 - Storage IP: 172.16.10.26 - WAN IP: 103.199.9.26
Cài đặt Object Server
Bước 1 (thực hiện trên cả 3 node): add thông tin vào file /etc/hosts để phân giải hostname ra IP storage
172.16.10.24 rs00360 rs00360.dinodata.vn
172.16.10.25 rs00361 rs00361.dinodata.vn
172.16.10.26 rs00362 rs00362.dinodata.vn
Bước 2 (thực hiện trên cả 3 node): cài đặt gói pstorage-ostor
Bước 3 (thực hiện trên 1 node sẽ chạy role object server) : Tạo configure service mới và chỉ định số lượng máy chủ sẽ làm object server và name server
<hostname> là tên node đang tiến hành tạo configure service
<cluster_name> là tên cluster của virtuozzo 6.0
<ostor_dir> là thư mục chứa các tập tin của dịch vụ object storage
4 là số lượng node sẽ cài name server
5 là số lượng node sẽ cài storage object
Bước này hệ thống sẽ yêu cầu đặt mật khẩu
Trong bài này ta gõ lệnh sau:
Bước 4: khởi động configure service
Bước 5 (thực hiện trên 1 node sẽ chạy role object server): Khởi tạo kho lưu trữ object storage
Thư mục <ostor_dir> đã qui định ở bước 3 sẽ được tạo tại bước này. Đồng thời bạn cần nhập mật khẩu đã đặt ở bước 3
Trong bài này ta gõ lệnh sau:
Bước 6 (thực hiện trên các node sẽ chạy role object server): thêm các host vào cụm
Trong bài này ta gõ lệnh sau:
Bước 7 (thực hiện trên tất cả các node sẽ làm S3 gateway):
Trong bài này ta gõ ba lệnh sau trên 3 node
Bước 8 (thực hiện trên tất cả các node sẽ làm S3 gateway): Khởi động agent
Bước 9: Kiểm tra trạng thái của hệ thống
Bước 10 (thực hiện trên tất cả các node sẽ làm S3 gateway): Cài đặt và cấu hình Nginx
Cài đặt Nginx
Cấu hình Nginx: Mở file /etc/nginx/conf.d/default.conf và nhập nội dung như bên dưới
Bước 11: Tạo DNS record s3.vinacis.com trỏ về 3 IP Public của 3 node đang chạy S3 gateway
Bước 12: Khởi động dịch vụ Nginx
Bước 13 (thực hiện một trong những node chạy S3) : Tạo tài khoản người dùng S3
Ghi lại thông tin Access Key và Secret Access Key dùng để kết nối tạo Bucket
Bước 14: Khởi tạo Bucket mới
Hệ thống Virtuozo 6.0 không có công cụ để khởi tạo Bucket nên ta cần dùng công cụ của hãng thứ 3. Tải về và cài đặt công cụ CloudBerry Explorer for Amazon S3 tại địa chỉ: http://www.cloudberrylab.com/downloa...prod=cbes3free
Mở phần mềm CloudBerry Explorer for Amazon S3 --> File --> Add New Account --> S3 Compatible --> Điền các thông tin như sau
Display name: đặt tên cho kết nối. VD: vinacis
Service point: điền thông tin kết nối đến S3 Gateway. Trong trường hợp này là s3.vinacis.com:80Access key: điền access key lấy được ở bước 13
Secret key: điền Secret access key lấy được ở bước 13
Lưu ý bỏ dấu check ở hai tùy chọn "Use SSL" và "Use native multipath.."
Sau khi kết nối thì tạo Bucket mới
- Object server: lưu trữ dữ liệu được nhận từ S3 gateway. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- Name server: lưu thông tin metada của bucket bao gồm object name, ACL, dung lượng, vị trí, người sở hữu. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- S3 gateway: đóng vai trò là proxy giữa người dùng cuối và các máy chủ object. Nó nhận và xử lý các yêu cầu bằng giao thức Amazon S3 và sử dụng nginx Web server cho các kết nối từ bên ngoài. S3 gateway quản lý việc chứng thực tài khoản user và kiểm tra phân quyền ACL checks. Bản thân nó không sinh ra dữ liệu
- Block level: là virtuozzo storage
Với bài lab này ta triển khai cài đặt 3 role Object Server, Name Server và S3 gateway trên 3 hardware node đang chạy thuộc cụm Virtuozzo 6.0 với thông tin 3 node như sau
Server name: rs00360 - Storage IP: 172.16.10.24 - WAN IP: 103.199.9.24
Server name: rs00361 - Storage IP: 172.16.10.25 - WAN IP: 103.199.9.25
Server name: rs00362 - Storage IP: 172.16.10.26 - WAN IP: 103.199.9.26
Cài đặt Object Server
Bước 1 (thực hiện trên cả 3 node): add thông tin vào file /etc/hosts để phân giải hostname ra IP storage
172.16.10.24 rs00360 rs00360.dinodata.vn
172.16.10.25 rs00361 rs00361.dinodata.vn
172.16.10.26 rs00362 rs00362.dinodata.vn
Bước 2 (thực hiện trên cả 3 node): cài đặt gói pstorage-ostor
Code:
# yum install pstorage-ostor
Code:
ostor-ctl create -n <hostname> -r /var/lib/ostor/configuration -c "pstorage://<cluster_name>/<ostor_dir> 4 5"
<cluster_name> là tên cluster của virtuozzo 6.0
<ostor_dir> là thư mục chứa các tập tin của dịch vụ object storage
4 là số lượng node sẽ cài name server
5 là số lượng node sẽ cài storage object
Bước này hệ thống sẽ yêu cầu đặt mật khẩu
Trong bài này ta gõ lệnh sau:
Code:
ostor-ctl create -n rs00360 -r /var/lib/ostor/configuration -c "pstorage://minicloudt9/s3-t9 3 3"
Code:
# service ostor-cfgd start # chkconfig ostor-cfgd on
Code:
ostor-ctl init-storage -n <hostname> -s <cluster_mount_point>
Trong bài này ta gõ lệnh sau:
Code:
ostor-ctl init-storage -n rs00361 -s /pstorage/minicloudt9
Bước 6 (thực hiện trên các node sẽ chạy role object server): thêm các host vào cụm
Code:
# ostor-ctl add-host -r <cluster_mount_point>/<ostor_dir>
Code:
ostor-ctl add-host -r /pstorage/minicloudt9/s3-t9
Code:
# ostor-ctl add-s3gw -a <storage_IP>:9000
Code:
ostor-ctl add-s3gw -a 172.16.10.24:9000 ostor-ctl add-s3gw -a 172.16.10.25:9000 ostor-ctl add-s3gw -a 172.16.10.26:9000
Code:
# service ostor-agentd start # chkconfig ostor-agentd on
Code:
# ostor-ctl agent-status
Cài đặt Nginx
Code:
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm # yum install nginx -y
Cấu hình Nginx: Mở file /etc/nginx/conf.d/default.conf và nhập nội dung như bên dưới
Code:
upstream s3 { server 172.16.10.24:9000; #S3 gateway 1 internal IP address server 172.16.10.25:9000; #S3 gateway 2 internal IP address server 172.16.10.26:9000; #S3 gateway 3 internal IP address # Optional load balancing parameters (see http://nginx.org/en/docs/http/load_balancing.html) } server { listen 80; server_name s3.vinacis.com; #S3 endpoint. If you have DNS configured, replace the IP address with the corresponding hostname. client_max_body_size 5g; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; location / { fastcgi_pass_header Connection-close; fastcgi_pass s3; fastcgi_no_cache 1; include fastcgi_params; fastcgi_request_buffering off; fastcgi_max_temp_file_size 0; } }
Bước 12: Khởi động dịch vụ Nginx
Code:
# service nginx start # chkconfig nginx on
Code:
# ostor-s3-admin create-user -e user@email.com
Bước 14: Khởi tạo Bucket mới
Hệ thống Virtuozo 6.0 không có công cụ để khởi tạo Bucket nên ta cần dùng công cụ của hãng thứ 3. Tải về và cài đặt công cụ CloudBerry Explorer for Amazon S3 tại địa chỉ: http://www.cloudberrylab.com/downloa...prod=cbes3free
Mở phần mềm CloudBerry Explorer for Amazon S3 --> File --> Add New Account --> S3 Compatible --> Điền các thông tin như sau
Display name: đặt tên cho kết nối. VD: vinacis
Service point: điền thông tin kết nối đến S3 Gateway. Trong trường hợp này là s3.vinacis.com:80Access key: điền access key lấy được ở bước 13
Secret key: điền Secret access key lấy được ở bước 13
Lưu ý bỏ dấu check ở hai tùy chọn "Use SSL" và "Use native multipath.."
Sau khi kết nối thì tạo Bucket mới
__________________
Thứ Ba, 9 tháng 5, 2017
Cấu hình NFS server và client trên Virtuozzo Container
Hệ thống gồm 2 máy chủ
Container đóng vai trò NFS Server có IP là: 192.168.100.1 (container ID: 101) - OS: Centos 6.8 64bit
Container đóng vai trò NFS Client có IP là: 192.168.100.2 (container ID: 102) - OS: Centos 6.8 64bit
Thư mục cần chia sẻ NFS nằm trên NFS Server tên là: /data
Cài đặt NFS Server
Bước 1: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để load module nfsd
Bước 2: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để kích hoạt tính năng nfsd cho container 101
Bước 3: Trong container, gõ lệnh sau để cài đặt các gói NFS Server
Bước 4: Trong container gõ lệnh
Bước 5: Trong container, tắt các cảnh báo liên quan đến nfsd bằng cách mởi tập tin /etc/sysconfig/nfs, sau đó thêm các dòng bên dưới vào vị trị cuối file
Bước 6: Khởi động dịch vụ NFS
Bước 7: Trong container, khởi tạo thư mục /data và share thư mục này cho máy client với quyền read write
Cài đặt NFS Client
Bước 1: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để load module nfsd
Bước 2: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để kích hoạt tính năng nfsd cho container 102
Bạn có thể dùng lệnh sau để kiểm tra module nfs đã được load bên trong container hay chưa
Bước 3: Trong container, cài đặt các gói NFS client như sau
Bước 4: Khởi động các dịch vụ nfs
Bước 5: Tiến hành mount đến thư mục /data đang được share trên NFS Server
Tạo thư mục /data trên máy NFS client
Tiến hành mount thư mục /data của NFS Server vào thư mục /data của NFS client
Bước 6: Tạo fstab
Container đóng vai trò NFS Server có IP là: 192.168.100.1 (container ID: 101) - OS: Centos 6.8 64bit
Container đóng vai trò NFS Client có IP là: 192.168.100.2 (container ID: 102) - OS: Centos 6.8 64bit
Thư mục cần chia sẻ NFS nằm trên NFS Server tên là: /data
Cài đặt NFS Server
Bước 1: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để load module nfsd
Code:
# modprobe nfsd
Code:
# vzctl stop 101 # vzctl set 101 --features nfsd:on --save # vzctl start 101
Code:
# yum install rpcbind nfs-utils
Code:
# chkconfig rpcbind on # service rpcbind start
Code:
MOUNTD_NFS_V3="yes" RPCNFSDARGS="-N 4" NFSD_MODULE="noload"
Code:
# chkconfig nfs on # service nfs start
Code:
# mkdir /data # vi /etc/exports /home 192.168.100.2(rw,sync,no_root_squash,no_subtree_check) # export -a
Bước 1: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để load module nfsd
Code:
# modprobe nfs
Code:
# vzctl stop 102 # vzctl set 102 --features nfs:on --save # vzctl start 102
Code:
# cat /proc/filesystems
Code:
# yum install nfs-utils nfs-utils-lib rpcbind
Code:
# chkconfig rpcbind on # /etc/init.d/rpcbind start # chkconfig nfs on # /etc/init.d/nfs start
Tạo thư mục /data trên máy NFS client
Code:
# mkdir /data
Code:
mount 192.168.100.1:/data /data
Code:
192.168.100.1:/data /data nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
Giám sát băng thông bằng công cụ iftop
Bước 1: Cài đặt các gói dịch vụ liên quan
Bước 2: Tải về gói iftop
Bước 3: Tiến hành cài đặt iftop
Bước 4: Để giám sát mạng với iftop ta sử dụng lệnh sau
Xem trạng thái của tất cả các cạc mạng
Xem trạng thái của một cổng mạng cụ thể
Code:
# yum -y install libpcap libpcap-devel ncurses ncurses-devel
Code:
# wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
Code:
# tar -zxvf iftop-0.17.tar.gz # cd iftop-0.17 # ./configure # make # make install
Bước 4: Để giám sát mạng với iftop ta sử dụng lệnh sau
Xem trạng thái của tất cả các cạc mạng
Code:
# iftop
Code:
# iftop -i eth0
Thứ Sáu, 5 tháng 5, 2017
Cài đặt owncloud 9.1 trên Ubuntu 16.04
Bước 1: Cài đặt các gói dịch vụ Apache, MariaDB, PHP
Bước 2: Khởi động dịch vụ MariaDB và đặt mật khẩu root
Bước 3: Mặc định khi cài đặt MariaDB thì tài khoản quản trị root không thể đăng nhập vào MariaDB bằng mật khẩu mà nó chứng thực bằng plugin. Do đó ta cần disable chế độ chứng thực bằng plugin bằng cách gõ các lệnh sau
Hiển thị cột plugin trong cơ sở dữ liệu user
Chỉnh sửa lại giá trị plugin thành trống thay vì unix_socket
Đặt lại mật khẩu cho tài khoản quản tri root
Bước 4: Truy cập vào link: http://download.owncloud.org/downloa.../9.1/owncloud/ để tải gói repo và cài đặt owncloud
Bước 5: Tiến hành cài đặt các thông số về tài khoản quản trị, vị trí lưu dữ liệu và loại cơ sở dữ liệu sẽ sử dụng cho owncloud bằng cách truy cập đến địa chỉ http://<IP_cua_server>/owncloud/
Phần "Tạo tài khoản quản trị" --> tạo tên đăng nhập và mật khẩu cho tài khoản sẽ giữ quyền quản trị owncloud
Phần "Thư mục dữ liệu" --> điền vào nơi sẽ lưu trữ dữ liệu của người dùng (có thể để mặc định là /var/www/owncloud/data)
Phần "Cấu hình cơ sở dữ liệu" --> Chọn "MySQL/MariaDB" --> nhập thông tin tài khoản quản trị root của MariaDB đã tạo ở bước 2 phía trên --> nhập tên cơ sở dữ liệu dành cho owncloud (đặt tên tùy ý)
Tham khảo thêm tại: https://doc.owncloud.org/server/late...tallation.html
Bước 6: Để có thể truy cập vào owncloud từ một tên miền ví dụ owncloud.offices.vn thì ta cần chỉnh trong /var/www/owncloud/config/config.php bằng cách thêm tên miền như bên dưới
Code:
# sudo apt-get update # sudo apt-get install apache2 mariadb-server libapache2-mod-php7.0 # sudo apt-get install php7.0-gd php7.0-mysql php7.0-curl # sudo apt-get install php7.0-intl php7.0-mcrypt php-imagick # sudo apt-get install php7.0-zip php7.0-xml php7.0-mbstring
Code:
# sudo mysql_secure_installation Enter current password for root (enter for none): --> gõ Enter Set root password? [Y/n] Y New password: --> đặt mật khẩu cho tài khoản root của database Chọn Yes với tất cả các câu hỏi còn lại
Code:
# sudo mysql -u root MariaDB [(none)]> use mysql;
Code:
MariaDB [mysql]> SELECT user, plugin FROM user;
Code:
MariaDB [mysql]> UPDATE user SET plugin="";
Code:
MariaDB [mysql]> UPDATE user SET password=PASSWORD("password_taikkhoanroot") WHERE user="root"; MariaDB [mysql]> FLUSH PRIVILEGES; MariaDB [mysql]> quit
Code:
# sudo wget -nv https://download.owncloud.org/download/repositories/9.1/Ubuntu_16.04/Release.key -O Release.key # sudo apt-key add - < Release.key # sudo sh -c "echo 'deb http://download.owncloud.org/download/repositories/9.1/Ubuntu_16.04/ /' > /etc/apt/sources.list.d/owncloud.list" # sudo apt-get update # sudo apt-get install owncloud
Phần "Tạo tài khoản quản trị" --> tạo tên đăng nhập và mật khẩu cho tài khoản sẽ giữ quyền quản trị owncloud
Phần "Thư mục dữ liệu" --> điền vào nơi sẽ lưu trữ dữ liệu của người dùng (có thể để mặc định là /var/www/owncloud/data)
Phần "Cấu hình cơ sở dữ liệu" --> Chọn "MySQL/MariaDB" --> nhập thông tin tài khoản quản trị root của MariaDB đã tạo ở bước 2 phía trên --> nhập tên cơ sở dữ liệu dành cho owncloud (đặt tên tùy ý)
Tham khảo thêm tại: https://doc.owncloud.org/server/late...tallation.html
Bước 6: Để có thể truy cập vào owncloud từ một tên miền ví dụ owncloud.offices.vn thì ta cần chỉnh trong /var/www/owncloud/config/config.php bằng cách thêm tên miền như bên dưới
Code:
'trusted_domains' => array ( 0 => '113.199.8.32', 1 => 'owncloud.offices.vn', ),
Đăng ký:
Bài đăng (Atom)