Installl Apache2.2+SSL in Ubuntu(7.10)
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://speedooo.blog.51cto.com/226772/52220 |
1. We need install Apache2.2 first, which is 2.2.4.3 version including SSL sudo apt--get install apache2 Or you can install it from SPM manager. 2. setup SSL certification There is bug in this release "apache2-ssl-certificate: command not found", so I tried using /usr/sbin/make-ssl-cert. But the key file apache.pem is not stored. What i done is: sudo mkdir /etc/apache2/ssl sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem
answer the questions: I put CommonName or hostName to admin.domain.com 3. Configration sudo a2enmod sslmodified these two files: "default" file: NameVirtualHost *:80 <virtualhost *:80> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteLog "/var/log/apache2/rewrite.log" </virtualhost> "ssl" file: NameVirtualHost *:443 <virtualhost *:443> ServerAdmin webmaster@localhost SSLEngine On SSLCertificateFile /etc/apache2/ssl/apache.pem DocumentRoot /var/www/ <directory /> Options FollowSymLinks AllowOverride None </directory> <directory /var/www/> Options Indexes 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 # Commented out for Ubuntu #RedirectMatch ^/$ /apache2-default/ </directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <directory "/usr/lib/cgi-bin"> AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On Alias /doc/ "/usr/share/doc/" <directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </directory> </virtualhost> After then:4. set serverName in apache2.conf add line like: ServerName admin.domain.com the name is the same as in your certification key file. 5. all done sudo /etc/init.d/apache2 force-reload 本文出自 “我爱我家” 博客,请务必保留此出处http://speedooo.blog.51cto.com/226772/52220 本文出自 51CTO.COM技术博客 |


speedooo
博客统计信息
热门文章
最新评论
友情链接