Trên máy bạn cần cài trước VMWARE WORKSTATION 10, và đã cài CentOS 7.x 64bits, nếu chưa có vui lòng xem hướng dẫn cài ở video trước đó, cần thêm công cụ Putty để remote vào máy ảo.
===================================================
Hướng dẫn cài đặt:
NGINX, APACHE, PHP7, MariaDB (MySQL), SAMBA làm môi trường lập trình web
Đã có VMWARE WORKSTATION 10, và đã cài CentOS 7.x 64bits
Nếu chưa có vui lòng xem hướng dẫn cài ở video trước:
hoặc
Putty.exe để remote vào máy ảo
===================================================
CÀI ĐẶT NGINX
+ yum install epel-release
+ yum install nginx
+ systemctl enable nginx
+ vi /etc/selinux/config
edit SELINUX=enforcing — SELINUX=disabled
+ systemctl stop firewalld.service
+ systemctl disable firewalld.service
vi /etc/nginx/nginx.conf tìm và thay thế
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
index index.php index.html index.htm;
# proxy settings
proxy_redirect off;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/ /index.php;
}
location ~ .php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
===================================================
Cài đặt Apache/2.4.6
+ yum install httpd
+ vi /etc/httpd/conf/httpd.conf
tìm Listen 80 == Listen 8888
+ reboot lại server — phải reboot nhé các bạn
reboot
+ systemctl start httpd.service
+ systemctl enable httpd.service
+ systemctl stop firewalld.service
+ systemctl disable firewalld.service
+ Tao 1 file index.htm trong thư mục /var/www/html chứa noi dung hello
+ === check coi chạy được apache chưa
===================================================
Cài đặt 5.5.52-MariaDB MariaDB Server — tiền thân là MySQL tập lệnh như nhau
+ yum install mariadb-server mariadb
+ systemctl start mariadb
+ mysql_secure_installation == đặt mật khẩu cho MariaDB
+ systemctl enable mariadb.service
===================================================
Cài đặt PHP Version 7.1.7
+ yum -y install
vi /etc/yum.repos.d/remi-php71.repo edit enabled=1
+ yum -y install php php-mbstring php-gettext php-mysqli php-pecl-zip
+ systemctl restart httpd.service
===================================================
Cài tool wget:
– yum install wget
– Download PHPMyAdmin tool quan lý MySQL database
cd /var/www/html
wget
Giải nén và đổi tên:
tar -xzvf phpMyAdmin-4.7.3-english.tar.gz
mv phpMyAdmin-4.7.3-english phpmyadmin
chown -Rf apache:apache phpmyadmin
cd phpmyadmin
cp config.sample.inc.php config.inc.php
vi config.inc.php tìm AllowNoPassword = false; chuyển thành true
Ra trình duyet chay lai: là ok
===================================================
– Samba để làm viec voi centos 7 folder
+ yum install samba samba-client samba-common
+ mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
+ vi /etc/samba/smb.conf
#======= Global Settings ========
[global]
workgroup = WORKGROUP
security = user
map to guest = bad user
#====== Share Definitions ======
[html]
path = /var/www/html
browsable =yes
writable = yes
guest ok = yes
read only = no
vào thư mục làm việc:
cd /var/www/
chmod -R 0755 html/
chown -R nobody:nobody html/
Start dịch vụ SAMBA:
systemctl restart smb.service
systemctl restart nmb.service
ENABLE SAMBA:
systemctl enable nmb.service
systemctl enable smb.service
===================================================
Ra window chay run \your_server_IP_address để kiểm tra share folder từ CentOS qua Window
Nguồn:https://ftlinuxcourse.com/
Xem thêm Bài Viết:
- Trải nghiệm mới hay ho với hướng dẫn cài Mac Os trên vmware
- Bật mí cách cài đặt ssl miễn phí lên Let’s Encrypt
- Tuyệt chiêu tạo usb boot kali linux đơn giản dành cho bạn
- Hướng dẫn chi tiết từ A – Z các bước cài đặt Python trên Windows 10
- Bật mí quy trình cài đặt Kali Linux trên Vmware đúng chuẩn và chi tiết
Cảm ơn video của bạn, nhìn thú vị quá tối về test thử xem sao.!!!
Xin admin cho em bổ sung cái này ạ.Các bạn nên tìm hiểu khái niệm "Nginx as a Reverse Proxy for apache" trước để khỏi bị mơ hồ với các file config của Nginx và apache. Mặc định port của apache va Nginx port là 80; nếu muốn Nginx port 80 làm proxy cho apache thì port của apache là port mà browser không trực tiếp đọc được, ví dụ: 8080 or 8888. sau khi config port, sử dụng command "netstat -nplt" để check program nào đang chạy ở port nào để kiểm tra process cài đặt có đúng ko. có gì sai sót mong admin và mọi người góp ý giúp em ạ. Thanks all