Monday, November 24, 2008

在 Ubuntu 8.10 安裝 apache 2.2 + ssl

# apt-get install apache2 openssl ssl-cert
# openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem
-----------
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:London
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Debian
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:
-----------

# chmod 600 /etc/apache2/apache.pem

# cd /etc/apache2/mods-enabled/
# ln -s ../mods-available/ssl.* .
# cd /etc/apache2/site-enabled/
# ln -s ../site-available/default-ssl .

modify ports.conf and add
LISTEN 443

NameVirtualHost *:443

# /etc/init.d/apache2 restart

No comments: