Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.0k views
in Plugins by
reopened by
I am running 4 sites that have 1 user data base.

All plugins are the same, even all theme files are the same.

Generally asked, would it be "smart" to point all installations to the same ftp folders for qa-plugin and qa-theme?

Or would there be too many issues of internally wrong linking etc?

2 Answers

+3 votes
by
selected by
 
Best answer

You could try setting up "symbolic links" from one folder to another. On the command line you'd use

ln -s /path/to/qa-plugin

So you'd put the plugins in /site1/qa-plugin/ and then go to site2's directory and run that command using the path for site1. I don't know 100% if it will work, if certain plugins write to files or options specific to a site it could cause errors.

Alternatively, if you have access to the command line you could write a shell script that copies everything from one folder to the others, e.g.

cp -R /path/to/site1/qa-plugin/ /path/to/site2/qa-plugin/;
cp -R /path/to/site1/qa-plugin/ /path/to/site3/qa-plugin/;

by
Thanks for the idea. Copying is not an option, sometimes I modify 3 plugins in one day. And currently I hand-copy those changed files, which is a waste of time. To my knowledge, all plugins are folder independent, just not the q2a caching plugin which writes all HTML files to the qa-cache folder. It uses the QA_BASE_DIR constant to define the folder to write. QA_BASE_DIR gets defined in the index.php - so it should work I guess.

https://github.com/q2apro/q2apro-caching/blob/master/qa-caching-main.php
by
Just to recap because I have not used symbolic links yet:
1. I go to "/site2/qa-plugin/"
2. I enter "ln -s /site1/qa-plugin"
3. This should link qa-plugin from site 2 to site 1.

If it goes wrong, how can i delete the symbolic link again?
I found the command: "rm {link-name}"

So would it be "rm /site1/qa-plugin" (executed from within site2/qa-plugin) - or would the "rm" command remove the directory?!

---

"Because a symbolic link is considered as a file on Linux, you can delete it with the rm command. 'rm linkfile'"

So I guess we need to name the symlink:

→ 2. "ln -s /site1/qa-plugin qapluginlink"

and then to remove it:

4. "rm qapluginlink"

Correct?
by
You wouldn't name it "qapluginlink", you'd need to name it "qa-plugin" because Q2A will try to read `/site2/qa-plugin/wysiwyg-editor/` for example.

You're right about deleting it. Removing the symlink does not remove the files it points to. So `rm /site2/qa-plugin` doesn't touch site1. (Also, `rm` would not remove a directory anyway, only one individual file.)
by
edited by
It seems to work for all folders! The settings of the plugins are stored in the DB. For CSS I am using a body class to identify the necessary CSS.

Example for the command:
ln -s /srv/q2aforum/public/qa-plugin /srv/q2aforumB/public/qa-plugin

*Important: DELETE the destination/symlink folder "qa-plugin" before you execute the command.
0 votes
by
edited by
it seems not possible.

just copy and paste, it is really simple.

plugins and themes will not take up too much space.

if it can be defined in qa-config.php, then it is possible.
by
lets say if you are running many q2a sites and want to upgrade with latest version. if all are using same q2a folder then it will be easy to upgrade all at a time.
...