Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.9k views
in Q2A Core by
Hello,

How to install multisite q2a in subdirectories with single login for all users.

mydomain.com/

mydomain.com/site1

mydomain.com/site2

mydomain.com/site3

I tired many times, it does not share user logins. I searched in many questions but process is not clear.

I changed user prefix in config file in 2nd and 3rd sites. It would integrate database but it would ask me to create new user in subsites in 1st, 2nd and 3rd sites.

I know that every subsite will have its own database integrated in one database but how it would use same userlogins? Problem with Keeping same database for all subsites would just copy the same content on all subsites.

I want content to be different all subsites but userlogins remain the same.

Thanks for your help in advance.
Q2A version: Latest

3 Answers

+1 vote
by
Here is exact solution, it works fine for user logins...I verified....but there is one issue....  user points are not sync between diff sites...

http://question2answer.org/qa/56605/q2a-on-main-and-subdomain-with-single-user-base?show=56652#a56652
by
@Prothoughts, Thank you for your reply.  I need clarification for sites in subdirectories.

I tried the solution with single db for all subsites. All databases integrate in single database but it does not integrate users on all sites. Only content. I want content to be different on all sites but userlogins would remain the same. In single db there are multiple user tables per site. That's why it does not share same users across all sites.

Sharing points across all sites is not important for me.
0 votes
by
you can do that
use only one sql
by
@moha16, Do i need to combine user tables in single db or enable blob feature? because even in one integrated database for all subsites, users are not same.
by
yes tables tables better
+2 votes
by

The elements required to realize multi-site are as follows.

  1. QA_MYSQL_TABLE_PREFIX
  2. QA_MYSQL_USERS_PREFIX
  3. QA_BLOBS_DIRECTORY
  4. QA_COOKIE_DOMAIN
Definition in qa-config.php Value of main site Value of sub site
QA_MYSQL_TABLE_PREFIX ※1 ※5
QA_MYSQL_USERS_PREFIX ※2 ※6
QA_BLOBS_DIRECTORY ※3 ※7
QA_COOKIE_DOMAIN ※4 ※8

※1 In default, it is "qa_". However, you can change it. For example, "qa1_", etc.
※2 Unnecessary
※3 You will need to enable and assign specific folder. In addition, you need to export blob data from DB to file system in "Admin" > "Stats".
※4 Unnecessary
※5 You need to define prefix other than "qa_" OR "qa1_". For example, it is "qasite1_" or ""qasite2_"" ...
※6 You need to define as "qa_". It must be same with QA_MYSQL_TABLE_PREFIX of main site.
※7 You need to assign folder same with main site.  In addition, you need to export blob data from DB to file system in "Admin" > "Stats".
※8 You need to define top level domain. For exmaple, ".mydomain.com"

These are multi-site settings I understand.

In order to solve the problem, you need to show qa-config.php of each sites. 

by
edited by
@sama55, Thank you for your detailed answer. I will work on it and get back to you shortly.
by
Hello Sama55, I tried to follow instructions but looks like I can't figure out to get blog data from db and import into "admin" > Stats.

and one more thing with cookie setting. if I am installing in subdirectory of domain- should i use - ".mydomain.com" or  "mydomain.com."

Thanks for your help. I can give you access to my test cpanel if you can help me with this.
by
Reference:
http://www.question2answer.org/qa/24390

"Blobs to disk" and "Blobs to database" buttons are displayed on following condition.
"Blobs to disk": QA_BLOBS_DIRECTORY is enable. AND data exit in database.
"Blobs to database": QA_BLOBS_DIRECTORY is enable. AND file exist  in folder.

You should use ".mydomain.com". Leave the leading "." (dot).
Read commnet of QA_COOKIE_DOMAIN carefully in qa-config.php.
...