2023.11.27일자 최신 버젼 설치 방법은 아래 링크 참고하세요

https://raspberrytips.com/web-server-setup-on-raspberry-pi/

 

Set Up a LAMP Web Server On A Raspberry Pi In 2023

Setting up a web server can be useful for various projects. Unfortunately, it isn't really straightforward, especially if you need PHP and a MySQL database. I'm also a web developer and have built many web

raspberrytips.com

Set Up a LAMP Web Server On A Raspberry Pi In 2023

 Debian 12 Bookworm 

sudo apt update

sudo apt upgrade -y

 

sudo apt install apache2 -y

sudo apt install php libapache2-mod-php -y

 

설치가 끝나면 테스트

cd /var/www/html

sudo nano test.php

아래 한 줄을 입력하고 저장하세요

   <?php phpinfo(); ?>

웹브라우즈에서 

http://자신의 IP Address입력/test.php

하면 아래와 같이 php 정보가 뜨면 정상입니다

 

 

 

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------

 구버젼 설치 방법 : Debian 10, 11 Buster, Bullseye 

웹 서버를 운영하면 기본적으로 Apache2 서버가 설치됩니다

하지만 별도 설치하고자 하면 아래와 같이 간단하게 설치하시면 됩니다

 

1. 설치 순서

   sudo apt-get update

   sudo apt-get install apache2 -y      자동 설치 됩니다

   sudo systemctl status apache2       작동 상태 확인 (active (running) 이 보이면 정상입니다)

 

2. 정상 작동하는지 확인은 

    웹브라우즈에

    Apache2서버IP/index.html   을 입력하면 아래와 같이 화면이 뜨면 정상입니다

 

3. php 설치

  debian 10 : sudo apt-get -y install git build-essential php libapache2-mod-php php7.3-mbstring

  debian 11 : sudo apt-get -y install git build-essential php libapache2-mod-php php7.4-mbstring

 

 

4. user 폴드 권한 변경 (참고사항)

    sudo chmod 777 user

 

이제 php도 정상 작동 됩니다

 

 

DS5QDR 73!

블로그 이미지

DS5QDR Heonmin Lee in Korea

DV 통신 경험 공유 Mode : DMR, DSTAR, YSF, XLX, YSF, M17, AllStarLink, EchoLink Software : DVSwich, USRP Client, Last Heard, MiniPi, MiniMT, VuMeter, DVPi, Pi-Star

,