[그누6실서비스] 7/8 - APACHE 설정
웹서버 설정 (APACHE)
g6.gnuboardd.com 도메인을 자신의 도메인 이름으로 변경하여 사용하세요.
(DNS 관리에서 A 레코드가 이 서버의 아이피로 설정이 되어 있어야 합니다.)
[code]
root@sirsoft-235928:/home/ubuntu/g6# apt install apache2
...
Do you want to continue? [Y/n] y
...
No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@sirsoft-235928:/home/ubuntu/g6# cd /etc/apache2/sites-enabled/
root@sirsoft-235928:/etc/apache2/sites-enabled# cp 000-default.conf g6.gnuboard.com.conf
root@sirsoft-235928:/etc/apache2/sites-enabled# vi g6.gnuboard.com.conf
# Apache2 Enable Module 설치
root@sirsoft-235928:/etc/apache2/sites-enabled# a2enmod proxy
root@sirsoft-235928:/etc/apache2/sites-enabled# a2enmod proxy_http
root@sirsoft-235928:/etc/apache2/sites-enabled# a2enmod headers
root@sirsoft-235928:/etc/apache2/sites-enabled# systemctl restart apache2
root@sirsoft-235928:/etc/apache2/sites-enabled# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2024-01-18 14:11:21 KST; 9s ago
[/code]
/etc/apache2/sites-enabled/g6.gnuboard.com.conf
[code]
<VirtualHost *:80>
ServerName g6.gnuboard.com
ServerAdmin account@gnuboard.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# 프록시 설정
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
# 헤더 전달
RequestHeader set X-Real-IP expr=%{REMOTE_ADDR}
RequestHeader set X-Forwarded-For expr=%{REMOTE_ADDR}
RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
</VirtualHost>
[/code]
다음글에 이어집니다.
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 5개
여러개 그누6사이트를 웹호스팅 하려면,
이부분을, 8000, 8001,8002 와 같이 각각 다른 포트로
실행을 해서 연동하는건가요?
@바다클라우드
맞습니다.
https://sir.kr/g6_tip/15 의
이 부분도 수정하셔야 합니다.레드햇계열 centos 의 경우 centos7 이나 centos8 에서도
기본으로 가능한가요?
centos8 에서 설치하려니 python 관련 버전이낮아서
안되는거 같군요.
(수정 . centos8 에서 파이썬을 3.9 로 높여서 설치해서
에러 보면서 명령어를 바꿔서 해보니,
설치에 성공했습니다.)
.. 쉽지 않군요. ㅜㅜㅜ
@바다클라우드
파이썬 버전 최소 3.8 이상 지원이 되어야 합니다.
확실하지 않지만 centos8에서는 3.6이 기본으로 지원되는것 같습니다.
@리자
맞습니다.3.6이기본인데, 3.8, 3.9, 3.11 을 병렬도 추가 설치가
가능하더군요.
root 로
yum install python39 python39-pip
로 python39를 설치하고,
사용자 아이디로.
python3.9 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
/home/사용자아이디/public_html/g6/venv/bin/python3.9 -m pip install --upgrade pip
uvicorn main:app --reload --port 8001
와 같이해서 일단 실행되긴 합니다.