Jump to content

Subdomain Drupal

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
12 replies to this topic

#1
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Hi, i want to create a subdomain drupal from myweb.com/forum to be forum.myweb.com
Any body can tell me how ?
Thanks

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
All depends on your web host how that is done. do your web host has a control panel of any kind to change the settings? then you might find a "Subdomains" part there.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
No CPanel there :)
I am using dedicated server, i am newbie to using dedicated server :)
Any ideas ?

Thanks

#4
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
first of all, the subdomain needs to be added in the dns system.

if you're using apache, you need to modify your httpd.conf to enable that subdomain aswell. (other web servers has their configuration instead)
This is not very easy, but not very difficult either. I'd actually suggest that you get to know your server alot more, you would need documentation from the host on what is installed and where the setting files are for this.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#5
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You could also install a free tool such as webmin. After installed, you access it via the 10,000 port IE: http://Your_Address:10000

Click Servers at the top / Apache Webserver
You should see a list of all your domains. Scroll to the bottom and you can add new domains and subdomains with a predefined path.

#6
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
I didn't get full access, just SSH , FTP, MySQL .
Any ideas ?

#7
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
Talk with the hosts and ask them to give you a control panel of the web services or similar, that should be included at least in any kind of web space, or dedicated server...
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#8
xsonline

xsonline

    Learning Programmer

  • Members
  • PipPipPip
  • 48 posts
If your server uses apache, and you are capable to edit the directives (by example using webmin), you can edit the file "/etc/apache2/sites-available/yourdomain.tld.conf" it should look something like this :
<VirtualHost yourip:80>
ServerName xsonline.be
DocumentRoot /home/yourdomain.tld/public_html

..

DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/yourdomain.tld/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/yourdomain.tld/cgi-bin>
allow from all
</Directory>
</VirtualHost>


Try adding the lines:
ServerAlias subdomain.yourdomain.tld
ServerAlias *.subdomain.yourdomain.tld

so it looks something like this:
<VirtualHost yourip:80>
ServerName xsonline.be
DocumentRoot /home/yourdomain.tld/public_html

ServerAlias subdomain.yourdomain.tld
ServerAlias *.subdomain.yourdomain.tld

..

DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/yourdomain.tld/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/yourdomain.tld/cgi-bin>
allow from all
</Directory>
</VirtualHost>


#9
cakka

cakka

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Thanks XSOnline, can i put the code on the .htaccess ?
Because owner of this server is my project manager. And i just getting the access to FTP , SSH and PHPMyAdmin.

#10
xsonline

xsonline

    Learning Programmer

  • Members
  • PipPipPip
  • 48 posts
oh no, this is something you should put in your apache configuration files. It wouldn't work using .htaccess, as this only applies to the settings of that directory. not to creating a new directory.

Also, this is not the exact solution of your problem, I guess (it was a lilttle late yesterday).

You should create a new virtual server with that ip, using the forum.yourdomain.tld as your servername, and your directory containing the forum as main directory.

Sorry about that.

#11
xsonline

xsonline

    Learning Programmer

  • Members
  • PipPipPip
  • 48 posts
the correct solution would be to add somthing like this:

<VirtualHost yourip:80>
ServerName forum.yourdomain.tld
DocumentRoot /home/yourdomain.tld/public_html/forum

ServerAlias *.forum.yourdomain.tld


DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/yourdomain.tld/public_html/forum>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/yourdomain.tld/cgi-bin>
allow from all
</Directory>
</VirtualHost>

sorry guys my bad!

#12
xsonline

xsonline

    Learning Programmer

  • Members
  • PipPipPip
  • 48 posts

cakka said:

Thanks XSOnline, can i put the code on the .htaccess ?
Because owner of this server is my project manager. And i just getting the access to FTP , SSH and PHPMyAdmin.

Don't you have a control panel at hand, something like CPanel, Webmin, DirectAdmin, Plesk, VHCS, ISPconfig,... ?

The solution I gave would be appliable to all servers using apache2. But if I knew the controlpanel, I could give you a specific (graphical) solution.