0

I am trying to install a second instance of apache on debian. I used the multiple instance script. during the installation it says:

root@nextcloudpi:/usr/share/doc/apache2/examples# sudo sh setup-instance suitecrm2
Setting up /etc/apache2-suitecrm2 ...
systemd is in use, no init script installed
use the 'apache2@suitecrm2.service' service to control your new instance
sample commands:
systemctl start apache2@suitecrm2.service
systemctl enable apache2@suitecrm2.service
Setting up symlinks: a2enmod-suitecrm2 a2dismod-suitecrm2 a2ensite-suitecrm2 a2dissite-suitecrm2 a2enconf-suitecrm2 a2disconf-suitecrm2 apache2ctl-suitecrm2
Setting up /etc/logrotate.d/apache2-suitecrm2 and /var/log/apache2-suitecrm2 ...
Setting up /etc/default/apache-htcacheclean-suitecrm2
root@nextcloudpi:/usr/share/doc/apache2/examples# sudo systemctl edit apache2.service

So systemd is in use and i don't get a service file in init.d When i try to start the service as mentioned in the code it says there is no apache2@suitecrm2.service.

How do i create a correct init.d file to start the service, or how do i stop systemd from working so it is not in use and the script to create a second instance is allowed to place the script.

I have looked in the documentation and found that there is a script secondary-init-script, also to be found in /use/share/doc/Apache2/examples. But I don't understand how this works ( see https://alioth-lists-archive.debian.net/pipermail/pkg-apache-commits/2010-February/000296.html

Thanks

Stephane
  • 43
  • 3

1 Answers1

1

Please check if you executed systemctl daemon-reload to update systemd-information.

The script-output also tells:

use the 'apache2@suitecrm2.service' service to control your new instance

So something like systemctl restart apache2@suitecrm2.service should work.

You could also check the content of /var/lib/systemd/... for generated unit-files.

ppuschmann
  • 598
  • 1
  • 4
  • 16
  • So it was just a simple typo. – Michael Hampton Jan 16 '21 at 10:19
  • I tried systemctl restart apache2@suitecrm2.service. but that results in "service can not be found". Sorry indeed I made a typo in my original question. A big one, sorry for that. Problem remains though – Stephane Jan 16 '21 at 14:31
  • @Stephane Did you run `systemctl daemon-reload`? Your script should have done, but maybe it did not. – Michael Hampton Jan 16 '21 at 22:16
  • @michael This did work although as I am working on nextcloudpi distro for rpi4 they set up the .conf files differently because of which I had duplicate ports. I solved that and it runs. I ran into another problem though. Going to post this in a second. If 2 instances run, can both access mariaDB? – Stephane Jan 17 '21 at 21:54
  • If 2 instances run, can both access mariaDB? --> again the depends on your local setup. Usually you can define multiple users and grants on MySQL/MariaDB and even connect with different users from the same application. It is best to create separate credentials (user/passwd) for your instances. – ppuschmann Jan 19 '21 at 19:10