# Webmin + Virtual Servers/Subdomains



## Lego (Oct 5, 2009)

I've read many tutorials on creating virtual hosts but I have had no luck, Im doing something wrong...

Ok, so I have my main site blurr-ink.com, and in webmin under apache blurr-ink.com is the default server, so blurr-ink.com and http://www.blurr-ink.com both send you to the same place, which is fine, but I'm trying to make hide.blurr-ink.com send you to a different page... I've tried many different configurations and can't seem to get it to work at all.... 

I want hide.blurr-ink.com to only be accessible from the address https://hide.blurr-ink.com, but no matter how I configure it http://*.blurr-ink.com (* being, blank, www, ftp, hide, etc) will bring you to the same place.. my main page, and https://*.blurr-ink.com (again, blank, ftp, hide, www, etc) all bring you to my proxy

As you can see, by checking these 6 links:
The first 3 take will take you to my main site, the other 3 take you to my proxy... and the only way to make the https:// ones work was to make the address for them ANY.... I have a few images to show you what I mean and I'll post the config's aswell.

http://www.blurr-ink.com http://hide.blurr-ink.com
http://ftp.blurr-ink.com https://ftp.blurr-ink.com
https://www.blurr-ink.com https://hide.blurr-ink.com







As you can see shouldn't ftp.blurr-ink.com send you to a different page then the main site page!?!?

here is my httpd.conf:

```
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "/var/log/foo_log"
# with ServerRoot set to "/usr/local" will be interpreted by the
# server as "/usr/local//var/log/foo_log".

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk.  If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "/usr/local"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen *:80
Listen *:443

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule authn_file_module libexec/apache22/mod_authn_file.so
LoadModule authn_dbm_module libexec/apache22/mod_authn_dbm.so
LoadModule authn_anon_module libexec/apache22/mod_authn_anon.so
LoadModule authn_default_module libexec/apache22/mod_authn_default.so
LoadModule authn_alias_module libexec/apache22/mod_authn_alias.so
LoadModule authz_host_module libexec/apache22/mod_authz_host.so
LoadModule authz_groupfile_module libexec/apache22/mod_authz_groupfile.so
LoadModule authz_user_module libexec/apache22/mod_authz_user.so
LoadModule authz_dbm_module libexec/apache22/mod_authz_dbm.so
LoadModule authz_owner_module libexec/apache22/mod_authz_owner.so
LoadModule authz_default_module libexec/apache22/mod_authz_default.so
LoadModule auth_basic_module libexec/apache22/mod_auth_basic.so
LoadModule auth_digest_module libexec/apache22/mod_auth_digest.so
LoadModule file_cache_module libexec/apache22/mod_file_cache.so
LoadModule cache_module libexec/apache22/mod_cache.so
LoadModule disk_cache_module libexec/apache22/mod_disk_cache.so
LoadModule dumpio_module libexec/apache22/mod_dumpio.so
LoadModule include_module libexec/apache22/mod_include.so
LoadModule filter_module libexec/apache22/mod_filter.so
LoadModule charset_lite_module libexec/apache22/mod_charset_lite.so
LoadModule deflate_module libexec/apache22/mod_deflate.so
LoadModule log_config_module libexec/apache22/mod_log_config.so
LoadModule logio_module libexec/apache22/mod_logio.so
LoadModule env_module libexec/apache22/mod_env.so
LoadModule mime_magic_module libexec/apache22/mod_mime_magic.so
LoadModule cern_meta_module libexec/apache22/mod_cern_meta.so
LoadModule expires_module libexec/apache22/mod_expires.so
LoadModule headers_module libexec/apache22/mod_headers.so
LoadModule usertrack_module libexec/apache22/mod_usertrack.so
LoadModule unique_id_module libexec/apache22/mod_unique_id.so
LoadModule setenvif_module libexec/apache22/mod_setenvif.so
LoadModule version_module libexec/apache22/mod_version.so
LoadModule ssl_module libexec/apache22/mod_ssl.so
LoadModule mime_module libexec/apache22/mod_mime.so
LoadModule dav_module libexec/apache22/mod_dav.so
LoadModule status_module libexec/apache22/mod_status.so
LoadModule autoindex_module libexec/apache22/mod_autoindex.so
LoadModule asis_module libexec/apache22/mod_asis.so
LoadModule info_module libexec/apache22/mod_info.so
LoadModule cgi_module libexec/apache22/mod_cgi.so
LoadModule dav_fs_module libexec/apache22/mod_dav_fs.so
LoadModule vhost_alias_module libexec/apache22/mod_vhost_alias.so
LoadModule negotiation_module libexec/apache22/mod_negotiation.so
LoadModule dir_module libexec/apache22/mod_dir.so
LoadModule imagemap_module libexec/apache22/mod_imagemap.so
LoadModule actions_module libexec/apache22/mod_actions.so
LoadModule speling_module libexec/apache22/mod_speling.so
LoadModule userdir_module libexec/apache22/mod_userdir.so
LoadModule alias_module libexec/apache22/mod_alias.so
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
LoadModule php5_module libexec/apache22/libphp5.so
```


