Linux Error on httpd restart - systemctl: command not found

0

Hi,
Received that error when running in BASH:

$ sudo systemctl restart httpd

I need to restart based on adding new <virtualHost>'s

running:

$ cat /etc/os-release

VERSION="2018.03"
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"


Can this be done via the EC2 instance by selecting instance, then "instance state"->"reboot"??

thank you in advance for any guidance that can be offered.

best,
Brian

Edited by: windandkitesurfer on Jun 16, 2019 1:27 PM

Edited by: windandkitesurfer on Jun 16, 2019 1:29 PM

Edited by: windandkitesurfer on Jun 16, 2019 1:31 PM

posta 5 anni fa2490 visualizzazioni
1 Risposta
0
Risposta accettata

Hello,

The systemctl command is provided by the systemd package which is not available on Amazon Linux 2018.03.
Instead you can use the service command to restart the Apache server.

sudo service httpd restart

I recommend to check the configuration first.

sudo service httpd configtest

To use systemd with Amazon Linux, you can use Amazon Linux 2 with provides systemd and the systemctl command https://aws.amazon.com/amazon-linux-2/.

Thanks,
Paul

AWS
con risposta 5 anni fa
profile picture
ESPERTO
verificato un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande