Apache2 支持 https (ubuntu10.04)

apt-get install apache2

 

运行a2enmod 输入ssl,激活模块

 

apache2-ssl-certificate 或者使用openssl

 

openssl req -x509 -newkey rsa:1024 -keyout apache.pem -out apache.pem -nodes -days 999

 

生产apache.pem cp到/etc/apache2

 

vim sites-available/default

 

添加

 

<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
ServerAdmin webmaster@localhost

DocumentRoot /var/www
ServerName 192.168.60.131
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>

</VirtualHost>

 

 

 

 

你可能感兴趣的:(apache,ssl,ubuntu,vim,Go)