Hello.

I have a local server and a remote server that will be the definitive host. I´m create the drupal page in local and upload the good code to remote server.

I have installed Multisite Manager in both servers, local and remote. In remote I got it to work successfully but in local I get a Error 404 from Apache (Apache/2.2.15 (Linux/SUSE) ) when I attempt go to sub-site.

Example (local):
(drupal url) htt p://localhost/~user/
(site url) htt p://localhost/~user/site/example1 -> Return 404 error


(drupal url) htt p://www.mywebdir.com/
(site url) htt p://www.mywebdir.com/site/example1 -> Runs fine

I do the corret changes to settings.php and .htaccess files, and i create the symlink. I tried "$ ln -s . site" and i tried "$ ln -s /home/user/public_html site"

Anybody has a idea what is happen?

P.D. I configured apache and to accept clean url in local but drupal not recognizes it, can it be the problem or part?
Sorry, my english is not very good.
I created the same post in the drupal -> post instalation forum. Sorry, for duplcate it i know but I forget this issues forum.

Comments

schuyler1d’s picture

Do you have mod_rewrite in Apache enabled?
You also might want to put it in a different space from your ~user directory, but wherever it is, make sure apache
Options All is set, too.

jncruces’s picture

Thanks for your response.

Yes I have mod_rewrite Apache enabled and i have Options +FollowSymLinks actived and Allowoverride All too, every change on .htaccess affects to page.

I was all day configuring and changing Apache config. But i can´t enable for example Clean Url´s it was impossible for me. I tried all: http://drupal.org/node/15365

.htaccess

RewriteEngine on 

#file access
RewriteRule ^\w+/(modules|misc|files|themes|sites)(.*)$ ./$1$2 [L]

RewriteRule ^/(modules|misc|files|themes|sites)(.*)$ ./$1$2 [L]

#special php scripts
RewriteRule ^\w+/(update.php|install.php|index.php)(.*)$ ./$1$2 [L,QSA]

#site sub-section
RewriteCond %{REQUEST_FILENAME} ^/home/user/public_html/site/.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^\w+(/)?(.*)$ index.php?q=$2 [L,QSA]

The rest of file is .htaccess base of drupal. I attempt with #RewriteBase / and RewriteBase /

sites/default/settings.php

$db_url = 'mysqli://username:password@localhost/database';
$db_prefix = 'drupal_';
$base_url .= "http://localhost";

$requri = explode('/', request_uri());
if (sizeof($requri) >1 && $requri[1]=='site' && $requri[2] != '') {
   $my_site_base = $requri[2];   
   #this will be the database shared between the main site and the shared sites
   $db_url = 'mysqli://username:password@localhost/database';
   $db_prefix = $my_site_base."_";
   $base_url .= "http://localhost/site/$my_site_base";  // NO trailing slash!
}

mod_userdir.conf

	<Directory /home/*/public_html>

		#AllowOverride FileInfo AuthConfig Limit Indexes
		AllowOverride All
		#Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
		Options -Indexes +FollowSymLinks

		<Limit GET POST OPTIONS PROPFIND>
			Order allow,deny
			Allow from all
		</Limit>

		<LimitExcept GET POST OPTIONS PROPFIND>
			Order deny,allow
			Deny from all
		</LimitExcept>

	</Directory>

	<Directory ~ "^/home/*/public_html/(.+/)*sites/.+/(files|tmp)/">
  		SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
		Options None
		 Options +FollowSymLinks
	</Directory>


	AccessFileName .htaccess
	# and never show them
	<Files ~ "^\.ht">
	    Order allow,deny
	    Allow from all
	</Files>

httpd.conf

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

<Directory /home/*/public_html>
    Options -Indexes +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>



# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Allow from all
</Files>

apache2ctl -M

Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 authz_host_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authz_groupfile_module (shared)
 authn_file_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 dir_module (shared)
 include_module (shared)
 log_config_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 setenvif_module (shared)
 status_module (shared)
 userdir_module (shared)
 asis_module (shared)
 headers_module (shared)
 imagemap_module (shared)
 rewrite_module (shared)
 php5_module (shared)
 authz_default_module (shared)
 mono_module (shared)
Syntax OK

I hope this information will be enough. Thanks!

schuyler1d’s picture

Status: Active » Closed (works as designed)

Is it your host? Can you see if it works from /var/www/localhost/ (or wherever the true document root is)?

The one line that you might change is:

$base_url = "http://localhost";

(remove the '.')

Basically, if you can get cleanURLs working, the multisite_manager should work with your configuration. Good luck!

jncruces’s picture

Thanks I will study cleanURLs now. I think same, when i get cleanURLs i will resolve my problem.

This point!!!! (".") I´m all days making changes adding for example "/~user/" to url base and making several changes and i let it, error. But i removed this "." from $base_url and the problem persist.

I don´t understand what do you said with works on /var/www/localhost/. In any case my base directory is /var/www/htdocs

Do you said me that i can move all the directory without problem there?

Thanks!

Edit:
Yes i find the problem. It was this sentence:

RewriteBase /

I tried to enable it but I needed to add /~user/

RewriteBase /~user/

I tried this too but this time i moved this line to the begin of the sentences that rewrite the url for Multisite_manager.

Thanks! I hope that it will help to another one!