How to configure apache2 SSL in Ubuntu 5.10

Source: Internet
Author: User
Tags ssl certificate
The Apache configuration files in Ubuntu are a little different from those in Solaris and FreeBSD, but they are essentially the same. Sometimes I wonder how many tricks this software can make on different platforms.

The basic situation of apache2 in Ubuntu is as follows:
The default site is at/var/www/
The configuration file is in/etc/apache2/
Log in/var/log/Apache/
The STARTUP script is/usr/SiN/apache2ctl or/etc/init. d/apache2.

Install apache2
# Apt-Get install apache2

Install the SSL module
# A2enmod SSL

Create a default SSL Certificate
# Apache2-ssl-certificate

Copy a site configuration as the prototype of SSL Configuration
# Cp/etc/apache2/sites-available/default/etc/apache2/sites-available/SSL
# Ln-S/etc/apache2/sites-available/SSL/etc/apache2/sites-enabled/SSL

Edit SSL configurations
# Vi/etc/apache2/sites-enabled/SSL
Change the port to 443
Add SSL authentication Configuration

Other custom configurations are the same as common configurations.
Namevirtualhost *:443
<Virtualhost *:443>
Serversignature on
Sslengine on
Sslcertificatefile/etc/apache2/SSL/Apache. pem

Serveradmin webmaster @ localhost
# [...]

Modify configurations of common HTTP methods
# Vi/etc/apache2/sites-enabled/Default
Change the port to 80
Namevirtualhost *:80
<Virtualhost *:80>
Serveradmin webmaster @ localhost
# [...]

Edit Apache port configuration and add port 443 (SSL)
# Vi/etc/apache2/ports. conf:
Listen 80
Listen 443.

Reload Apache configuration
#/Etc/init. d/apache2 force-Reload

The following is an example of an SSL configuration file: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 >

.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.