I am still having a problem getting my head around the multi-site setup. I have searched through the forum and I am still having trouble. I have drupal installed directly in my public_html directory and I have the following sites setup:

sites/all
sites/default
sites/mydomain.com
sites/sub1.mydomain.com
sites/sub2.mydomain.com
sites/sub3.mydomain.com

I don't have shell access with my ISP just cpanel, so I tried the following script, I got at http://drupal.org/node/117658.

Symlinks: Create a text file containing this script:

symlink(".", "sub1");
symlink(".", "sub2");
symlink(".", "sub3");
print "Done";

I guess I first need to know how to delete these symlinks and start over. My default site at mydomain.com now is blank, the sub1.mydomain.com goes to an apache screen somewhere and sub2.mydomain.com and sub3.mydomain.com get a server not found error.

Any help would be greatly appreciated.

Thanks,
Tim

Comments

nancydru’s picture

cPanel has a subdomain manager and a file manager. Additionally, you can delete folders under FTP.

Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Site Design Notes

blx_286’s picture

I started out with the subdomain manager. I pointed sub1.mydomain.com to http://mydomain.com/cms and I got a server not found error. So I wasn't sure if my settings.php file is wrong or if I needed a symlink.

Thanks,
Tim

venkat-rk’s picture

Is there a reason you are creating symlinks? If sub2.mydomain.com is a subdomain under the main domain, there is no need to create symlinks; as far as I know, you only need them if you are installing multisite under subdirectories (www.mydomain.com/dir1).

If you are using cPanel, you might find this post helpful:
http://drupal.org/node/123778#comment-206095

----
Previously user Ramdak.

blx_286’s picture

Thanks for the link and the cpanel tips. Using FTP I found the symlinks for my subdomains and deleted those, they were in /public_html/. But I can't find where the link is for my main site. How can I fix that or I need to get my ISP to help?

Thanks again,
Tim

venkat-rk’s picture

You won't find a symlink for your main site if you had installed drupal in its web root- that is, if you had unzipped and uploaded the drupal files to your main domain's (www.mydomain.com) public_html directory.

Update: I updated the cPanel how-to with a couple of points, especially about sub-domain installs.
----
Previously user Ramdak.

blx_286’s picture

I'm still not clear on symlinks. I ran this script from /public_html/:

symlink(".", "sub1");
symlink(".", "sub2");
symlink(".", "sub3")
print "Done";

I then had all the problems I mentioned in the first post. So I deleted the links using my ftp client, but if I accessed mydomain.com it was still a blank page. So to get mydomain.com to come back I modified the script and ran it:

symlink(".", "mydomain.com");
symlink("sub1", "mydomain.com");
symlink("sub2", "mydomain.com")
symlink("sub3", "mydomain.com")
print "Done";

But if I go to sub1.mydomain.com or sub2.mydomain.com, I get an apache screen. So does this mean that all of these subdomains should be pointing to mydomain.com in /public_html/ and I have my settings.php file setup wrong?

Do you know of a php script I can run to see what symlinks I have and/or is there a way to delete symlinks with a php file?

I am trying to get back to where I was before I broke everything. My cPanel installed Drupal into /public_html/cms/ but after I thought I had it setup correctly I moved it to /public_html/ and then broke it with symlinks.

I also noticed that after I moved it, cPanel doesn't know where it is and says I will have to do manual updates in the future.

Thanks,
Tim

petrescs’s picture

Not sure if this helps for your particular case, but I have used Parked domain manager to define new domains or subdomains on top of the main domain. In the end, all your multi site domains should resolve to same IP and should be no redirection to any subfolders in your main account (Drupal is taking care of it based on sites/ settings).
Subdomain manager creates ./sub1 etc folders in your public_html, populated by default with a cgi-bin folder and a .htaccess file. If this is the case, these folders should be deleted (or renamed) and then create a symlink of sub1 to same public_html document root. This can bring some inconsistencies in your cPanel's Subdomain manager (should you ever want to remove the subdomain at a later time), but can be handled manually (recreate that sub1 folder in public_html).
Hope this helps.

venkat-rk’s picture

Subdomain manager creates ./sub1 etc folders in your public_html, populated by default with a cgi-bin folder and a .htaccess file. If this is the case, these folders should be deleted (or renamed) and then create a symlink of sub1 to same public_html document root.

Thanks for reminding me about this. I had missed it. I shall try and update the documentation I linked to earlier in this thread.

----
Previously user Ramdak.

venkat-rk’s picture

I tested this out extensively and it works at least in cPanel:

  1. Create a subdomain - say, sub1 from the cPanel admin area of the main domain. This automatically adds the A records for the sub-domain to the DNS zone file of the main domain for both http://sub1.example.com and http://www.sub1.example.com. The A records point to the IP address of the main domain.
  2. Use an FTP program, go to the web root (public_html directory) of the main domain and manually delete the directory that corresponds to the name of the subdomain you just created. For example, if you created a subdomain called 'test', in Step 1, you will find a directory called 'test' under the public_html directory.
  3. Park the subdomain on the main domain using cPanel. This points your sub-domain to the drupal document root (code base) on your main domain.

The rest of the steps are the same as the how-to I referred previously. Hope this helps.

----
Previously user Ramdak.

blx_286’s picture

I tried using the Parked domain option and received an error.

Error from park wrapper: invalid domain sub1

So I don't know if I can park a subdomain on a domain. I was trying the subdomain manager option that you are talking about. That's how I broke it. Apparently I can be dangerous with a symlink :)

Thanks,
Tim