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

已提问 5 年前2490 查看次数
1 回答
0
已接受的回答

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
已回答 5 年前
profile picture
专家
已审核 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则