Hello everybody,
Here first, bravo for the great work in Drupal :-) I hope you will can help me with this issue.
I probably make a mistake somewhere but where ...
1) My objectives :
* Il whant to create a "main" site for external visitors with info like "activities" "about us" "news" etc... This site will be somewhere like http://mylabo.university.fr/ (not www.university.frbecause this belong to main university site who is on another server). This site will not allow visitors to become user but will have just somme redactors.
* In the same time i whant another site for "intranet community" purpose with internal forum, pontomail, shared "labo" events, computer help stuff, etc. This site will be somewhere like http://mylabo.university.fr/intranet (Obviously not http://intranet.university.fr/). This site will just give a "login" page to visitors and i will manualy add users. (I plan to share users between sites later but i am not here yet)
2) DNS infos :
The University.fr have give me a DNS entry for mylabo.university.fr and an OpenSuse 10.1 linux box whith apache2 / PHP5 / MySQL5 is runing on it (No DNS on this machine).
3) Apache config
The Apache server have virtual host based on ports because i have put some "administative" web tools on a special port and a special directory to block them from the outside world (PhpMyAdmin / BASE / PhpLdapAdmin etc...)
Here is the config for the *:80 virtual host in case of i have mess sommething inside (real host name modified) :
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin root@mylabo.university.fr
DocumentRoot /srv/www/htdocs/www-public-80
ServerName mylabo.university.fr
AddDefaultCharset utf-8
ErrorLog /var/log/apache2/error_log
TransferLog /var/log/apache2/access_log
# Anti-Http-Trace attak ##### ---> This is a rule proposed by Nessus to avoid certain vulnerabilities
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
# Enable clean URLs in Drupal sites ---> The clean url works for the main site if y activate this
# <Directory /srv/www/htdocs/www-public-80>
# RewriteEngine on
# RewriteBase /
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# </Directory>
</VirtualHost>
I have un-actived the rewrite/clean URL rules because i was thinking the issue can be related to this but it's seems is not the case.
4) /srv/www/htdocs/www-public-80 directory structure
There is mainly Drupal stuff here and a couple of symlinks to direcory cgi-scripts :
/directory_simlink1
/directory_simlink2
/database
/files
/includes
/misc
/modules
/sites
---/default
---/mylabo.university.fr.intranet
/themes
.htacess -> default one
cron.php
index.php
update.php
xmlrpc.php
5) Databases
There is two databases drupal_mylabo & drupal_intranet who are not sharing anything (for now) exept the MySQL user drupal_user. The two databases are commented inside there respectives settings.php
6) Sites
I have already give to the "main site" is site_name as "My labo". The "Intranet" site is still called "Drupal" with default theme. I can make the difference betwin the two site beacuse they have different names & themes.
----------------
THE ISSUE
----------------
* If i go to http://mylabo.university.fr/ i have the "main" site with fully fonctional database. I have even begin to make some work inside with no problems :=) (Drupal rooks for "clear" sites !)
* the same if i go to http://localhost/
* if i go to http://mylabo.university.fr/intranet i have a 404 error (default apache one)
* if i activate the "clean URL+apache mod_rewrite" the clean URL works for the "main" site but i still have an error for http://mylabo.university.fr/intranet (404 error managed by Drupal this time).
* if i rename the "intranet" directory from /sites/mylabo.university.fr.intranet to /sites/mylabo.university.fr and if i go to http://mylabo.university.fr/ i have the "intranet" sites whith is default "drupal" name & theme and nothing inside (yet).
* But if i go to http://localhost/ in the same time i have the "main" site (It's normal beaviour because of the "default" rule).
So apparently :
I have made a mistake somewhere who made /sites/mylabo.university.fr.intranet did not work as expected for http://mylabo.university.fr/intranet
But it's not :
* not related to database stuff/configs as i can acess both by changing the name of the "intranet" directory
* not related to the clean URL config as the problem is the same feature activated or not
Resume :
http://my.site.com/ -> work good with /sites/default
http://my.site.com/ -> work good with /sites/my.site.com
http://my.site.com/directory -> did not with /sites/my.site.com.directory
Please, can someone help me ?
Comments
Looks like you are having
EDIT: take a look at this posting: http://drupal.org/node/49605
Have you tried uncommenting
Have you tried uncommenting this line in your settings.php;
# $base_url = 'http://www.example.com'; // NO trailing slash!
I only ask as the error you're receiving is a 404 and not an access denied, so the server is trying to access an allowed page which is not present. You can do away with the symlinks by the way, they're not needed...
Pobster
http://drupal.org/node/49605
thanks danbh but this post did not help me actualy a lot (maybe later for sharing databases)
becauses :
- i cant' have two different domains names the "intranet" site must be under the main site (for beter url remerbering to the users, and because of limited DNS entries).
- actualy the database are not shared.
My problems seems to occur only because i whant a sub-directory site. From my tests (replace sub-directory by the "main" domain) i am nearly sure than i will can have two differents domains with no problems.
note : the "main" and "intranet" are inside the same virtual host i do not plan to separate them, except if have no choice.
----
Thanks you to pobster i have just try to do this but it did not change anything. I still have 404 page for the "sub-directory" site.
Note : yes i have a 404 page from Apache if i did not activate "friendly URL + mod_rewrite". If i activate them i have a "page not found" from the main Drupal site.
Note : The simlinks are for other stuffs no way related tu Drupal (python-cgi "home made" applis for Postgres databases stuff). Anyway if i remove them the problem still occur.
NB : Oh ! I can't edit my main post tu correct the unclosed
</i>tagA request for the intranet
A request for the intranet site must lead back to Drupal's disk directory, so that Drupal's index.php can service it and bring up the right site. Did you implement that?
It can be achieved either with a second vhost or with just a symlink taking the place of the subdirectory. (Not with an apache rewrite, because then the request itself will change and Drupal won't be able to tell the difference between the sites.)
Also, a site in a subdirectory does need a $base_url = 'http://www.example.com/intranet' in its settings.php.
Solved !
Thanks a lot CogRusty !
This was the missing steep i forget (seem it was not clearly said in readme file for 4.7.4 anyway).
For remembering where is the steeps-by-steep solution :
- Create a directory for /sites/my.site.com.directory copied from /sites/default
- Create a symbolic link inside the Drupal directory (may be /var/www/htdocs or /srv/www/htdocs) :
# ln - s . directory- Change /sites/my.site.com.directory/settings.php as necessary (yep $base_url = 'http://my.site.com/directory' in is settings.php is not necessary)
(By the way the creation of a virtual host was not necessary)
Thanks again GogRusty you save me from a big headheck :-)