Posted by Sita Bhatt on June 14, 2006 at 6:58am
Hi
I'm working with Apache 2.2.2, MySQL 5.0.19 and PHP 5.1.2
I have a default site http://abcd
This works fine.
Now i would like to enable a site http://abcd/def which will have its own tables, users, modules, themes - basically a site by itself.
The steps i followed were:
- Created a folder def under sites directory in main folder
- Modified settings. php
- Created a new dbase def
- created a new user for the dbase and gave all privileges (as per install.txt)
Now when i go to my browser and point to http://abcd/def, I get a page not found error.
What am i doing wrong?
Thanks & Rgds
Sita
Comments
You need to configure
your web server to serve requests to the subdirectory from the main drupal directory. You could either use a symlink or an Apache alias directive. Search for a few of the thousands of questions and answer examples already posted.
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal
--
Anton
Did try an alias
Hi
I did try putting up an alias with Apache 2.2.2
I added the Alias directive to httpd.conf with syntax "Alias /http://abcd/def /directorypath/def"
When i type http://abcd/def i get a page not displayed error.
If i add syntax "Alias /http://abcd/def|/directorypath/def", the webserver does not restart.
Is my syntax wrong?
Rgds
Sita
Look up the Apache docs
http://httpd.apache.org/docs/2.0/mod/mod_alias.html#alias
You want something like this:
Alias /def /filesystem/path/to/drupal/rootObviously you will have to replace "/filesystem/path/to/drupal/root" with the path to your Drupal directory - ie the directory containing Drupals index.php file.
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal
--
Anton
I did precisely that..
even referred to the same url for the syntax. But I still get a page not displayed error.
Thanks
Rgds
Sita
Is Alias used for content under DocumentRoot?
I am looking at httpd.conf and it says "Alias: Maps web paths into filesystem paths and is used to access content that does not live under the DocumentRoot." In my case, the content is under DocumentRoot.
Do i need to use any other directive?
Rgds
Sita
The difficult and the easier way
I needed to show the file index of a some folder that had nothing to do with Drupal. With standard drupal in http://abcd/ it wont work because you will always see the page not found error. So I put in the folder a .htaccess to overrule the one in the parent folder, with this:
#allow accessing pdf files in this folder
<Files ~ "(\.(pdf))$">
order allow,deny
allow from all
</Files>
#allow index in this folder
Options +Indexes
Similarly to allow what you want you would need a change in the .htaccess of the Drupal in your domain root, but I wouldn't know how yet.
Probably it is much easier to just set up a different virtual (sub)domain in Apache and let it point to that folder. Or better still, you could have the (sub)domain point to the same folder as your root domain (Park the subdomain on top of your main domain) and use the same Drupal codebase with different databases. With a subdomain def.abcd it would be just a matter of copying the sites/default folder to sites/def.abcd and editing the database defintion in sites/def.abcd/settings.php to another database. When your hosting provider doesn't allow you to use another database, you can also use table prefixing.
This alternative setup saves you lots of work when you need to upgrade or patch your site.
Try just this one step. If you have
Try just this one step. If you have shell access, go to your "/abcd" directory (Drupal's main directory) and create a symlink.
ln -s . def
(a symlink pointing "here", named "def")
This symlink will redirect everyone who tries to go to "/abcd/def" back to Drupal's directory, and Drupal will handle it from there based on yopur settings.
By shell access, do you mean UNIX?
I'm on Windows.
Rgds
Sita
Oh, ok. Then styro's second
Oh, ok. Then styro's second answer should do it. Generally, you want to redirect to inside Drupal's directory.
Probably something similar
Probably something similar to:
Alias /def "c:/program files/apache group/apache/htdocs"
Tried that syntax..
doesnt work - my webserver doesn't restart. Fails to bring up the service.
Am wondering if Alias is the right directive if i want to work within DocumentRoot.
Rgds
Sita
I think the directive is ok.
I think the directive is ok. Hmm... you said "Created a folder def under sites directory in main folder". Do you mean "def" literally? The folder's name should be "abcd.def" for a "http://abcd/def" site.
Just to be sure.
Tried that too
Thanks, i renamed it abcd.def for the http://abcd/def site, my webserver doesn't restart.
could it be a tweak to the htaccess file - i have done nothing in that regard.
Rgds
Sita
No need for apache config, use Drupal settings
Just create the subfolder, upload all your drupal files into it, and make sure that you set the entire path (with subfolder and all) in settings.php and in .htaccess (rewritebase) if you are using clean urls.
Here is more detail on how to maintain multiple installations of Drupal in different folders
-----
iDonny - Web Content Management System Design, Development. & CRM
-----
Donny Nyamweya - USER25.com
What does this sentence mean?
I'm unsure about what this means "Point all your domains to the same root folder where Drupal is configured (You admin or hosting provider will point domains as needed)"
What exactly do i need to do? The webserver is in my control.
Thanks
Rgds
Sita
Not much that we have not
Not much that we have not already covered.
In your case it means that the url "http://abcd/def" must lead to the "/abcd" folder (where Drupal is installed), and it must *not* lead to an "/abcd/def" folder or to any other folder.
That was what we were trying to do with the Apache directives.
So am back to the same issue :(
with the directives. The rest of the procedure is correct, its just the issue of the server not recognizing the domain.
Rgds
Sita
Maybe Apache's error log can
Maybe Apache's error log can help you figure out why it does not restart.
The error
Hi
Now i've got this added to my httpd.conf:
NameVirtualHost *
ServerName abcd:80
DocumentRoot "F:/DocCMS/Install/drupal-4.7.0"
ServerName abcd:80/def
DocumentRoot "F:/DocCMS/Install/drupal-4.7.0/sites/abcd.def"
The error log in Apache shows me:
[Thu Jun 15 17:27:28 2006] [notice] Parent: Received restart signal -- Restarting the server.
[Thu Jun 15 17:27:28 2006] [notice] Child 2260: Exit event signaled. Child process is ending.
[Thu Jun 15 17:27:28 2006] [notice] Apache/2.2.2 (Win32) configured -- resuming normal operations
[Thu Jun 15 17:27:28 2006] [notice] Server built: Apr 29 2006 18:32:31
[Thu Jun 15 17:27:28 2006] [notice] Parent: Created child process 1164
[Thu Jun 15 17:27:28 2006] [notice] Child 1164: Child process is running
[Thu Jun 15 17:27:29 2006] [notice] Child 2260: Released the start mutex
[Thu Jun 15 17:27:29 2006] [notice] Child 1164: Acquired the start mutex.
[Thu Jun 15 17:27:29 2006] [notice] Child 1164: Starting 250 worker threads.
[Thu Jun 15 17:27:29 2006] [notice] Child 1164: Starting thread to listen on port 80.
[Thu Jun 15 17:27:30 2006] [notice] Child 2260: Waiting for 250 worker threads to exit.
[Thu Jun 15 17:27:30 2006] [notice] Child 2260: All worker threads have exited.
[Thu Jun 15 17:27:30 2006] [notice] Child 2260: Child process is exiting
[Thu Jun 15 17:27:37 2006] [error] [client 10.66.121.218] PHP Warning: PHP Startup: Unable to load dynamic library './php_gd2.dll' - The specified module could not be found.\r
[Thu Jun 15 17:27:37 2006] [error] [client 10.66.121.218] in Unknown on line 0
[Thu Jun 15 17:27:37 2006] [error] [client 10.66.121.218] PHP Notice: Undefined index: path in F:\\DocCMS\\Install\\drupal-4.7.0\\includes\\bootstrap.inc on line 161
[Thu Jun 15 17:27:43 2006] [error] [client 10.66.121.218] File does not exist: F:/DocCMS/Install/drupal-4.7.0/def
[Thu Jun 15 17:27:54 2006] [error] [client 10.66.121.218] File does not exist: F:/DocCMS/Install/drupal-4.7.0/def
The last two lines tell me i still have hope..what am i doing wrong?
Appreciate all the help - this is really not happening for me.
Thanks
Sita
Still better...
The error log has come down to:
[Thu Jun 15 18:09:47 2006] [notice] Parent: Received restart signal -- Restarting the server.
[Thu Jun 15 18:09:47 2006] [notice] Child 5620: Exit event signaled. Child process is ending.
[Thu Jun 15 18:09:47 2006] [notice] Apache/2.2.2 (Win32) configured -- resuming normal operations
[Thu Jun 15 18:09:47 2006] [notice] Server built: Apr 29 2006 18:32:31
[Thu Jun 15 18:09:47 2006] [notice] Parent: Created child process 4088
[Thu Jun 15 18:09:48 2006] [notice] Child 4088: Child process is running
[Thu Jun 15 18:09:48 2006] [notice] Child 4088: Acquired the start mutex.
[Thu Jun 15 18:09:48 2006] [notice] Child 4088: Starting 250 worker threads.
[Thu Jun 15 18:09:48 2006] [notice] Child 5620: Released the start mutex
[Thu Jun 15 18:09:49 2006] [notice] Child 5620: Waiting for 250 worker threads to exit.
[Thu Jun 15 18:09:49 2006] [notice] Child 5620: All worker threads have exited.
[Thu Jun 15 18:09:49 2006] [notice] Child 5620: Child process is exiting
[Thu Jun 15 18:09:49 2006] [notice] Child 4088: Starting thread to listen on port 80.
[Thu Jun 15 18:09:54 2006] [error] [client 10.66.121.218] File does not exist: F:/DocCMS/Install/drupal-4.7.0/def
Where can the webserver not find F:/DocCMS/Install/drupal-4.7.0/def???
Rgds
Sita
Convinced..
am unable to trace this error
[Thu Jun 15 18:23:33 2006] [error] [client 10.66.121.218] File does not exist: F:/DocCMS/Install/drupal-4.7.0/def
Is it a path issue? Where? Would really appreciate some help - am almost there.
Thanks
Rgds
Sita
This must be
This must be wrong:
ServerName abcd:80/def
DocumentRoot "F:/DocCMS/Install/drupal-4.7.0/sites/abcd.def"
You don't want to send Apache there.
"/sites" is Drupal's internal business. Try "F:/DocCMS/Install/drupal-4.7.0" for both sites.
Does the first site work?
No, doesn't work
I tried "F:/DocCMS/Install/drupal-4.7.0" as document root for both sites.
Yes the first site works, but the second one still shows page not displayed.
And error log also still shows
[Fri Jun 16 08:15:46 2006] [error] [client 10.66.121.218] File does not exist: F:/DocCMS/Install/drupal-4.7.0/def
Check these if you haven't
Check these if you haven't already.
- Apahe documentation, VirtualHost Examples
http://httpd.apache.org/docs/2.2/vhosts/examples.html
- Installing and configuring Apache on Windows XP
http://johnbokma.com/windows/apache-virtual-hosts-xp.html
and of course always use Drupal's base file folder for all vhosts. The "F:....../sites/sitename" folder does not contain anything that Apache can use.
Checked all the references..
no go!
Is it anything to do with the fact that mymain site is served from a folder called default (for a site called http://abcd) and now i have a folder called def.abcd (for a site called http://def.abcd)
Rgds
Sita
No errors..
did i mention, that Apache's error log shows no errors!
But i still get a Network Access Message: The website cannot be found
Explanation: The IP address for the website you requested could not be found.
Technical Information (for support personnel)
Error Code 11001: Host not found
Background: This error indicates that the gateway could not find the IP address of the website you are trying to access. This is usually due to a DNS-related error.
Date: 6/16/2006 12:59:26 PM
Server: xyz
Source: DNS error
If you have a DNS error you
If you have a DNS error you may have to read the second link I posted (about Windows), the section:
- Adding the domains to the hosts file
Isn't that for a local server?
If i was working on my own machine as a server, then i would need to do a hosts entry, right?
Yes. The "hosts" setting
Yes. The "hosts" setting would be used only by your local computer. It is only useful for development or for testing.
Other computers on the Internet can access your server only by using the numeric IP of your internet connection, except if you have a domain name assigned to your IP by a DNS server out there, or if you are using a service such as dyndns.
To track down where a problem is, test the parts separately: Is your domain name recognized by your local computer if it is in "hosts"? Can you access your server from outside using the numeric IP?
Do you mean that you have
Do you mean that you have installed Drupal in a folder called "default"? That is not a problem.
If you mean Drupal's "/sites/default" folder, your main site is *not* served from there. That folder is only for internal use by Drupal. It does not contain any index.php or anything else that Apache can use.
Your main site (and all your Drupal sites) is served only from your main Drupal folder, not from "sites/default" or from any other "sites" folder.
Yes, got that..
sorry, was Drupal'ed for a while...
Sita
Try a simple php script if you don't have shell access
If you don't have access to run shell commands, read this article. That explains the use of the php
symlink()function to overcome shell access problems.I'm sure this can be made to
I'm sure this can be made to work, though you may need to duplicate the drupal installation and make fancy use of rewrite rules.
But the real question is why? Having two separate sites named http://abcd and http://abcd/def is sure to confuse users, will be difficult to maintain, and doesn't seem the right way to do things. It's much easier for both users and maintainers if you keep the drupal sites all at the same depth in the URL.
So the two better alternatives are:
The first is most easily done by cloning the drupal tree, but can be made to work in other ways.
The second is trivial from the Drupal side - use just use a new directory under the sites directory for the settings.php. Setting up the subdomain (i.e. def.abcd) is also very easy at most hosting services that allow subdomains. If you're doing this on a personal MS Windows system, I think you can create the subdomain by editing the HOSTS file (but be prepared to reboot after each edit).
Gary Feldman
Gary Feldman
MarsDome, Inc.
http://www.marsdome.biz
This is a different error now
I took alternative 2 in your mail above.
I changed the second domain to http://def.abcd
In httpd.conf, the VirtualHost block looks like this:
ServerName abcd:80
DocumentRoot "F:/DocCMS/Install/drupal-4.7.0"
ServerName def.abcd:80
DocumentRoot "F:/DocCMS/Install/drupal-4.7.0/sites/def.default"
I get Network Access Message saying The IP address for the website you requested could not be found.
Technical Information (for support personnel)
Error Code 11001: Host not found
Background: This error indicates that the gateway could not find the IP address of the website you are trying to access. This is usually due to a DNS-related error.
Date: 6/16/2006 2:51:42 AM
Server: somexyz
Source: DNS error
This is new, so am encouraged again :)
Any further thoughts?
Thanks
Sita
Ask Apache NOT What Drupal Can Do For You
...and Ask Drupal Not What Apache Must Do For You
Looks like you are intermingling stuff between Apache and Drupal.
Use Apache Virualhost entries to divert HTTP (port 80) requests to your Drupal Home only -i.e. where your index.php file is located. Let Drupal internally figure out which settings.php (within various subfolders in your "../sites/ “directory) it needs to use.
To use "multisite" stuff, you need three things:
1: Configure Apache: Create appropriate VH entries in your Apache config file
2: Setup Drupal Subfolders: Create Subfolders for each of your FQDN in your Drupal-Install-Folder/Sites directory, and tweak settings.php file as needed,
3: Setup DNS Stuff: Make corresponding entries in your hosts files (if you are doing this on your local machine) or have those zones added to your DNS servers (upstream) if your are using publicly routable/accessible FQDNs. If you are making those entries on your local PC, reboot it. If you are adding new/updated DNS records to your DNS servers, freshen up DNS cache -hopefully, you won't have to watch the grass grow while your zone's TTL runs is course.
VirtualHost (VH) blocks in your HTTPD.CONF would be identical -as in:
For http://abcd FQDN, have a VH entry like the following:
ServerName abcd:80
DocumentRoot "F:/DocCMS/Install/drupal-4.7.0"
For http://def.abcd FQDN, have a VH entry like the following:
ServerName def.abcd:80
DocumentRoot "F:/DocCMS/Install/drupal-4.7.0"
Leave all of that "../sites/sub-folder-name" stuff out of your httpd.conf. It is something that Drupal knows how to deal with -internally. If your Apache is listening to port 80 (i.e. default port setting), you need not specify that in every VH block entry.
From the error message you have cited, it looks like your hosts file is missing entries needed for resolving these two FQDN (hostnames) to a valid IP address (such as localhost or 127.0.0.1) that is bound to one of your Network Interface Cards. Failing to do this could lead to not only "unknown hostname" (DNS lookup) errors, but also to sudden hairloss –now you better not ask me how I know this. ;)
HTH