Need help getting SMF to run on subdomain

Started by altiris, September 06, 2014, 10:15:34 PM

Previous topic - Next topic

altiris

I have successfully gotten SMF running and working on my primary domain which I will call mydomain. So basically currently I do "http://mydomain.com/forum [nofollow]" and I will be brought to SMF. I am trying to make it so that when I type "http://forum.mydomain.com [nofollow]" (forum.mydomain is the subdomain) I will get to brought to SMF. I have already added the subdomain onto my DNS as well as GoDaddy so that part is solved. I have also changed the SMF paths to the appropriate ones using the repair_settings.php. Instead of being brought to SMF however, I am brought to the same home page that I get when I enter "http://mydomain.com [nofollow]". I have posted my apache config below incase I made an error or two, maybe you guys can see it?


NameVirtualHost *:80
#                                                                            VIRTUAL HOSTS FOR PRIMARY DOMAIN
#
<VirtualHost *:80>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}:443%{REQUEST_URI}
ServerName www.mydomain.com:80
DocumentRoot /var/www/mydomain.com
ServerAdmin [email protected]
ErrorLog logs/mydomain.com-error_log
CustomLog logs/mydomain.com-access_log common
</VirtualHost>
#
NameVirtualHost *:443
#
<VirtualHost *:443>
ServerName www.domain.com:443
ServerAdmin [email protected]
DocumentRoot /var/www/mydomain.com
# RewriteEngine on
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}:443%{REQUEST_URI}
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory /var/www/mydomain.com>
AllowOverride All
</Directory>
ErrorLog logs/mydomain.com-error_log
CustomLog logs/mydomain.com-access_log common
</VirtualHost>
#                                                                                   END OF    VIRTUAL HOSTS FOR PRIMARY DOMAIN
#
#
#                                                                                    VIRTUAL HOST FOR SUBDOMAIN
<VirtualHost *:80>
ServerName www.forum.mydomain.com:80
DocumentRoot /var/www/forum.mydomain.com
ServerAdmin [email protected]
ErrorLog logs/mydomain.com-error_log
CustomLog logs/mydomain.com-access_log common
</VirtualHost>
#
#
<VirtualHost *:443>
ServerName www.forum.mydomain.com:443
DocumentRoot /var/www/forum.mydomain.com
ErrorLog logs/mydomain.com-error_log
CustomLog logs/forum.domain.com-access_log common
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory /var/www/forum/mydomain.com>
AllowOverride All
</Directory>
</VirtualHost>
#
#                                                                                       END OF VIRTUALHOST FOR SUBDOMAIN




Mstcool

This does get tricky sometimes. After you created your subdomain, did it create a directory in your file manager?

jonesH

It might also help to first make absolutely sure your subdomain setup is correct and works as expected (without SMF). One way to do that is to put in it a simple, Hello World kind of HTML file and navigating to it. If this part fails, the GoDaddy tech support usually provide good help in setting up your subdomain (they did for me, anyway). Hope this helps.

altiris

#3
Quote from: Mstcool on September 06, 2014, 10:33:05 PM
This does get tricky sometimes. After you created your subdomain, did it create a directory in your file manager?
I should note that I am running everything on CentOS linux. I created the sub domain, no directory was created for me. I created the directory /var/www/forum.mydomain.com myself if that is what you are referring to? I am a bit confused, sorry.
Quote from: jonesH on September 06, 2014, 10:52:26 PM
It might also help to first make absolutely sure your subdomain setup is correct and works as expected (without SMF). One way to do that is to put in it a simple, Hello World kind of HTML file and navigating to it. If this part fails, the GoDaddy tech support usually provide good help in setting up your subdomain (they did for me, anyway). Hope this helps.
I think we are getting somewhere...I don't think I know what a subdomain actually is. What I did on Godaddy was use my exisitng domain name, which is mydomain.com [nofollow] and in the DNS Zone files, added an A record and put forum and then my IP address for the A record. This comes out to be forum.mydomain.com [nofollow] ....that is a subdomain right? Something interesting is that if I uncomment the section in the apache config I posted for the subdomain, and I type "forum.mydomain.com" I am brought to the main home page that I get for "mydomain.com" so it seems regardless of the apache configuration the site still works and is going to mydomain.com [nofollow] configuration. I tried putting a file called index.html in the document root for forum.mydomain.com [nofollow] but it says that it can not be found.

Should I maybe copy this information and go to a CentOS/Apache specific forum or does this still go with SMF?

