0
0

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 3 years have passed since last update.

Apacheサーバーから複数アプリを振り分ける

Posted at

Every Qiita #12
のんびり独学初学者の毎日投稿チャレンジ 12日目
今回は・・・
VirtualBoxで1つのwebサーバーでポート番号ごとにプロジェクトを切り替えるときの備忘録です。

/etc/httpd/conf/httpd.conf

webサーバーにポート番号を宣言するファイルになります。

httpd.conf
Listen 80
Listen 81
Listen 8080
Listen 8081

ここでポート番号を指定します。
ローカル側で使えない番号もあるので確認の上設定してください。

/etc/httpd/conf.d/(任意サーバー名).conf

webサーバーで宣言したポート番号ごとにドキュメントルートを設定するファイルになります。

(任意サーバー名).conf
<VirtualHost *:80>
ServerName (任意).test
DocumentRoot "/var/www/html/(アプリケーションのルートパス)"

<Directory "/var/www/html/">
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:8080>
ServerName (任意2).test
DocumentRoot "/var/www/html/(アプリケーションのルートパス)"

<Directory "/var/www/html/">
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
</Directory>

宣言したポート番号ごとにドキュメントルートを指定すればwebサーバーでアプリケーションを複数設定することができます。
まだまだ知見が浅いのでご指摘頂けると幸いです。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?