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

demandé il y a 5 ans2490 vues
1 réponse
0
Réponse acceptée

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
répondu il y a 5 ans
profile picture
EXPERT
vérifié il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions