JeremyV
11-25-2002, 07:27 PM
Ok, I thought I had it all figured out, but it for some reason isn't working quite right. So here is what I've done. I wanted a subdomain called "secure" for my new SSL I will be using. So, I created the subdomain, and now have secure.domain.com.
Great, it worked just fine as a standard subdomain. So then I update the DNS zone, and add an A entry for the new secure subdomain. So, just to verify.. I ping my secure subdomain, yep.. its picking up the correct IP now. So I even tried pointing my browser to my secure subdomain, and I get the default apache screen saying apache is installed correctly.
Cool. Well.. it is cool, but now I don't know where the files are located for this subdomain. I tried entering them into the /secure folder that was created in my public_html directory.. but nope, that doesn't work. Looked in my /home directory for signs of a subdomain, but don't see anything there either.
Since this is the first subdomain i've had to make with a seperate IP, I am probably just missing something small, but unsure of what it might be. If anyone can point me in the right direction that would be great. Thanks!
mind21_98
11-25-2002, 07:31 PM
Try using https://secure.domain.com/~user/secure/. That should work properly. :)
JeremyV
11-25-2002, 07:38 PM
You are correct, that did work. :agree:
But, one last question. What file do I have to edit to allow just secure.domain.com/ still point to the /~user/secure directory so that users won't see the other junk?
mind21_98
11-25-2002, 07:55 PM
You'll need to edit the DocumentRoot directive in httpd.conf for that domain. Then you'll be set. :)
JeremyV
11-25-2002, 08:28 PM
Ok, sorry as this is slightly new to me, but I found that section:
# 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/apache/htdocs
It is my understanding that you can only have one DocumentRoot directive defined in the config, but you are allowed to use an Alias directive. So how does that work in this situation? I know the syntax for an alias.. but not sure how to incorporate it into this without messing anything up. Excuse my newbieness ;)
mind21_98
11-25-2002, 08:40 PM
In CPanel, each virtual host has its own DocumentRoot directive. For example:
<VirtualHost 209.151.84.103:443>
ServerAdmin webmaster@translator.cx
DocumentRoot /home/translat/public_html
BytesLog domlogs/translator.cx-bytes_log
ServerName www.translator.cx
CustomLog domlogs/translator.cx combined
ScriptAlias /cgi-bin/ /home/translat/public_html/cgi-bin/
SSLEngine On
SSLCertificateChainFile /root/fdpCA/cacert.pem
SSLCertificateFile /root/fdpCA/newcert.pem
SSLCertificateKeyFile /root/fdpCA/key.pem
</VirtualHost>
There should be something similar for the secure.domain.com you added. Just change it there. The one you found near the top of the httpd.conf file applies only if Apache can't find any <VirtualHost> blocks that match the site the user is trying to access. :)
StevenG
11-25-2002, 08:53 PM
If you just used your main accounts IP address (If it has a unique IP), don't add a subdomain using cpanel and install the cert on the main accounts IP as secure.domain.com - You would be able to view all pages on your domain via https://secure.domain.com
No need to add a subdomain at all for that - Just * A IP in dns zone is required. :)
the virtual host container is auto added to httpd.conf for the ssl directives too.
JeremyV
11-25-2002, 08:57 PM
Thanks, after scrolling down further I found what I was supposed to be looking for.. not the MAIN documentroot, but just the one for my new subdomain. And I did not know that about the no subdomain thing, I will have a look at that method as well. Thanks guys :)
JeremyV
11-25-2002, 09:18 PM
Oops.. I guess I need more coffee. As I had assumed, I did everything right. Except I double checked and noticed I had duplicate A Entries, one pointing to the new, one to the old. And that was why I wasn't getting to the correct folders.
So I simply removed the one A entry and all works as it should. :agree: