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
전문가
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