----------



## Lego (Oct 5, 2009)

```
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.  
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User www
Group www

</IfModule>
</IfModule>

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
ServerAdmin admin@blurr-ink.com

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName blurr-ink.com:80

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/usr/local/www/data"
#DocumentRoot "/usr/local/www/apache22/data"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory />
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/local/www/data">
#<Directory> "/usr/local/www/apache22/data">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.html index.htm
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "/var/log/httpd-error.log"

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    #CustomLog "/var/log/httpd-access.log" common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    CustomLog "/var/log/httpd-access.log" combined
</IfModule>

<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to 
    # exist in your server's namespace, but do not anymore. The client 
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts. 
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "/usr/local/www/data/cgi-bin/"
Alias /phpMyAdmin "/usr/local/www/phpMyAdmin"
Alias /phpmyadmin "/usr/local/www/phpMyAdmin"
Alias /roundcube "/usr/local/www/roundcube"
Alias /webmail "/usr/local/www/roundcube"

</IfModule>

<IfModule cgid_module>
    #
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #
    #Scriptsock /var/run/cgisock
</IfModule>

#
# "/usr/local/www/apache22/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
```


----------



## Lego (Oct 5, 2009)

```
<Directory "/usr/local/www/data/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
<Directory "/usr/local/www/phpMyAdmin">
    Options Indexes FollowSymLinks
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
</Directory>
<Directory "/usr/local/www/data/htaccess">
    Options Indexes FollowSymLinks
    AllowOverride AuthConfig
    Order deny,allow
</Directory>
<Directory "/usr/local/www/roundcube">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig etc/apache22/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
AddType application/x-httpd-php .php
AddType application/x-httpd-source .phps
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile etc/apache22/magic

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# EnableMMAP and EnableSendfile: On systems that support it, 
# memory-mapping or the sendfile syscall is used to deliver
# files.  This usually improves server performance, but must
# be turned off when serving from networked-mounted 
# filesystems or if support for these functions is otherwise
# broken on your system.
#
#EnableMMAP off
#EnableSendfile off

# Supplemental configuration
#
# The configuration files in the etc/apache22/extra/ directory can be 
# included to add extra features or to modify the default configuration of 
# the server, or you may simply copy their contents here and change as 
# necessary.

# Server-pool management (MPM specific)
#Include etc/apache22/extra/httpd-mpm.conf

# Multi-language error messages
#Include etc/apache22/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
#Include etc/apache22/extra/httpd-autoindex.conf

# Language settings
Include etc/apache22/extra/httpd-languages.conf

# User home directories
#Include etc/apache22/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include etc/apache22/extra/httpd-info.conf

# Virtual hosts
#Include etc/apache22/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include etc/apache22/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include etc/apache22/extra/httpd-dav.conf

# Various default settings
#Include etc/apache22/extra/httpd-default.conf

# Secure (SSL/TLS) connections
#Include etc/apache22/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Include etc/apache22/Includes/*.conf

SSLEngine off
SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem

#END OF STANDARD CONFIG!

<VirtualHost *:443>
DocumentRoot /usr/local/www/hide
ServerName hide.blurr-ink.com
<Directory "/usr/local/www/hide">
allow from all
Options +Indexes
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem
</VirtualHost>
NameVirtualHost 216.8.133.242
<VirtualHost ftp.blurr-ink.com:80>
DocumentRoot /usr/local/www/data/ftp
ServerName ftp.blurr-ink.com
<Directory "/usr/local/www/data/ftp">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
```

my dns file:

```
$ttl 38400
blurr-ink.com.  IN      SOA      blurr-ink.com. admin.blurr-ink.com. (
                        1237191291
                        10800
                        3600
                        604800
                        38400 )
; The IP of "blurr-ink.com" itself
                IN      A       216.8.133.242
;DNS Server
                IN      NS      ns1.blurr-ink.com.
                IN      NS      ns2.blurr-ink.com.
;MX record (mail server)
                IN      MX  10   mx.blurr-ink.com.
;Aliases
ns1             IN      A       216.8.133.242
ns2             IN      A       216.8.133.242
mx              IN      A       216.8.133.242
www             IN      CNAME   @
ssh             IN      CNAME   @
ftp             IN      A       216.8.133.242
hide            IN      CNAME   @
```