Mstcool

By directory, usually when you would create a sub domain (forum.mydomain.com , as an example) it would create a directory called "forum". Even though I knew you have one created already, I was wondering if it made another one with a different name - although I already doubted it. When I create a subdomain, I don't change my domain records, its unnecessary. Just change those back and just delete the subdomain and create it again and leave it. It should automatically configure it for you and direct it to the forum. I believe thats what I did.

Kindred

Most hosts , when the subdomain is created will add the directory above the root www directory, not under the www directory...    Some hosts do, but that is a bad design and poor practice.

In other words, www is a subdomain itself, so other subdomains should not be in subdirtdtories of the main www directory.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

jonesH

Also, keep in mind that changes such as subdomain creations can take up to a day before they take effect. That's why I expedite and foolproof the process by calling up the host support.

altiris

Quote from: Mstcool on September 06, 2014, 11:17:23 PM
By directory, usually when you would create a sub domain (forum.mydomain.com , as an example) it would create a directory called "forum". Even though I knew you have one created already, I was wondering if it made another one with a different name - although I already doubted it. When I create a subdomain, I don't change my domain records, its unnecessary. Just change those back and just delete the subdomain and create it again and leave it. It should automatically configure it for you and direct it to the forum. I believe thats what I did.
I am not sure we are on the same page. I don't see how creating a subdomain would make a directory be formed. I made the subdomain by adding a record entry in my BIND DNS configuration. I did not make another one, it never made on in the first place though. I am really confused lol sorry. I am not doing anything within SMF to "create" a subdomain.
Quote from: Kindred on September 06, 2014, 11:44:30 PM
Most hosts , when the subdomain is created will add the directory above the root www directory, not under the www directory...    Some hosts do, but that is a bad design and poor practice.
In other words, www is a subdomain itself, so other subdomains should not be in subdirtdtories of the main www directory.
I am not renting or anything, I am hosting everything myself down to the computer itself. So www is a subdomain already...so I should just have it /var/forum.mydomain.com instead?
Quote from: jonesH on September 07, 2014, 12:08:30 AM
Also, keep in mind that changes such as subdomain creations can take up to a day before they take effect. That's why I expedite and foolproof the process by calling up the host support.
Yeah I have heard that but before I created the A record for forum.mydomain.com [nofollow] on GoDaddy (I already made it on the server's own DNS server) I tested it out to see if it would work and it didnt, I then added it on GoDaddy this morning and now I can access it so I should be good right?

jonesH

If your test page (index.html you made) is properly served from the subdomain, then yes, that part is resolved. Forgot in previous post to add that sometimes the browser cache can play tricks when refreshing the page, so remember to always start with an empty cache.

Mstcool

Now I am confused

Godaddy is ur host, right? There should be a sub domain button, which if used, makes a directory , if one doesn't exist. :P

Kindred

And you also said that you tried to change yourdomain/forum into a subdomain by reappointing the subdomains marker for forum.yourdomain   Which means that you don't have the setup correct, by most standards.


Is your main domain at /var/www?
If so, then your subdomain should be at /var/forum
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

altiris

Quote from: jonesH on September 07, 2014, 12:30:30 AM
If your test page (index.html you made) is properly served from the subdomain, then yes, that part is resolved. Forgot in previous post to add that sometimes the browser cache can play tricks when refreshing the page, so remember to always start with an empty cache.
Sadly I can not access my test index.html, even with clearing everything on Firefox.
Quote from: Mstcool on September 07, 2014, 01:41:47 AM
Now I am confused

Godaddy is ur host, right? There should be a sub domain button, which if used, makes a directory , if one doesn't exist. :P
I apologize, GoDaddy is my host yes but only for the domain name and nothing else. I understand what I did wrong now, I have discovered the "subdomain" option on Godaddy and have added the "forum" as the subdomain and then added "forum.mydomain.com" to the "forward to" option, that seems correct.
Quote from: Kindred on September 07, 2014, 08:09:14 AM
And you also said that you tried to change yourdomain/forum into a subdomain by reappointing the subdomains marker for forum.yourdomain   Which means that you don't have the setup correct, by most standards.


Is your main domain at /var/www?
If so, then your subdomain should be at /var/forum
Yes I tried that and yeah what I did was incorrect then. The document root for the primary domain is in fact at /var/www/mydomain.com so then I should have the document root for the forum subdomain at /var/forum    I will try this but I will need to wait a while for the DNS to update I think.

Advertisement: