On my site I want all of the content to be www.sitename.com/pagenames, except I would like *just* the blog to be blog.sitename.com/pagenames. I presume using the multi-site capabilities of Drupal is the way to do this, yet I have been unable to get it to work. So before I waste more time trying to get the multi-site setup to work, my questions are, is the specific setup I am trying to create possible with multi-site, and/or is there another/better way to accomplish what I want?

If anything above is unclear, please let me know.

Thanks in advance!

Comments

GSMKer_Kevin’s picture

The setup you want is possible with multi-site. It will just be a matter of how to configure Drupal to get the results you want? If I understand you correctly you want the blog to be accessed by blog.sitename.com/pagenames but eveything else working as normal?

The way I see it you'll need to setup a sub-domain on your system. So blog.sitename.com will work. Then you can configure Drupal for multi-site and have the second site use the same database. Now you have a site that can be accessed via www.sitename.com/pagenames or blog.sitename.com/pagenames. Once you have that working I'm sure Drupal could be configured to restrict access to blog only by the "blog" url. If that is what you want?

You could also use a separate database or "prefix" for second site This would solve url problem but then you would have to deal with separate accounts. I'm assuming you want same user accounts?

I dont anything about your hosting situation so I wont get into the multi-site thing. However I do know how to setup multi-sites. I have setup Drupal for multi-sites using full TLD, sub-domains and sub directories.

Get back with me on your hosting situation and I'll be glad to help!

The only barriers that exist are the ones we create!
Kevin

mb2’s picture

If I understand you correctly you want the blog to be accessed by blog.sitename.com/pagenames but eveything else working as normal?

The way I see it you'll need to setup a sub-domain on your system. So blog.sitename.com will work. Then you can configure Drupal for multi-site and have the second site use the same database. Now you have a site that can be accessed via www.sitename.com/pagenames or blog.sitename.com/pagenames. Once you have that working I'm sure Drupal could be configured to restrict access to blog only by the "blog" url. If that is what you want?

I'm assuming you want same user accounts?

Yes all of that is correct.

I'm not sure what you specifically need to know about my hosting situation, but I'm using a commercial host that uses DirectAdmin, which I have used to create sub-domains.

Currently I have Drupal installed in test3.proamsportslinks.com, and for testing purposes I want to have the the blog show up in blogtest.proamsportslinks.com. Eventually, when I am done playing with Drupal, I will replace the the current static html pages with the Drupal site, so Drupal will be in the root, www.proamsportslinks.com, and I would like the blog to be blog.proamsportslinks.com. I followed the instructions in the install.txt, yet I'm not sure if i did it correctly (I'm guessing no since its not working). In the 'sites' folder i copied the 'default' directory, renamed it blogtest.proamsportslinks.com. I changed the base url in the settings.php file (not sure if I was supposed too) to blogtest.proamsportslinks.com for that directory. When I go to blogtest.proamsportslinks.com, I get:

Forbidden
You don't have permission to access / on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

--------------------------------------------------------------------------------

Apache/1.3.34 Server at blogtest.proamsportslinks.com Port 80

So I guess what is the next step? I presume I am supposed to do further configuration, but I haven't been able to make sense out of what has been discussed in the forums and manuals.

Thanks,
Mark

GSMKer_Kevin’s picture

Sorry for the delay in posting, I've been extremely busy last few days.

You use "Direct Admin", very wise choice! It sounds like you need to cteate the sym link so your request for blogtest.proamsportslinks.com can be processed by Drupal. Have you done that? If not you can do so in "Direct Admin" by editing the "httpd config" for your subdomain. Login into "Direct Admin" and look for "httpd config" then select your subdomain. I believe it's on the "Admin page" at the bottom?

You want to edit the "Root Document" so it points to your Drupal install directory. So you would enter in something like the following:

|?DOCROOT=/home/admin/domains/test3.proamsportslinks.com/public_html|

If eveything else is setup right that should get your blog subdomain working. Don't forget the "pipe" characters.

Hope that was helpful? I always try to provide quality post!

The only barriers that exist are the ones we create!
Kevin

mb2’s picture

No, I have not set up the the sym link. I tried to attempt your solution but I don't have access to the Admin Panel since I am just a "user". I asked in my web host's forum if and how any of the others set Drupal up in a multi-site format. However, is there another way to set up the sym link?

Thanks,
-Mark

GSMKer_Kevin’s picture

Sorry for delay in posting!

I believe the following should work for you although I haven't had time to test it.

1) Create a simple php file with the symlink command in it.
symlink(target, link);
Where target is the complete path to your Drupal install directory and link is the name of your subdomain directory.

2) So if you have a blog.domainname.com sub domain then delete the blog directory and replace it with the sym link. Just ftp the file up and execute it.

