惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
Recent Announcements
Recent Announcements
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks

博客园 - 古月春秋(刘云涛)

打车抬表费用图 vi的一点小经验 修正mysqlcc在MySQL 5.0上常报的 Table 'xxx' doesn't exist 错误 Perl中不寻常的 ?: 运算符 - 古月春秋(刘云涛) 一行shell命令求素数 Boot FreeBSD from Windows boot loader Turtles - So Happy Together 关于IoC、低耦合、配置文件及其本质意义的思考 Perl与数据库 Perl无废话入门指南 W3C XSL Transformations (XSLT) Version 2.0 翻译计划 新版 apache_2.0.54 php-5.0.4 mysql-4.1.12a 组合安装向导(原创) Solaris 下安装Perl的DBD-mysql模块失败的原因以及解决办法 Why MSN Messenger ask me to verify email address all the time? SharpDevelop的AddInTree View 插件 SharpDevelop源码分析 (三、插件系统) SharpDevelop源码分析 (二、主程序+隐藏的初始化) SharpDevelop代码分析 (一、序+基本概念) 亚洲3S节目表
Ubuntu 5.10 下 Apache2 SSL 的配置方法
古月春秋(刘云涛) · 2006-02-18 · via 博客园 - 古月春秋(刘云涛)

Ubuntu下Apache的配置文件跟Solaris和FreeBSD下面有点不“太”一样,不过本质上还是那些。有的时候我就奇怪,这一个软件在不同的平台上咋能折腾出这么多花样来。

Apache2在Ubuntu系统内的基本情况如下
默认站点在 /var/www/
配置文件在 /etc/apache2/
日志在 /var/log/apache/
启动脚本是 /usr/sin/apache2ctl 或者 /etc/init.d/apache2

安装Apache2
#apt-get install apache2

安装SSL模块
#a2enmod ssl

创建默认的SSL证书
#apache2-ssl-certificate

复制一份站点配置做为SSL配置的原型
#cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
#ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl

编辑SSL的配置
#vi /etc/apache2/sites-enabled/ssl
把端口改为443
加入SSL认证配置

其它的根据需要自己定制 与普通配置无异
NameVirtualHost *:443
<VirtualHost *:443>
    ServerSignature On
    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/apache.pem

    ServerAdmin webmaster@localhost
#[......]

修改普通http方式的配置
#vi /etc/apache2/sites-enabled/default
把端口改为80
NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
#[......]

编辑Apache端口配置,加入443端口(SSL的)
#vi /etc/apache2/ports.conf:
Listen 80
Listen 443

重新载入Apache的配置
#/etc/init.d/apache2 force-reload

以下是SSL的配置文件的示例

NameVirtualHost *:443
<VirtualHost *:443>
        ServerSignature On
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/apache.pem

        ServerAdmin webmaster@localhost

        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>

posted on 2006-02-18 11:52  古月春秋(刘云涛)  阅读(1839)  评论()    收藏  举报