Start Apache automatically at boot up/switch on

Keywords: LAMP/MAMP/WAMP - Virtual Machines - How to - Other

Description:
I have installed Bitnami LAMP on a laptop running lubuntu. What is the easiest way to get Apache to start up at boot time without user intervention?

Bump. Seems like a perfectly reasonable question. Why zero response?

Hi @enrico

Thanks for using Bitnami LAMP!

I have installed Bitnami LAMP on a laptop running lubuntu. What is the easiest way to get Apache to start up at boot time without user intervention?

Are you using a Virtual Machine as your thread indicates or a native Linux installer? In case of the latter, we have a guide that covers the topic :slight_smile: You can take a look at it at:

https://docs.bitnami.com/installer/faq/linux-faq/administration/autostart-linux/

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

1 Like

Hello Jose,

Thanks for the email. I have installed lububtu on an old AMD laptop (real, not virtual).

Sorry I did not know what to choose from your drop down, I was looking for real real computer and do not recognise the term “native Linux installer” so I chose virtual machine as the nearest thing.

I will look at the guide in your link. Thanks

I followed the procedure in your link and at the ;last command got this error message

ricobasso@emachinesd620:/etc/init.d$ sudo update-rc.d -f bitnami-LAMP enable
Failed to enable unit: Unit /run/systemd/generator.late/bitnami-LAMP.service is transient or generated.

what have I missed?

Hi again @enrico

Hmm that is weird. I’d like to know more about your issue, could you please share the output of the following commands?

$ ls -la /etc/init.d/bitnami-LAMP.sh
$ head -n 20 /etc/init.d/bitnami-LAMP.sh
$ lsb_release -a

Additionally, instead of running update-rc.d to enable the service, try this command instead:

$ sudo systemctl enable bitnami-LAMP

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

1 Like

The first instruction in the link you sent did not have the .sh extension.

i.e. it says “cp installdir/ctlscript.sh /etc/init.d/bitnami-APPNAME”
whereas I think it should say " cp installdir/ctlscript.sh /etc/init.d/bitnami-APPNAME.sh"

otherwise running your latest suggestions result in “file not found”

so I copied cp bitnami-APPNAME bitnami-LAMP.sh and tried again.

this time I got:

ricobasso@emachinesd620:/etc/init.d$ ls -la /etc/init.d/bitnami-LAMP.sh
-rwxr-xr-x 1 root root 389 Aug  3 10:46 /etc/init.d/bitnami-LAMP.sh
ricobasso@emachinesd620:/etc/init.d$ head -n 20 /etc/init.d/bitnami-LAMP.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides:          bitnami-LAMP
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable services provided by daemon.
### END INIT INFO
#!/bin/bash
su ricobasso -c "/home/ricobasso/LAMP/ctlscript.sh $@"
ricobasso@emachinesd620:/etc/init.d$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:        21.04
Codename:       hirsute


ricobasso@emachinesd620:/etc/init.d$ sudo systemctl enable bitnami-LAMP
bitnami-LAMP.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable bitnami-LAMP

so, it seems to be working at boot now. Many thanks for your help.
Might be a good idea to change that web page to include the .sh, no?

so, it seems to be working at boot now. Many thanks for your help.

My pleasure!

The first instruction in the link you sent did not have the .sh extension.
Might be a good idea to change that web page to include the .sh, no?

While you are right about the instructions, I highly doubt this is related to specifying the .sh extension. Instead, I reckon the systemctl enable command did the trick here :slightly_smiling_face:. Nevertheless, I’m not really sure why the update-rc.d didn’t work in your case…

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.