Codeigniterbrasil - Chuyên trang tin tức công nghệ hàng đầu
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại
No Result
View All Result
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại
No Result
View All Result
Codeigniterbrasil - Chuyên trang tin tức công nghệ hàng đầu
No Result
View All Result

Cài đặt NGINX, APACHE, PHP7, MariaDB (MySQL), SAMBA làm môi trường lập trình web

admin by admin
April 27, 2020
in Lập Trình PHP
2
Cài đặt NGINX, APACHE, PHP7, MariaDB (MySQL), SAMBA làm môi trường lập trình web



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://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-php/

Xem thêm Bài Viết:

  • MDM là gì??? – Làm thế nào để tắt được MDM trên Macbook | Mẹo Vặt Macbook
  • Người lao động nghỉ bị trừ lương || Tư vấn luật lao động
  • Learn Emmet In 15 Minutes – Double Your HTML Coding Speed
  • Giang Hồ Thanh Toán Nhau Trên Phố – Tập 4 – Giang Hồ Bắn Giết Nhau Trên Đường | Big Bang
  • Lập trình Android A-Z – Bài 159: Fragment Create and add XML
Previous Post

PANDA STREAM THỨ 6 NGÀY 13 CÙNG MỀU VÀ REDHOOD TẬP 1

Next Post

Best controller for ios,android and pc (New game NGDS N1 Pro)

Next Post
Best controller for ios,android and pc (New game NGDS N1 Pro)

Best controller for ios,android and pc (New game NGDS N1 Pro)

Comments 2

  1. Giải Trí Kênh says:
    2 years ago

    Cảm ơn video của bạn, nhìn thú vị quá tối về test thử xem sao.!!!

    Reply
  2. & Roses Guns says:
    2 years ago

    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

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tin Hot

Đập hộp Z590 Vision G

Trên tay Gigabyte Z590 Vision G – Sẵn sàng cho người sáng tạo nội dung

May 15, 2021
Cách khắc phục lỗi mất biểu tượng loa trong Windows 10

Cách khắc phục lỗi mất biểu tượng loa trong Windows 10

October 21, 2020
Mẹo và Thủ thuật Máy tính Mọi người Nên Biết

Mẹo và Thủ thuật Máy tính Mọi người Nên Biết

September 25, 2020
Cách nhập ảnh từ iPhone sang Mac

Cách nhập ảnh từ iPhone sang Mac

September 10, 2020
Test loa karaoke bluetooth Soundmax A-2120, có điều khiển từ xa | META.vn

Test loa karaoke bluetooth Soundmax A-2120, có điều khiển từ xa | META.vn

May 28, 2020
Review Bose Companion 50| Bộ loa vi tính cực "Xịn xò" đến từ Bose

Review Bose Companion 50| Bộ loa vi tính cực "Xịn xò" đến từ Bose

May 28, 2020
  • Liên Hệ
  • Chính Sách Bảo Mật

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.