- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2020-12-18T05:57:56+00:00","default:src128","src128")
#author("2020-12-19T04:47:19+00:00","default:src128","src128")
&tag(Ubuntu2004/Apache);
*目次 [#bd7a7de2]
#contents
*関連ページ [#cd557910]
*参考情報 [#p73a52ad]
-[[How to Install Apache Web Server on Ubuntu 20.04:https://www.tecmint.com/install-apache-web-server-on-ubuntu-20-04/]]
*インストール [#a86207b7]
-以下のコマンドを実行
sudo apt install apache2
*設定 [#c871b664]
-デフォルトのUser、Groupはwww-dataなのでとりあえずそこはそのまま。
-ポートの変更。/etc/apache2/ports.confを編集。
Listen 7777
-ファイウォールも変更しておくこと。
ufw allow 7777/tcp
-DocumentRootの変更。/etc/apache2/sites-available/000-default.confを編集。
#pre{{
DocumentRoot /home/sora/public_html
<Directory /home/sora/public_html>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
}}
*管理 [#a0726c3b]
-再起動
sudo systemctl restart apache2
*rbenv環境でPassengerを使う [#s8a555dc]
-必要なパッケージを入れる(ビルドが失敗したら何が必要が教えてくれるが)。
sudo apt install libcurl4-openssl-dev apache2-dev libapr1-dev libaprutil1-dev
-passengerを入れてpassenger-install-apache2-moduleを実行
$ gem install passenger
$ passenger-install-apache2-module
-インストール後表示される情報をメモ。
#pre{{
LoadModule passenger_module /home/sora/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/passenger-6.0.7/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/sora/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/passenger-6.0.7
PassengerDefaultRuby /home/sora/.rbenv/versions/2.6.6/bin/ruby
</IfModule>
}}
-さらにこれも必要。
#pre{{
<VirtualHost *:80>
ServerName www.yourhost.com
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /somewhere/public
<Directory /somewhere/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
}}
-httpd.confの一番したにあるIncludeの上に書くのが正解?