jlandes
02-20-2007, 05:08 PM
Hello,
I have a plan mapped out for setting up a shared server certificate on my DirectAdmin server for Apache use. Right now it's going to be a self-signed certificate until I purchase an SSL cert from an authorized root certificate authority. I wanted to run my plan by the more experienced DirectAdmin people out there to see what they thought.
I do not want to use the server's host name (da01.landeserve.com) for the shared certificate, since I do not want users connecting directly to da01.landeserve.com. I want to use secure.landeserve.com for my users to use the shared certificate without having to create a domain or a subdomain within DirectAdmin. Will what I have outlined here work and does anyone see any problems with what I'm about to do?
Login to the server using SSH and switch to the root user.
Generate the certificate files by executing:
# openssl req -new -x509 -keyout /etc/httpd/conf/ssl.key/server.key.tmp -out /etc/httpd/conf/ssl.crt/server.crt -days 3653
# openssl rsa -in /etc/httpd/conf/ssl.key/server.key.tmp -out /etc/httpd/conf/ssl.key/server.key
# rm -f /etc/httpd/conf/ssl.key/server.key.tmp
# chown root:root /etc/httpd/conf/ssl.key/server.key
# chmod 400 /etc/httpd/conf/ssl.key/server.key
In steps #1 and #2 above, I will input secure.landeserve.com as the server name or domain name when asked.
Login to DirectAdmin as the admin user and do the following:
Switch to the Admin Level panel.
Click DNS Administration.
Select the landeserve.com domain.
Add an A record titled secure that points to the server's main IP.
Now, this is the part I'm not 100% sure about. Add the following lines into the server's HTTPD configuration file using the Admin File Editor:
<VirtualHost 72.232.200.170:80>
ServerAdmin admin@landeserve.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName secure.landeserve.com
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>
<VirtualHost 72.232.200.170:443>
ServerName secure.landeserve.com
ServerAdmin admin@landeserve.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>
Am I missing anything? Is adding the virtualhost section into the HTTPD configuration necessary? Any suggestions for changes before I do this? :)
Thanks for your time.
I have a plan mapped out for setting up a shared server certificate on my DirectAdmin server for Apache use. Right now it's going to be a self-signed certificate until I purchase an SSL cert from an authorized root certificate authority. I wanted to run my plan by the more experienced DirectAdmin people out there to see what they thought.
I do not want to use the server's host name (da01.landeserve.com) for the shared certificate, since I do not want users connecting directly to da01.landeserve.com. I want to use secure.landeserve.com for my users to use the shared certificate without having to create a domain or a subdomain within DirectAdmin. Will what I have outlined here work and does anyone see any problems with what I'm about to do?
Login to the server using SSH and switch to the root user.
Generate the certificate files by executing:
# openssl req -new -x509 -keyout /etc/httpd/conf/ssl.key/server.key.tmp -out /etc/httpd/conf/ssl.crt/server.crt -days 3653
# openssl rsa -in /etc/httpd/conf/ssl.key/server.key.tmp -out /etc/httpd/conf/ssl.key/server.key
# rm -f /etc/httpd/conf/ssl.key/server.key.tmp
# chown root:root /etc/httpd/conf/ssl.key/server.key
# chmod 400 /etc/httpd/conf/ssl.key/server.key
In steps #1 and #2 above, I will input secure.landeserve.com as the server name or domain name when asked.
Login to DirectAdmin as the admin user and do the following:
Switch to the Admin Level panel.
Click DNS Administration.
Select the landeserve.com domain.
Add an A record titled secure that points to the server's main IP.
Now, this is the part I'm not 100% sure about. Add the following lines into the server's HTTPD configuration file using the Admin File Editor:
<VirtualHost 72.232.200.170:80>
ServerAdmin admin@landeserve.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ServerName secure.landeserve.com
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>
<VirtualHost 72.232.200.170:443>
ServerName secure.landeserve.com
ServerAdmin admin@landeserve.com
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
DocumentRoot /var/www/html
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>
Am I missing anything? Is adding the virtualhost section into the HTTPD configuration necessary? Any suggestions for changes before I do this? :)
Thanks for your time.