
Apache에서 단일 IP로 여러 사이트 실행 +swagger 설치
2022-10-06 last update
5 minutes reading 아파치 swagger-ui swagger Swagger-editor하고 싶은 일
Apache에서 단일 IP에 대해 여러 사이트를 실행하고 싶습니다.
전제 조건
새로운 사이트 TOP을 우선 놓는다
touch /var/www/html/index.html //適当にHelloとか書いておく
vhost 추가 + 대상 변경
/etc/httpd/conf.d
cp -apr vhosts-redmine.conf vhosts-swagger.conf //コピーする
#NameVirtualHost *:80
<VirtualHost *:80>
ServerName swagger.local
DocumentRoot /var/www/html
</VirtualHost>
DNS 등록이 필요하므로 local hosts에 도메인 등록
172.26.6.94 swagger.local
이렇게하면 이름 확인이 불가능해도 대상 서버에 연결할 수 있습니다.
안전하게 표시됨

swagger 구축
composer
[[email protected] conf.d]# composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.9.0 2019-08-02 20:55:32
swagger 설치
composer require zircote/swagger-php
Using version ^3.0 for zircote/swagger-php
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
- Installing symfony/polyfill-ctype (v1.12.0): Downloading (100%)
- Installing symfony/yaml (v4.3.5): Downloading (100%)
- Installing symfony/finder (v4.3.5): Downloading (100%)
- Installing doctrine/lexer (1.1.0): Downloading (100%)
- Installing doctrine/annotations (v1.8.0): Downloading (100%)
- Installing zircote/swagger-php (3.0.2): Downloading (100%)
symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
Writing lock file
Generating autoload files
swagger-UI 설치
vim /etc/httpd/conf.d/vhosts-swagger.conf
<VirtualHost *:80>
ServerName swagger.local
DocumentRoot /var/www/swagger/swagger-ui/dist //DocRootを向けかえ
</VirtualHost>
액세스 확인
touch /var/www/html/index.html //適当にHelloとか書いておく
/etc/httpd/conf.d
cp -apr vhosts-redmine.conf vhosts-swagger.conf //コピーする
#NameVirtualHost *:80
<VirtualHost *:80>
ServerName swagger.local
DocumentRoot /var/www/html
</VirtualHost>
DNS 등록이 필요하므로 local hosts에 도메인 등록
172.26.6.94 swagger.local
이렇게하면 이름 확인이 불가능해도 대상 서버에 연결할 수 있습니다.
안전하게 표시됨

swagger 구축
composer
[[email protected] conf.d]# composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.9.0 2019-08-02 20:55:32
swagger 설치
composer require zircote/swagger-php
Using version ^3.0 for zircote/swagger-php
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
- Installing symfony/polyfill-ctype (v1.12.0): Downloading (100%)
- Installing symfony/yaml (v4.3.5): Downloading (100%)
- Installing symfony/finder (v4.3.5): Downloading (100%)
- Installing doctrine/lexer (1.1.0): Downloading (100%)
- Installing doctrine/annotations (v1.8.0): Downloading (100%)
- Installing zircote/swagger-php (3.0.2): Downloading (100%)
symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
Writing lock file
Generating autoload files
swagger-UI 설치
vim /etc/httpd/conf.d/vhosts-swagger.conf
<VirtualHost *:80>
ServerName swagger.local
DocumentRoot /var/www/swagger/swagger-ui/dist //DocRootを向けかえ
</VirtualHost>
액세스 확인
172.26.6.94 swagger.local

swagger 구축
composer
[[email protected] conf.d]# composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.9.0 2019-08-02 20:55:32
swagger 설치
composer require zircote/swagger-php
Using version ^3.0 for zircote/swagger-php
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
- Installing symfony/polyfill-ctype (v1.12.0): Downloading (100%)
- Installing symfony/yaml (v4.3.5): Downloading (100%)
- Installing symfony/finder (v4.3.5): Downloading (100%)
- Installing doctrine/lexer (1.1.0): Downloading (100%)
- Installing doctrine/annotations (v1.8.0): Downloading (100%)
- Installing zircote/swagger-php (3.0.2): Downloading (100%)
symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
Writing lock file
Generating autoload files
swagger-UI 설치
vim /etc/httpd/conf.d/vhosts-swagger.conf
<VirtualHost *:80>
ServerName swagger.local
DocumentRoot /var/www/swagger/swagger-ui/dist //DocRootを向けかえ
</VirtualHost>
액세스 확인
[[email protected] conf.d]# composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.9.0 2019-08-02 20:55:32
composer require zircote/swagger-php
Using version ^3.0 for zircote/swagger-php
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
- Installing symfony/polyfill-ctype (v1.12.0): Downloading (100%)
- Installing symfony/yaml (v4.3.5): Downloading (100%)
- Installing symfony/finder (v4.3.5): Downloading (100%)
- Installing doctrine/lexer (1.1.0): Downloading (100%)
- Installing doctrine/annotations (v1.8.0): Downloading (100%)
- Installing zircote/swagger-php (3.0.2): Downloading (100%)
symfony/yaml suggests installing symfony/console (For validating YAML files using the lint command)
Writing lock file
Generating autoload files
vim /etc/httpd/conf.d/vhosts-swagger.conf
<VirtualHost *:80>
ServerName swagger.local
DocumentRoot /var/www/swagger/swagger-ui/dist //DocRootを向けかえ
</VirtualHost>