I am looking to have an intranet for my website and having difficulties completing the set up . This is what has been done so far:
- the public website is functional : drupal 5.3 is operational and running on PHP5 and MySQL5
- a subdomain intra.example.com has been set up
- a directory sites/intra.example.com/modules has been created and includes one non-core module
- also directories themes , files, tmp have been set up in a similar fashion
- finally a copy of settings.php has been placed in sites/intra.example.com/ with the following change $db_prefix = 'intra_'
Now if i go to http://intra.example.com i see the same website as when I would enter www.example.com.
What needs to be done to fix this?
Comments
did u check if the TABLE and
did u check if the TABLE and intra_TABLE have the same content?
I don't see any need to use
I don't see any need to use table prefixing. Instead, I would use a separate database.
Normally one would expect to see first of all an installation page when visititing the intranet site. It looks as though either sites/intra.example.com/settings.php is not being picked up, or, more likely, since you have manually specified a valid database connection in sites/intra.example.com/settings.php perhaps the installer hasn't realised it needs to run to create the prefixed tables, and perhaps also since the prefixed tables don't exist, when you access the intranet site Drupal is defaulting to using tables without prefixes or something, i.e. the same as your main site ...
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
So how to fix?
Thanks for your responses. So how do I fix the problem?
Suppose I create an additional database called intra (which is fine, it is just that I lose another out of my allotted 5), then what needs to go into settings.php?
Can I fix this problem by using settings.php alone?
Thanks in advance
I don't think you will be
I don't think you will be able to fix the problem by using settings.php alone but I'm not a psychic, even though I play one on TV ;)
For your original problem, did you add the intra.example.com domain to your virtual host configuration for your webserver?
For changing the database connection information, if you are going to use a separate database, remove the $db_prefix information and change your $db_url settings in the sites/intra.example.com/ folder to match your new database information.
For your original problem,
intra.example.com had been added, as indicated in step number 2. Unless you mean something else?
I have also tried the extra database, removed the $db_prefix information and changed the $db_url settings, but still there is the main website which comes up. What is going wrong? How to solve this?
EDIT: In the database intra no new tables have been created, ie intra.example.com did not invoke the creation of the drupal tables there.
What happens if you visit
What happens if you visit http://intra.example.com/install.php directly?
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
I tried the following
1. http://intra.example.com/install.php
which yields:
Drupal already installed
* To start over, you must empty your existing database and replace the appropriate settings.php with an unmodified copy.
* To install to a different database, edit the appropriate settings.php file in the sites folder.
* To upgrade an existing installation, proceed to the update script.
2. http://www.example.com/sites/intra.example.com/install.php
which yields "Page not found"
I just wanted to confirm
I just wanted to confirm your setup to try and get a better understanding of what is happening.
Apache virtual host configuration(you should have additional information, we're only interested in ServerName and DocumentRoot:
Drupal sites folder:
/drupalfolder/sites/default
/drupalfolder/sites/intra.example.com
or
/drupalfolder/sites/example.com
/drupalfolder/sites/intra.example.com
example.com/settings.php:
intra.example.com/settings.php:
using table prefix:
using seperate db:
If you are using separate databases, I would recommend creating a separate user for each database.
More trials
Thank you for your answer and I have tried several other things in the meantime. The set up is as follows:
Drupal sites folder:
/drupalfolder/sites/default
/drupalfolder/sites/intra.example.com
The file sites/default/settings.php has the following:
$db_url = 'mysql://dbuser:password@localhost/example_com_db';
$db_prefix = '';
The file sites/intra.example.com/settings.php has the following:
$db_url = 'mysql://dbuser:password@localhost/example_com_db_intra';
$db_prefix = 'intra_';
I have not been able to find the Apache virtual host configuration. What is its filename and do I need root access to edit it?
Also, do I need an index.php file in folder sites/intra.example.com?
Thanks in advance
>do I need an index.php file
>do I need an index.php file in folder sites/intra.example.com?
No, the whole point is that the index.php in the top level Drupal folder does all the work.
Is your intranet settings.php file being picked up?
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Unfortunately not
There is a server generated message saying "Directory has no index file. Browsing this site or directory without an index file is prohibited." It is not drupal generated as it has no DOCTYPE amongst other things. Please advise.
The
The sites/intranet.example.com/settings.php files *should* be picked up when you visit http://intra.example.com, since this causes the main index.php to load, which at some stage checks for the existence of sites/intranet.example.com/settings.php and if it finds it, parses and executes it. If not found then sites/example.com/settings.php, sites/com/settings.php and finally sites/default/settings.php are checked. The first one found is parsed and executed.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
the main apache
the main apache configuration file is httpd.conf and can be found in Apache's conf directory. In CentOS, the file will be at /etc/httpd/conf/httpd.conf. Other OSs may have it in a different directory, but the Apache specific stuff, in *nix, will be in httpd and it's sub-directories. For Windows and XAMPP, in my experience, it is called Apache.
The virtual host configuration stuff can usually be found at the bottom of the httpd.conf file in Section 3. If everything is commented out, look for an 'include' entry or entries. Include's can specify a file or a directory. If it specifies a directory, then you need to look in the directory and see if there is a .conf file that addresses virtual hosts. Using seperate configuration files makes things easier in complex setups. Mine looks like: 'Include conf.d/*.conf' with the virtual host file called 'vhosts.conf.'
If your using XAMPP it will probably be ./Apache/conf/extra/httpd-vhosts.conf.
The 'Include conf.d/*.conf' directive tells apache to include all the .conf files found in the conf.d subdirectory.
If you do not have any virtual hosts setup, that is probably your problem. If you do and the information is set correctly, then something else is the issue. Both your main domain and your subdomain should point to the same document root in your setup. Drupal will match user the folder with the exact same name as the domain name. If a match isn't found, it will use the 'default' folder stuff.
If you cannot view your apache files, then check with your hosting company. You may also be able to view the information from your control panel, but I wouldn't know since I do not use that stuff.
Yes I wouldn't expect 2. to
Yes I wouldn't expect 2. to work.
It looks to me as though the intranet's folder in "sites" is not being picked up ...
If you put a syntax error in sites/intra.example.com/setting.php and you don't then get a PHP parse error then that would confirm this!
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk