2026, 새로운 도약을 시작합니다.

[그누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사이트를 웹호스팅 하려면,

 ProxyPass / http://127.0.0.1:8000/

이부분을, 8000, 8001,8002 와 같이 각각 다른 포트로

실행을 해서 연동하는건가요?

@바다클라우드

맞습니다.

https://sir.kr/g6_tip/15

ExecStart=/home/ubuntu/g6/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8001 --log-config log_config.ini

이 부분도 수정하셔야 합니다.

레드햇계열 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
 

와 같이해서 일단 실행되긴 합니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

그누보드6 팁자료실

그누보드6, 파이썬에 대한 팁과 자료를 올려주세요.
그누보드6 실서비스를 위한 웹서버 설정
번호 제목 글쓴이 날짜 조회
49 1주 전 조회 39
48 9개월 전 조회 753
47 1년 전 조회 694
46 1년 전 조회 807
45 1년 전 조회 739
44 1년 전 조회 546
43 1년 전 조회 531
42 1년 전 조회 865
41 1년 전 조회 524
40 1년 전 조회 861
39 1년 전 조회 1,954
38 1년 전 조회 2,793
37 1년 전 조회 1,585
36 1년 전 조회 2,517
35 1년 전 조회 1,196
34 1년 전 조회 1,747
33 1년 전 조회 2,300
32 1년 전 조회 731
31 1년 전 조회 1,282
30 1년 전 조회 1,072
29 1년 전 조회 1,301
28 1년 전 조회 975
27 1년 전 조회 897
26 1년 전 조회 1,110
25 1년 전 조회 818
24 1년 전 조회 1,228
23 1년 전 조회 729
22 1년 전 조회 606
21 1년 전 조회 1,121
20 1년 전 조회 1,195
🐛 버그신고