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

preguntada hace 5 años2491 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
respondido hace 5 años
profile picture
EXPERTO
revisado hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas