Koozali.org: home of the SME Server

Subdomains

Offline jncs

  • **
  • 31
  • +0/-0
Subdomains
« on: October 31, 2007, 12:26:09 AM »
Hi there!

I've installed phpBB 2.0.22 for SME 7.x (http://wiki.contribs.org/PhpBB)

To access my forum users must type http://www.mydomain.com/forum.

I want to create a subdomain like this: http://forum.mydomain.com

How can I do this without create an I-Bay?

Thanks to all!
Jorge Silva

Offline waton

  • *
  • 14
  • +0/-0
    • http://www.opensynergy.org
Re: Subdomains
« Reply #1 on: October 31, 2007, 04:39:46 AM »
1.Add host on dns
Code: [Select]
db hosts set forum.mydomain.com host HostType SubDomain InternalIp 192.168.0.250
signal-event host-create

2. Add NameVirtualHost on httpd.conf
Code: [Select]
<VirtualHost 0.0.0.0:80>
ServerName forum.mydomain.com
DocumentRoot /home/forum/html
....
</VirtualHost>

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Subdomains
« Reply #2 on: October 31, 2007, 06:41:25 AM »
1.Add host on dns
Code: [Select]
db hosts set forum.mydomain.com host HostType SubDomain InternalIp 192.168.0.250
signal-event host-create

2. Add NameVirtualHost on httpd.conf
Code: [Select]
<VirtualHost 0.0.0.0:80>
ServerName forum.mydomain.com
DocumentRoot /home/forum/html
....
</VirtualHost>

Are you read it this sticked post? http://forums.contribs.org/index.php?topic=38573.msg174916#msg174916
Quote
Things that are generally bad to do:
"Don't do things from the command line that you can do from the server manager"

Why to use command line, if you can do the same (and errors free) in the server-manager?
« Last Edit: October 31, 2007, 06:44:43 AM by Normando »

Offline waton

  • *
  • 14
  • +0/-0
    • http://www.opensynergy.org
Re: Subdomains
« Reply #3 on: October 31, 2007, 07:18:03 AM »
Why to use command line, if you can do the same (and errors free) in the server-manager?

IMHO, we can't do that from server-manager

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Subdomains
« Reply #4 on: October 31, 2007, 07:55:46 AM »
IMHO, we can't do that from server-manager

In server-manager, under Configuration --> Hostnames and addresses:
Click *Add hostname* button.
In *hostname* field enter "forum"
In *Domain* select you domain (mydomain.com)
If you want, add a comment, and click *Next* button. Then click *Add* button.

Of course, you must add the "forum" hostname in your DNS provider if not support * hostnames.
Then in your site aplication (phpBB), configure URL to forum.mydomain.com
« Last Edit: October 31, 2007, 08:14:01 AM by Normando »

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Subdomains
« Reply #5 on: October 31, 2007, 08:00:33 AM »
2. Add NameVirtualHost on httpd.conf

And please, read the documentation before post. SME use a complex template system. Each time you configure or update your server, you lost the changes in httpd.conf

You can read and learn with this usesful docs:

http://wiki.contribs.org/SME_Server:Documentation
http://wiki.contribs.org/SME_Server:Documentation:FAQ
http://wiki.contribs.org/DB_Variables_Configuration
http://mirror.contribs.org/smeserver/contribs/gordonr/devguide/html/devguide.html
http://wiki.contribs.org/Useful_Commands
« Last Edit: October 31, 2007, 08:06:04 AM by Normando »

Offline jncs

  • **
  • 31
  • +0/-0
Re: Subdomains
« Reply #6 on: October 31, 2007, 10:43:37 AM »
In server-manager, under Configuration --> Hostnames and addresses:
Click *Add hostname* button.
In *hostname* field enter "forum"
In *Domain* select you domain (mydomain.com)
If you want, add a comment, and click *Next* button. Then click *Add* button.

Of course, you must add the "forum" hostname in your DNS provider if not support * hostnames.
Then in your site application (phpBB), configure URL to forum.mydomain.com

Thanks to all!

The approach above doesn't work... because forum.mydomain.com is being redirect to /home/e-smith/files/ibays/Primary/html!
The forum I mention is phpBB2 that is in contribs.
I followup the installation guide and this application is installed at /opt/phpBB2.

I tried to change the template to this application but I wasn't successfully! I also had configure URL to forum.mydomain.com in phpBB admin application!
This is because the template that generate the subdomains section on httpd.conf is programed and is not a text-based template.

Any other suggestions?
Jorge Silva

Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Re: Subdomains
« Reply #7 on: October 31, 2007, 12:34:09 PM »
http://wiki.contribs.org/Generic_WebApp_rpm#Webserver_templates

you have the first type of fragment,
to get what you want you need to add the second and third
when you have it working, ask the maintainer to add them to the rpm