Skip to content

Instantly share code, notes, and snippets.

@mpen
Created September 11, 2009 10:37
Show Gist options
  • Save mpen/185219 to your computer and use it in GitHub Desktop.
Save mpen/185219 to your computer and use it in GitHub Desktop.
Apache2.2 で複数バーチャルホスト / Ubuntu9.04 + Apache2.2.11 + Rails + Passenger2.2.5
# Apache2.2 で複数バーチャルホスト
# Ubuntu9.04 + Apache2.2.11 + Rails + Passenger2.2.5
# /etc/hosts
127.0.0.1 localhost
127.0.1.1 localhost.localdomain ubuntu-desktop
127.0.0.1 mydomain
# httpd.conf
PassengerPoolIdleTime 0
# /etc/apache2/ports.conf
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
NameVirtualHost *:443
Listen 443
</IfModule>
# /etc/apache2/sites-available/mydomain
<VirtualHost *:80>
ServerName mydomain
DocumentRoot /home/mpen/mydomain/public
CustomLog /var/log/apache2/mydomain-access.log combined
ErrorLog /var/log/apache2/mydomain-error.log
RailsEnv development
PassengerMaxPoolSize 2
</VirtualHost>
<VirtualHost *:443>
ServerName mydomain
DocumentRoot /home/mpen/mydomain/public
CustomLog /var/log/apache2/mydomain-ssl-access.log combined
ErrorLog /var/log/apache2/mydomain-ssl-error.log
RailsEnv development
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment