그누보드5와 React 같이 사용하기 1/2
https://www.youtube.com/watch?v=jqqM607r10M
ubuntu 24.04 LTS 버전의 서버에서
그누보드5를 설치하고 npm 을 설치하여 react 를 같이 사용하는 방법에 대해 알아 봅니다.
sudo apt update
sudo apt install -y apache2 php php-gd php-mysql mysql-server
sudo a2enmod rewrite
mysql 접속후
CREATE DATABASE mydb;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;
exit;
cd /var/www/html
git clone https://github.com/gnuboard/gnuboard5.git
cd gnuboard5
mkdir data
chmod 707 data
웹에서 그누보드5 실행
MySQL 정보입력
User : myuser
Password : mypassword
DB : mydb
sudo apt install -y npm
npx create-react-app react-app
cd react-app
vi package.json
"homepage": "/gnuboard5/react-app",
npm run build
vi .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /gnuboard5/react-app/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /gnuboard5/react-app/index.html [L]
</IfModule>
vi /etc/apache2/sites-enabled/000-default.conf
Alias /gnuboard5/react-app /var/www/html/gnuboard5/react-app/build
<Directory /var/www/html/gnuboard5/react-app>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
systemctl restart apache2
추가(240827) : .htaccess 는 없어도 되는 것으로 확인했습니다.
댓글 7개
nginx 의 경우 아래 설정을 적용해 보세요.
apt install nginx php-fpm
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
# React 앱을 위한 위치 설정
location /react-app {
alias /var/www/html/gnuboard5/react-app/build;
}
뭔가 건의를 하고 싶은데, 또 선동 당할까봐 건의 해보기가 무섭네요 ㅎㅎ
@미니님a 작업중에 말씀해 주시는게 좋습니다.
개발이 완료되면 변경이 어렵습니다.
https://github.com/gnuboard/gnuboard5/tree/feat/restapi
@리자
https://github.com/gnuboard/gnuboard5/issues/336
그누6에 있던 기능 개발 건의입니다
API 만 사용 + 예외적으로 관리자 페이지만 접근 가능...
@미니님a 아~ 이 내용은 개발완료 후 포함할 예정이었습니다.
감사합니다.
@리자 답변 감사합니다.
react 공부해보고 싶었는데.. 많은 도움이 될꺼 같습니다.
감사합니다.
게시판 목록
그누보드5 개발일지
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 1년 전 | 1726 | ||
| 26 | 1년 전 | 2932 | ||
| 25 |
|
1년 전 | 1968 | |
| 24 | 1년 전 | 1776 | ||
| 23 |
|
1년 전 | 1568 | |
| 22 | 1년 전 | 1626 | ||
| 21 | 1년 전 | 1926 | ||
| 20 |
|
1년 전 | 1610 | |
| 19 |
|
1년 전 | 1844 | |
| 18 | 1년 전 | 1537 | ||
| 17 |
|
1년 전 | 1486 | |
| 16 | 1년 전 | 1613 | ||
| 15 | 1년 전 | 924 | ||
| 14 | 1년 전 | 1028 | ||
| 13 | 1년 전 | 591 | ||
| 12 | 1년 전 | 421 | ||
| 11 | 1년 전 | 807 | ||
| 10 | 1년 전 | 535 | ||
| 9 |
|
1년 전 | 413 | |
| 8 | 1년 전 | 664 | ||
| 7 | 1년 전 | 743 | ||
| 6 |
|
1년 전 | 445 | |
| 5 | 1년 전 | 625 | ||
| 4 |
|
1년 전 | 445 | |
| 3 |
|
1년 전 | 520 | |
| 2 | 1년 전 | 1022 | ||
| 1 | 1년 전 | 1024 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기