0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apacheの名前ベースのバーチャルホストを利用したときのメモ

Last updated at Posted at 2019-07-06

環境

  • CentOS 7
  • Apache 2.4.6

参考URL

クライアント

hostsにサーバー名を登録

192.168.99.101 nexus-server

Apacheサーバー

/etc/httpd/conf.dに下記の設定ファイルを作成

# どのドメインを名前ベースのバーチャルホストにするかを指定
# ちなみに名前ベースのバーチャルホストを利用するとメインホストがなくなる
NameVirtualHost *:80

<VirtualHost _default_:80>
</VirtualHost>

<VirtualHost *:80>
  ServerName nexus-server
  ProxyRequests off
  ProxyPass / http://localhost:8081/
  ProxyPassReverse / http://localhost:8081/
</VirtualHost>

リバースプロキシを利用した場合

 /etc/sysconfig/selinuxの該当行を編集し、サーバーを再起動

SELINUX=disabled
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?