----------



## anomie (Oct 5, 2009)

NameVirtualHost + SSL is not possible; read here: http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html#vhosts 

(Well, apparently it is possible, but I never tried SNI.) 

-------

As for the other issue, try changing this: 

```
NameVirtualHost 216.8.133.242
<VirtualHost ftp.blurr-ink.com:80>
DocumentRoot /usr/local/www/data/ftp
ServerName ftp.blurr-ink.com
<Directory "/usr/local/www/data/ftp">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
```

to this: 

```
NameVirtualHost 216.8.133.242:80

<VirtualHost 216.8.133.242:80>
DocumentRoot /usr/local/www/data/ftp
ServerName ftp.blurr-ink.com
<Directory "/usr/local/www/data/ftp">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
```


----------



## dennylin93 (Oct 6, 2009)

anomie said:
			
		

> (Well, apparently it is possible, but I never tried SNI.)




This is great. However, I'll have to install OpenSSL from ports.


----------



## Lego (Oct 8, 2009)

Ok, SSL works when I have it set to handle all connections to port 443, once i change it to handle hide.blurr-ink.com:443 (ssl=https:// you guys know what I mean) it works, but so does http://www.blurr-ink.com, ftp.blurr-ink.com and any other CNAME/A record like mx.blurr-ink.com would work also. that shouldn't be only https://hide.blurr-ink.com should work..... so basically regardless of the SSL all subdomains/subservers whatever you want to call them.. aren't working properly....

So, I made the changes as you suggested, and and now just waiting for DNS to resolve....again...

```
#END OF STANDARD CONFIG!

<VirtualHost *:443>
DocumentRoot /usr/local/www/hide
ServerName hide.blurr-ink.com
<Directory "/usr/local/www/hide">
allow from all
Options +Indexes
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem
</VirtualHost>
NameVirtualHost 216.8.175.213:80
<VirtualHost 216.8.175.213:80>
DocumentRoot "/usr/local/www/data/ftp"
ServerName ftp.blurr-ink.com
<Directory "/usr/local/www/data/ftp">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
```

I do want to point out though, that that I have tried like that, and just making them *:80, with the same results...

that being it always loading what http://www.blurr-ink.com or blurr-ink.com loads.... my main site.


----------



## Lego (Oct 8, 2009)

ok, DNS just finished resolving.... Same results, ftp.blurr-ink.com still takes you to the same place *.blurr-ink.com takes you... https://*.blurr-ink.com still takes to you my ssl site.

should i change the hostname of the computer, and the default servers name to something not related to blurr-ink.com?? like change the computer hostname to Lego-Server and the default server name address to Lego-Server and then make blurr-ink.com itself also a virtual server??


----------



## anomie (Oct 8, 2009)

I notice this doesn't match your directive: 

```
%host ftp.blurr-ink.com
ftp.blurr-ink.com has address 216.8.133.228
```


----------



## Lego (Oct 8, 2009)

yea thats because my ip was reset on me... they do match. 216.8.133.228 is my current IP, 216.8.175.213:80 was the old one. They do match. I just had to make changes after i had already posted that reply.
blurr-ink.com.hosts:

```
$ttl 38400
blurr-ink.com.  IN      SOA      blurr-ink.com. admin.blurr-ink.com. (
                        1237191291
                        10800
                        3600
                        604800
                        38400 )
; The IP of "blurr-ink.com" itself
                IN      A       216.8.133.228
;DNS Server
                IN      NS      ns1.blurr-ink.com.
                IN      NS      ns2.blurr-ink.com.
;MX record (mail server)
                IN      MX  10   mx.blurr-ink.com.
;Aliases
ns1             IN      A       216.8.133.228
ns2             IN      A       216.8.133.228
mx              IN      A       216.8.133.228
www             IN      CNAME   @
ssh             IN      CNAME   @
ftp             IN      A       216.8.133.228
hide            IN      CNAME   @
```

httpd.conf:

```
#END OF STANDARD CONFIG!

<VirtualHost *:443>
DocumentRoot /usr/local/www/hide
ServerName hide.blurr-ink.com
<Directory "/usr/local/www/hide">
allow from all
Options +Indexes
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem
</VirtualHost>
NameVirtualHost 216.8.133.228:80
<VirtualHost 216.8.133.228:80>
DocumentRoot "/usr/local/www/data/ftp"
ServerName ftp.blurr-ink.com
<Directory "/usr/local/www/data/ftp">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
```

I just forgot to update it before i posted that....


```
blurr-ink# host ftp.blurr-ink.com
ftp.blurr-ink.com has address 216.8.133.228
blurr-ink#
```


----------



## anomie (Oct 8, 2009)

Where does your access log show is being served up when you visit ftp.blurr-ink.com? Any useful messages in your error log? (Set *LogLevel info*.) 

BTW, I'm presuming that you are restarting httpd between config changes...


----------



## Lego (Oct 9, 2009)

yes, im restarting apache each time I make a change; I just made some changes to my DNS Record so it now looks like this:

```
$ttl 38400
blurr-ink.com.  IN      SOA      blurr-ink.com. admin.blurr-ink.com. (
                        1237191291
                        10800
                        3600
                        604800
                        38400 )
; The IP of "blurr-ink.com" itself
                IN      A       216.8.133.228
;DNS Server
                IN      NS      ns1.blurr-ink.com.
                IN      NS      ns2.blurr-ink.com.
;MX record (mail server)
                IN      MX  10   mx.blurr-ink.com.
;Aliases
ns1             IN      A       216.8.133.228
ns2             IN      A       216.8.133.228
mx              IN      A       216.8.133.228
www             IN      CNAME   @
ssh             IN      A       216.8.133.228
ftp             IN      A       216.8.133.228
hide            IN      A       216.8.133.228
```

And the host outputs now look like this:

```
blurr-ink# host blurr-ink.com
blurr-ink.com has address 216.8.133.228
blurr-ink.com mail is handled by 10 mx.blurr-ink.com.
blurr-ink#
blurr-ink# host www.blurr-ink.com
www.blurr-ink.com is an alias for blurr-ink.com.
blurr-ink.com has address 216.8.133.228
blurr-ink.com mail is handled by 10 mx.blurr-ink.com.
blurr-ink#
blurr-ink# host hide.blurr-ink.com
hide.blurr-ink.com has address 216.8.133.228
blurr-ink#
blurr-ink# host ftp.blurr-ink.com
ftp.blurr-ink.com has address 216.8.133.228
blurr-ink#
```

but still no luck, should my default server be changed to something not blurr-ink related, then make blurr-ink.com a virtual server, with www. as an alias ?? and each subdomain a virtual aswell??

How do i check the access log?? like where is it?
nevermind i found it.. checking now....


----------



## Lego (Oct 9, 2009)

httpd-access.log:

```
216.8.133.228 - - [08/Oct/2009:19:32:58 -0400] "GET / HTTP/1.1" 200 1291 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.3) Gecko/20090824 Fire
216.8.133.228 - - [08/Oct/2009:19:32:58 -0400] "GET /themes/default/default.css HTTP/1.1" 304 - "http://ftp.blurr-ink.com/" "Mozilla/5.0 (Windows; U; Windows
216.8.133.228 - - [08/Oct/2009:19:32:58 -0400] "GET /themes/default/banner.jpg HTTP/1.1" 304 - "http://ftp.blurr-ink.com/themes/default/default.css" "Mozilla
```

httpd-error.log

```
[Thu Oct 08 19:32:53 2009] [info] Init: Seeding PRNG with 136 bytes of entropy
[Thu Oct 08 19:32:53 2009] [info] Loading certificate & private key of SSL-aware server
[Thu Oct 08 19:32:53 2009] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Thu Oct 08 19:32:53 2009] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Thu Oct 08 19:32:53 2009] [info] Init: Initializing (virtual) servers for SSL
[Thu Oct 08 19:32:53 2009] [info] Configuring server for SSL protocol
[Thu Oct 08 19:32:53 2009] [info] mod_ssl/2.2.9 compiled against Server: Apache/2.2.9, Library: OpenSSL/0.9.8e
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20060613/gd.so' - Shared object "libjpeg.so.9" not found, required by
[Thu Oct 08 19:32:53 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Oct 08 19:32:53 2009] [notice] Digest: done
[Thu Oct 08 19:32:53 2009] [info] mod_unique_id: using ip addr 127.0.0.1
[Thu Oct 08 19:32:54 2009] [notice] Apache/2.2.9 (FreeBSD) mod_ssl/2.2.9 OpenSSL/0.9.8e DAV/2 PHP/5.2.8 with Suhosin-Patch configured -- resuming normal oper
[Thu Oct 08 19:32:54 2009] [info] Server built: Apr  6 2009 02:21:16
[Thu Oct 08 19:32:54 2009] [info] [client ::1] Connection to child 2 established (server hide.blurr-ink.com:443)
[Thu Oct 08 19:32:54 2009] [info] Seeding PRNG with 136 bytes of entropy
[Thu Oct 08 19:32:54 2009] [info] [client ::1] SSL library error 1 in handshake (server hide.blurr-ink.com:443)
[Thu Oct 08 19:32:54 2009] [info] SSL Library Error: 336027900 error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol speaking not SSL to HTTPS
[Thu Oct 08 19:32:54 2009] [info] [client ::1] Connection closed to child 2 with abortive shutdown (server hide.blurr-ink.com:443)
[Thu Oct 08 19:32:54 2009] [info] [client ::1] Connection to child 2 established (server hide.blurr-ink.com:443)
[Thu Oct 08 19:32:54 2009] [info] Seeding PRNG with 136 bytes of entropy
[Thu Oct 08 19:32:54 2009] [info] [client ::1] SSL library error 1 in handshake (server hide.blurr-ink.com:443)
[Thu Oct 08 19:32:54 2009] [info] SSL Library Error: 336027900 error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol speaking not SSL to HTTPS
[Thu Oct 08 19:32:54 2009] [info] [client ::1] Connection closed to child 2 with abortive shutdown (server hide.blurr-ink.com:443)
```


----------



## anomie (Oct 9, 2009)

LogLevel is an Apache 2.2 directive, so you'd set its value in your httpd.conf (or one of the .conf files getting sucked in, as appropriate). 

I don't see an obvious problem with your configuration at this point, but not all of it is posted here. Apache's error logging is good about complaining when you have borked virtualhost setups, so that's the angle to pursue next, IMO. 

BTW, you don't have to keep changing your DNS records. You have namevirtualhosts in place, and all hostnames resolve to the same IP. So, to keep things simple while investigating the problem, I would suggest leaving DNS alone.


----------



## Lego (Oct 9, 2009)

i do have to change the dns record each time my external ip changes because thats what all the records are in my dns record, external ips not internal and.. because godaddy holds the ip of ns1.blurr-ink.com/ns2.blurr-ink.com I have to update them to point to my ip again.

external ip is: 216.8.133.228
internal ip of server is 192.168.0.194 and any port needed is forwarded to that ip.... 

yea I did make the chagne in the httpd.conf to info it was warn... what would you suggest me doing at this point... what would you like me to post or do to try and resolve the issue?? I know I even tried to make a virtual host with the virtualmin pages and that server wouldn't resolve at all... mind you it wasn't a different tld it was subdomain.blurr-ink.com and it didn't work at all.... but it's long since gone..

also, i guess you can't see the end of the lines because i ssh into my server (no monitor/keyboard/mouse hooked up) and im using ee to view the docs and selecting and copying it doesn't copy the entire lines....weird.. it only copies what fits on the screen


----------



## Lego (Oct 9, 2009)

ok for giggles, i added to the blurr-ink.com.hosts file:

```
ftp2     IN     A     216.8.133.228
```

restarted named....

created a new virtual host(in Webmin); ftp2.blurr-ink.com:

```
<VirtualHost ftp2.blurr-ink.com:80>
DocumentRoot "/usr/local/www/data/ftp"
ServerName ftp2.blurr-ink.com
<Directory "/usr/local/www/data/ftp">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
```

Same result of ending up at my main site......


```
blurr-ink# host ftp2.blurr-ink.com
ftp2.blurr-ink.com has address 216.8.133.228
```


----------



## Lego (Oct 9, 2009)

what would happen if i changed my server's hostname in the rc.conf from 'hostname="blurr-ink.com"' to 'hostname="lego-pc" and changed my default server name to lego-pc instead of blurr-ink.com and then made blurr-ink.com a virtual host, instead that way, the default server wouldn't handle everything and would only handle blurr-ink.com and make another virtual host ftp.blurr-ink.com and so on... and make a server alias for blurr-ink.com to be http://www.blurr-ink.com??? does all that make sense?? or would that just screw everything up???


----------



## Lego (Oct 9, 2009)

well it seems I've solved the first problem..... not sure how to fix the new problem! LOL, ok so, I unhashed the include httpd-vhosts.conf and deleted all remenants of virtual hosts from the httpd.conf, added this to the vhosts.conf:

```
<VirtualHost *:80>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data"
    ServerName blurr-ink.com
    ServerAlias www.blurr-ink.com
    ErrorLog "/var/log/blurr-ink.com-error_log"
    CustomLog "/var/log/blurr-ink..com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data/ftp"
    ServerName ftp.blurr-ink.com
    ErrorLog "/var/log/ftp.blurr-ink.com-error_log"
    CustomLog "/var/log/ftp.blurr-ink.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data/ssh"
    ServerName ssh.blurr-ink.com
    ErrorLog "/var/log/ssh.blurr-ink.com-error_log"
    CustomLog "/var/log/ssh.blurr-ink.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data/proxy"
    ServerName hide.blurr-ink.com
    ErrorLog "/var/log/proxy.blurr-ink.com-error_log"
    CustomLog "/var/log/proxy.blurr-ink.com-access_log" common
</VirtualHost>
```
(hide.blurr-ink.com:80 takes you to a page that says try https://hide.blurr-ink.com)

Each one works exactly as it should now... so weird... why would webmin let you put the vhosts in the httpd.conf if they won't work properly? or is it just me being daft?? so the second problem is....

I decided to try and unhash the include httpd-ssl.conf...
went into the file and configured it to this:


----------



## Lego (Oct 9, 2009)

```
#
# This is the Apache server configuration file providing SSL support.
# It contains the configuration directives to instruct the server how to
# serve pages over an https connection. For detailing information about these 
# directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
# 
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#

#
# Pseudo Random Number Generator (PRNG):
# Configure one or more sources to seed the PRNG of the SSL library.
# The seed data should be of good random quality.
# WARNING! On some platforms /dev/random blocks if not enough entropy
# is available. This means you then cannot use the /dev/random device
# because it would lead to very long connection times (as long as
# it requires to make more entropy available). But usually those
# platforms additionally provide a /dev/urandom device which doesn't
# block. So, if available, use this one instead. Read the mod_ssl User
# Manual for more details.
#
#SSLRandomSeed startup file:/dev/random  512
#SSLRandomSeed startup file:/dev/urandom 512
#SSLRandomSeed connect file:/dev/random  512
#SSLRandomSeed connect file:/dev/urandom 512


#
# When we also provide SSL we have to listen to the 
# standard HTTP port (see above) and to the HTTPS port
#
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
#       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
#
Listen 443

##
##  SSL Global Context
##
##  All SSL configuration in this context applies both to
##  the main server and all SSL-enabled virtual hosts.
##

#
#   Some MIME-types for downloading Certificates and CRLs
#
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is a internal
#   terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog  builtin

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism 
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache         "dbm:/var/run/ssl_scache"
SSLSessionCache        "shmcb:/var/run/ssl_scache(512000)"
SSLSessionCacheTimeout  300

#   Semaphore:
#   Configure the path to the mutual exclusion semaphore the
#   SSL engine uses internally for inter-process synchronization. 
SSLMutex  "file:/var/run/ssl_mutex"

##
## SSL Virtual Host Context
##

<VirtualHost *:443>

#   General setup for the virtual host
DocumentRoot /usr/local/www/data/hide
ServerName hide.blurr-ink.com:443
ServerAdmin admin@blurr-ink.com
ErrorLog "/var/log/httpd-error.log"
TransferLog "/var/log/httpd-access.log"

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   SSL Cipher Suite:
#   List the ciphers that the client is permitted to negotiate.
#   See the mod_ssl documentation for a complete list.
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

#   Server Certificate:
#   Point SSLCertificateFile at a PEM encoded certificate.  If
#   the certificate is encrypted, then you will be prompted for a
#   pass phrase.  Note that a kill -HUP will prompt again.  Keep
#   in mind that if you have both an RSA and a DSA certificate you
#   can configure both in parallel (to also allow the use of DSA
#   ciphers, etc.)
SSLCertificateFile "/etc/ssl/crt/blurr-ink-cert.pem"
#SSLCertificateFile "/usr/local/etc/apache22/server-dsa.crt"

#   Server Private Key:
#   If the key is not combined with the certificate, use this
#   directive to point at the key file.  Keep in mind that if
#   you've both a RSA and a DSA private key you can configure
#   both in parallel (to also allow the use of DSA ciphers, etc.)
SSLCertificateKeyFile "/etc/ssl/key/blurr-ink-key.pem"
#SSLCertificateKeyFile "/usr/local/etc/apache22/server-dsa.key"

#   Server Certificate Chain:
#   Point SSLCertificateChainFile at a file containing the
#   concatenation of PEM encoded CA certificates which form the
#   certificate chain for the server certificate. Alternatively
#   the referenced file can be the same as SSLCertificateFile
#   when the CA certificates are directly appended to the server
#   certificate for convinience.
#SSLCertificateChainFile "/usr/local/etc/apache22/server-ca.crt"

#   Certificate Authority (CA):
#   Set the CA certificate verification path where to find CA
#   certificates for client authentication or alternatively one
#   huge file containing all of them (file must be PEM encoded)
#   Note: Inside SSLCACertificatePath you need hash symlinks
#         to point to the certificate files. Use the provided
#         Makefile to update the hash symlinks after changes.
#SSLCACertificatePath "/usr/local/etc/apache22/ssl.crt"
#SSLCACertificateFile "/usr/local/etc/apache22/ssl.crt/ca-bundle.crt"

#   Certificate Revocation Lists (CRL):
#   Set the CA revocation path where to find CA CRLs for client
#   authentication or alternatively one huge file containing all
#   of them (file must be PEM encoded)
#   Note: Inside SSLCARevocationPath you need hash symlinks
#         to point to the certificate files. Use the provided
#         Makefile to update the hash symlinks after changes.
#SSLCARevocationPath "/usr/local/etc/apache22/ssl.crl"
#SSLCARevocationFile "/usr/local/etc/apache22/ssl.crl/ca-bundle.crl"

#   Client Authentication (Type):
#   Client certificate verification type and depth.  Types are
#   none, optional, require and optional_no_ca.  Depth is a
#   number which specifies how deeply to verify the certificate
#   issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth  10

#   Access Control:
#   With SSLRequire you can do per-directory access control based
#   on arbitrary complex boolean expressions containing server
#   variable checks and other lookup directives.  The syntax is a
#   mixture between C and Perl.  See the mod_ssl documentation
#   for more details.
#<Location />
#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
#            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
#            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
#            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
#            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#</Location>

#   SSL Engine Options:
#   Set various options for the SSL engine.
#   o FakeBasicAuth:
#     Translate the client X.509 into a Basic Authorisation.  This means that
#     the standard Auth/DBMAuth methods can be used for access control.  The
#     user name is the `one line' version of the client's X.509 certificate.
#     Note that no password is obtained from the user. Every entry in the user
#     file needs this password: `xxj31ZMTZzkVA'.
#   o ExportCertData:
#     This exports two additional environment variables: SSL_CLIENT_CERT and
```


----------



## Lego (Oct 9, 2009)

```
#     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
#     server (always existing) and the client (only existing when client
#     authentication is used). This can be used to import the certificates
#     into CGI scripts.
#   o StdEnvVars:
#     This exports the standard SSL/TLS related `SSL_*' environment variables.
#     Per default this exportation is switched off for performance reasons,
#     because the extraction step is an expensive operation and is usually
#     useless for serving static content. So one usually enables the
#     exportation for CGI and SSI requests only.
#   o StrictRequire:
#     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
#     under a "Satisfy any" situation, i.e. when it applies access is denied
#     and no other module can change it.
#   o OptRenegotiate:
#     This enables optimized SSL connection renegotiation handling when SSL
#     directives are used in per-directory context. 
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/usr/local/www/apache22/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>

#   SSL Protocol Adjustments:
#   The safe and default but still SSL/TLS standard compliant shutdown
#   approach is that mod_ssl sends the close notify alert but doesn't wait for
#   the close notify alert from client. When you need a different shutdown
#   approach you can use one of the following variables:
#   o ssl-unclean-shutdown:
#     This forces an unclean shutdown when the connection is closed, i.e. no
#     SSL close notify alert is send or allowed to received.  This violates
#     the SSL/TLS standard but is needed for some brain-dead browsers. Use
#     this when you receive I/O errors because of the standard approach where
#     mod_ssl sends the close notify alert.
#   o ssl-accurate-shutdown:
#     This forces an accurate shutdown when the connection is closed, i.e. a
#     SSL close notify alert is send and mod_ssl waits for the close notify
#     alert of the client. This is 100% SSL/TLS standard compliant, but in
#     practice often causes hanging connections with brain-dead browsers. Use
#     this only for browsers where you know that their SSL implementation
#     works correctly. 
#   Notice: Most problems of broken clients are also related to the HTTP
#   keep-alive facility, so you usually additionally want to disable
#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
#   "force-response-1.0" for this.
BrowserMatch ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

#   Per-Server Logging:
#   The home of a custom SSL log file. Use this when you want a
#   compact non-error SSL logfile on a virtual host basis.
CustomLog "/var/log/httpd-ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>
```

Basically setup exactly like the vhosts.... but https://hide.blurr-ink.com works but so does every other one... www, blank, ftp, ssh all take you to the glype page.... shouldn't only https://hide.blurr-ink.com work since its setup the same way the other vhosts are? or do i need to add or change something in vhosts.conf or ssl.conf???


----------



## Lego (Oct 9, 2009)

if i re-hash the include ssl.conf and just put this:

```
<VirtualHost *:443>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data/hide"
    ServerName hide.blurr-ink.com
    ErrorLog "/var/log/hide.blurr-ink.com-error_log"
    CustomLog "/var/log/hide.blurr-ink.com-access_log" common
    SSLEngine on
    SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
    SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem
</VirtualHost>
```

in the vhosts file, it works the exact same as if i just use the ssl.conf


----------



## anomie (Oct 9, 2009)

Lego said:
			
		

> Basically setup exactly like the vhosts.... but https://hide.blurr-ink.com works but so does every other one... www, blank, ftp, ssh all take you to the glype page.... shouldn't only https://hide.blurr-ink.com work since its setup the same way the other vhosts are? or do i need to add or change something in vhosts.conf or ssl.conf???



I may be a bit lost about what you're up to now, but if I am following you want namevirtualhost to work with SSL. Refer back to my post earlier in the thread. 

If you want different content for different https virtual hosts, you'll need a different IP for each.


----------



## Lego (Oct 9, 2009)

I don't want all https:// addresses to take to you the glype page, only https://hide.blurr-ink.com


----------



## anomie (Oct 9, 2009)

Well, what possible fixes would you deduce from this thread, then?  

hide.blurr-ink.com needs its own IP, right?


----------



## Lego (Oct 9, 2009)

:s hmm.... ok how do you mean? Like I need a second external IP or to create a virtual IP for it?? In my DNS Record hide is an A record with IP, so.... would I just add to the vhosts:

```
NameVirtualHost *:443

<VirtualHost *:443>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data/hide"
    ServerName hide.blurr-ink.com
    ErrorLog "/var/log/hide.blurr-ink.com-error_log"
    CustomLog "/var/log/hide.blurr-ink.com-access_log" common
    SSLEngine on
    SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
    SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem
</VirtualHost>
```

or 


```
NameVirtualHost hide.blurr-ink.com:443

<VirtualHost hide.blurr-ink.com:443>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data/hide"
    ServerName hide.blurr-ink.com
    ErrorLog "/var/log/hide.blurr-ink.com-error_log"
    CustomLog "/var/log/hide.blurr-ink.com-access_log" common
    SSLEngine on
    SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
    SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem
</VirtualHost>
```

Im just slightly confused because I can't just pull an ip outta thin air and pop it in there can i? like...

```
NameVirtualHost 192.168.5.555:443

<VirtualHost 192.168.5.555:443>
    ServerAdmin admin@blurr-ink.com
    DocumentRoot "/usr/local/www/data/hide"
    ServerName hide.blurr-ink.com
    ErrorLog "/var/log/hide.blurr-ink.com-error_log"
    CustomLog "/var/log/hide.blurr-ink.com-access_log" common
    SSLEngine on
    SSLCertificateFile /etc/ssl/crt/blurr-ink-cert.pem
    SSLCertificateKeyFile /etc/ssl/key/blurr-ink-key.pem
</VirtualHost>
```


----------



## anomie (Oct 9, 2009)

Earlier in the thread you were tinkering with DNS recs, so I thought you had a pool of IPs to work with. 

The short and skinny is this: SSL (by design) hides packet payloads, so all Apache web server can see is the IP address the client requested. Thus, you _can not use namevirtualhost_. Make sense? 

If you have only one IP address to work with, then all hostnames that resolve to that IP address will take clients to the same https location. If you have more than one IP, you can set up namevirtualhosts for http connections, and an IP-based virtual host for the https connections. 

I hope this is more clear now.


----------



## Lego (Oct 9, 2009)

yea that makes sense, .... so wait how would I do it if my ISP provided 2 ips?? my main line comes in and goes to my router, my router then distributes internal ips... 1 being to the server....then I forwarded all the ports i need to that ip... 

would i need to connect the main line directly to the server??


----------



## anomie (Oct 9, 2009)

So from your last comment, I take it you're sitting behind a home router/NAT device? (That changes things, and it explains why you needed to use a wildcard for namevirtualhosts on port 80.) 

I'm not sure what to suggest. NAT screws things up, because by the time your host gets the requests, it thinks they're all coming from the internal IP of your router/NAT device. Maybe two different Apache instances, one listening on port 80 and the other listening on port 443..?

---

edit: Nevermind. Two Apache instances won't solve your problem, because all hostnames will still resolve to _your.ip.here_, so you'll get the same content for each hostname over https.


----------



## Lego (Oct 10, 2009)

Yes, Im behind a Router, a DIR-655, yes I have Listen *:443 and Listen *:80 in my httpd.conf, I don't believe I have NAT enabled....and come to think of it... I don't think I've even seen NAT settings in this router... My old router had NAT settings I believe


----------