You'll need to get your paths correct. The basic idea is replace your sub-domain directory with an symlink named exactly the same as your sub-domain directory. The link should be created in the same directory the sub-domain resided in. Then request for blog.domainname.com will be processd by Drupal.

Let me know how it goes?

The only barriers that exist are the ones we create!
Kevin

mb2’s picture

I think I understand the concept clearly, but I'm not quite sure of the details due to my significant lack of php knowledge.

I created the following as "symlink.php":


symlink("/home/user/domains/proamsportslinks.com/public_html/test3/sites/blogtest.proamsportslinks.com", "/blogtest");

So my questions are:
1. Is the target correct or should it just go as deep the 'test3' folder, which is the directory Drupal is installed in?

2. Is the link part of the symlink correct?

3. Should the symlink.php be located at the root level, in the Drupal install directory, or does it even matter? Currently I have it at the root level.

4. Finally (to prove my php ignorance), how exactly am I supposed to "execute" this file? I searched a bit trying to educate myself and I saw stuff from opening it in a browser to perl, so I wasn't exactly sure as to what I should be doing.

-Mark

GSMKer_Kevin’s picture

1) target should go as deep as 'test3'
2) yes, however see below
3) I think for you the root level is good so you can run it from your browser. However you'll need to provide the full path to where the symlink should be created. The symlink should be created in the same directory that your blogtest folder resides. For example if your blogtest directory is in proamsportslinks.com then you would adjust the link part to "/home/user/domains/proamsportslinks.com/blogtest"

- So adjust your symlink.php file
- delete your blogtest directory
- ftp up the symlink.php file to your root directory
- type in your domainname.com/symlink.php into your browser

If the symlink file was created correctly and you have eveything else setup then blogtest.domain-name.com should pull up Drupal.

Let me know how it goes?

The only barriers that exist are the ones we create!
Kevin

mb2’s picture

I changed the symlink file to:


symlink("/home/usatec00/domains/proamsportslinks.com/public_html/test3", 

"/home/usatec00/domains/proamsportslinks.com/public_html/blogtest");

and I deleted the blogtest folder.

I opened symlink.php in my browser and I got the following:

Warning: symlink(): Permission denied in /home/usatec00/domains/proamsportslinks.com/public_html/symlink.php on line 3

I went to the blogtest page where the site should show up, and I got a 404 error.

GSMKer_Kevin’s picture

Ok, I ran a quick test and had a test sub-domain pointing to Drupal in no time.

1) Adjust your symlink.php file like so

symlink( "./", "blogtest");

You can simplify the "target" and "link name" because your sub-domains are created in public_html.

2) upload the symlink.php file to public_html (root)

3) From your files manager screen click on "../ Up a Level" so you're one directory above public_html. You should be able to see this directory?

4) Locating the "public_html" directory in your list, look to the right and check the little box!

5) Scroll down and look for the "Set Permission" button right below the list of files. It will have a field next to it with 755 in it. Change that number to 777 and click the "Set Permission" button.

6) now in your browser type in www.domain-name.com/symlink.php

Now your sub-domain should pull up Drupal?

7) This is very important!!! Back in your file manager locate "Public_html" again and check the box to the right. change the 777 back to 755 and click the "Set Permissions" button. You don't want to leave public_html set to 777, this would be bad!

Everything should be working and you should be able to see a symlink folder in your public_html directory? It will have a red arrow on the folder.

Also you can delete the symlink.php file after everything is working!

Let me know how it goes?

The only barriers that exist are the ones we create!
Kevin

mb2’s picture

I tried that and I got the same permission warning, and began cursing up a storm.

Then when I stared at the DirectAdmin screen again, I looked at the public html and noticed that the permission was still the same. I looked down another row and realized I had changed the private html permissions. So with a new lease on life, I fixed the permissions. I ran the script, I was never so happy to see a white blank screen. So for the moment of truth, I typed in the blogtest subdomain, and it brought up my current static page that it is still in the root!

But I'll take that as a victory and assume that when I move drupal to the root, that it will work. If I left the target and link as they were before though, I assume the correct folders would show up?

The symlink folder appears as you said it would, too.

Thank you very much for taking the time to help me out. Hopefully the configuration process will go smoothly from here on out.

Again, thanks a lot.
-Mark

GSMKer_Kevin’s picture

No problem, and yes if you had drupal installed in the same directory your symlink is pointing to it will pull up Drupal. Then if you have a folder for that sub-domain in your Drupal sites folder with a settings file configured correctly, bam, you'll have a new Drupal site or a sub-domain pointing to your current Drupal domain depending on if you create a new Database.

Take care, and have fun Drupaling!

The only barriers that exist are the ones we create!
Kevin