Skip to content

pesatcha/LAMP-Stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 

Repository files navigation

LAMP_Stack

เข้าไปที่ command linux เมื่อมีสิทธิ์ root แล้ว

ติดตั้ง Apache

ใช้คำสั่ง yum install httpd
เมื่อติดตั้งเสร็จ ใช้คำสั่ง systemctl start httpd เป็นคำสั่งrestart webserver systemctl enable httpd เป็นคำสั่งเปิดใช้งาน
systemctl status httpd คำสั่งในการเช็คว่าทำงานรึยัง
จากนั้น นำ ip เช็คที่หน้า webbrowser ด้วยการ ใส่ ip address

ติดตั้ง Mysql

ใช้คำสั่ง yum install mariadb-server
เมื่อติดตั้งเสร็จ ใช้คำสั่ง systemctl start mariadb เป็นคำสั่งเริ่มต้นใช้งาน
systemctl enable mariadb เป็นคำสั่งเปิดใช้งาน
systemctl status mariadb คำสั่งในการเช็คว่าทำงานรึยัง
mysql -u root -p คำสั่ง login เข้าไปในฐานข้อมูล "ครั้งแรกที่ล็อคอินเข้าจะไม่มี password"
คำสั่ง show databases; เพื่อแสดงฐานข้อมูล หากต้องการออกให้ใช้คำสั่ง \q
mysql_sacure_installation คำสั่งติดตั้ง password ให้กับ root

ติดตั้ง PHP

ใช้คำสั่ง yum install php php-mysql* เพื่อเพิ่มแพคเกจเสริม

เมื่อติดตั้งครบทั้ง 3 อย่างแล้ว ให้ทำให้ apache run php และ php connect databases

ให้ restart server ใช้คำสั่ง systemctl restart httpd
how to test ให้ค้นหา w3school php connect to mysql นำตัวอย่างโค้ดมาใส่ที่
cd /var/www/html/
สร้างไฟล์.php ใน vi เช่น vi ชื่อไฟล์.php เมื่อเข้าไปที่ vi แล้ว ให้ใส่โค้ด แล้วทดสอบด้วยการ เข้าไปที่ webbrowser ใส่เลข ip เครื่อง / ชื่อไฟล์.php

วิธีการปิด Firewall ใน CentOS

systemctl stop firewalld
systemctl disable firewalld
systemctl mask –now firewalld
ตรวจสอบว่า Firewall ถูกปิดไปหรือยัง
systemctl status firewalld

เว็บแหล่งหาคำสั่งข้อมูลเพิ่มเติม

คำสั่ง root centos
http://www.doanytech.com/add-create-a-sudo-user-for-centos-8/
คำสั่ง vi
https://secure.jvh.co.th/index.php/knowledgebase/36/Linux-Server-CentOS
สอนติดตั้ง LAMP Stack
https://www.youtube.com/watch?v=cd4gFDQQMDE
Linux commands VI
https://medium.com/@pratya.yeekhaday/linux-vi-command-69bfd522fff
คำสั่ง PHP
https://www.w3schools.com/php/default.asp

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published