VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.
12113 단어 아파치VirtualBoxCentOS
소개
VirtualBox에서 Ubunts의 nginx로 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다. 의 Apache 버전입니다.
VirtualBox 초보자이므로 그쪽의 순서도 메모입니다.
"Apache에서 역방향 프록시하고 HTML을 다시 작성"은 여기에서입니다.
Virtualbox에서 새로 만들기

적당히 이름을 붙인다

그리고는 디폴트인 채로 다음을 연타
네트워크 어댑터 1에서 포트 포워딩


네트워크 어댑터 2를 활성화하고 Host-Only를 선택합니다.

스토리지에 Centos 선택
CentOS 다운로드 소스


시작하고 설치

일본어를 선택 (왼쪽 하단의 검색 상자에 "J"를 입력으로 바로 나온다)


설치 대상 선택

네트워크 ON(emp0s3 및 emp0s8 모두)

사용자와 비밀번호 만들기


설치가 끝나면 재부팅

emp0s8의 IP에 rlogin으로 연결


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)

적당히 이름을 붙인다

그리고는 디폴트인 채로 다음을 연타
네트워크 어댑터 1에서 포트 포워딩


네트워크 어댑터 2를 활성화하고 Host-Only를 선택합니다.

스토리지에 Centos 선택
CentOS 다운로드 소스


시작하고 설치

일본어를 선택 (왼쪽 하단의 검색 상자에 "J"를 입력으로 바로 나온다)


설치 대상 선택

네트워크 ON(emp0s3 및 emp0s8 모두)

사용자와 비밀번호 만들기


설치가 끝나면 재부팅

emp0s8의 IP에 rlogin으로 연결


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
네트워크 어댑터 1에서 포트 포워딩


네트워크 어댑터 2를 활성화하고 Host-Only를 선택합니다.

스토리지에 Centos 선택
CentOS 다운로드 소스


시작하고 설치

일본어를 선택 (왼쪽 하단의 검색 상자에 "J"를 입력으로 바로 나온다)


설치 대상 선택

네트워크 ON(emp0s3 및 emp0s8 모두)

사용자와 비밀번호 만들기


설치가 끝나면 재부팅

emp0s8의 IP에 rlogin으로 연결


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)

스토리지에 Centos 선택
CentOS 다운로드 소스


시작하고 설치

일본어를 선택 (왼쪽 하단의 검색 상자에 "J"를 입력으로 바로 나온다)


설치 대상 선택

네트워크 ON(emp0s3 및 emp0s8 모두)

사용자와 비밀번호 만들기


설치가 끝나면 재부팅

emp0s8의 IP에 rlogin으로 연결


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)

일본어를 선택 (왼쪽 하단의 검색 상자에 "J"를 입력으로 바로 나온다)


설치 대상 선택

네트워크 ON(emp0s3 및 emp0s8 모두)

사용자와 비밀번호 만들기


설치가 끝나면 재부팅

emp0s8의 IP에 rlogin으로 연결


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)

네트워크 ON(emp0s3 및 emp0s8 모두)

사용자와 비밀번호 만들기


설치가 끝나면 재부팅

emp0s8의 IP에 rlogin으로 연결


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)


설치가 끝나면 재부팅

emp0s8의 IP에 rlogin으로 연결


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)


enp0s8이 활성화되지 않은 경우
nmcli connection modify enp0s8 autoconnect yes
yum 프록시 설정(프록시가 있는 경우)
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.confproxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
nmcli connection modify enp0s8 autoconnect yes
[root@localhost ~]# vi /etc/yum.conf
/etc/yum.conf
proxy=http:/hoge.co.jp:18080
#http:/hoge.co.jp:18080は自分の環境に合わせて変更してください

httpd를 설치하고 시작
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
방화벽 80번 포트 오픈
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl start httpd.service
[root@localhost ~]# firewall-cmd --add-service=http --permanent
[root@localhost ~]# firewall-cmd --reload
/usr/sbin/setsebool httpd_can_network_connect true
방문해보기

호스트 OS 폴더 공유
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
VirtualBox에서 공유 폴더를 만들어 게스트 OS와 파일 공유
마운트 된 디렉토리의 권한 그룹 (vboxsf)에 apache 실행 사용자 (apache) 추가
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
Apache의 DocumentRoot에 미리 마운트 된 디렉토리 설정
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[root@localhost ~]# gpasswd -a apache vboxsf
[root@localhost ~]# systemctl restart httpd.service
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf
# DocumentRoot "/var/www/html"
DocumentRoot "/media/sf_extendedui/"
・・・
# <Directory "/var/www/html">
<Directory "/media/sf_extendedui/">
Options Indexes FollowSymLinks
・・・
</Directory>
[root@localhost ~]# systemctl restart httpd.service
SELinux가 활성화된 경우 비활성화
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
Apache 모듈 설정(대체 기능 활성화)
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled ← enforcing から disabled に変更
[root@localhost ~]# shutdown -r now
[root@localhost ~]# vi /etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-base.conf
#LoadModule request_module modules/mod_request.so
LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so
역방향 프록시 및 HTML 재작성 설정
http://localhost:8080/hello/ 에 액세스하면 http://localhost:3000/world/ 의 HTML 표시
OutputSed "s/[대체 원본 문자열]/[대체하려는 문자열]/g"
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
/etc/httpd/conf.d/rproxy.conf<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
nodejs 설치
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[root@localhost ~]# vi /etc/httpd/conf.d/rproxy.conf
<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
<VirtualHost _default_:80>
ServerName localhost:8080
ProxyPass /hello http://localhost:3000/world/
ProxyPassReverse /hello http://localhost:3000/world/
<LocationMatch /.*(/.+)*>
AddOutputFilterByType Sed text/html php asp jsp
OutputSed "s/Hello/Crazy/g"
</LocationMatch>
</VirtualHost>
</IfModule>
[root@localhost ~]# yum install epel-release
[root@localhost ~]# yum install nodejs npm
방화벽 3000번 포트 오픈
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
node로 시작하는 HTML 준비
hello.html<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.jsconst http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[root@localhost ~]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
hello.js
const http = require('http');
const fs = require('fs');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
// res.setHeader('Content-Type', 'text/plain');
// res.end('Hello World!\n');
fs.readFile('hello.html','UTF-8',
(error, data)=>{
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
res.end();
});
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
node에서 시작하여 http://localhost:8080/hello 에 액세스
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Docker로 하고 싶다
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[root@localhost ~]# node hello.js
Server running at http://127.0.0.1:3000/
Reference
이 문제에 관하여(VirtualBox에서 CentOS의 Apache에서 역방향 프록시하여 HTML을 다시 작성하여 Hello World를 Crazy World로 만듭니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/the1031hiroto/items/5b0b69801c30a17c9800텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)