0

Apache will not start. The command "sudo service apache2 status" lists these errors:

/usr/sbin/apachectl: 1: /usr/sbin/apachectl: id: not found /usr/sbin/apachectl: 98: [: -eq: unexpected operator /usr/sbin/apachectl: 147: /usr/sbin/apachectl: mkdir: not found /usr/sbin/apachectl: 126: /usr/sbin/apachectl: mktemp: not found /usr/sbin/apachectl: 127: /usr/sbin/apachectl: chmod: not found 

I checked this against the version of apachectl on a test machine and it is the same code. I tried running with sh, bash and dash ... but none worked. I don't think there is anything actually wrong with apachectl but something in my setup must be wrong.

Any idea how I can fix this error?

System ubuntu 19.04, apache 2.4

4
  • what is the output of which mkdir or which \[ ? Commented Oct 21, 2019 at 20:19
  • It looks as Your path or access permissions are broken or even some basic commands are missing. How did You try to start explicitly with sh or bash? At that place, check whether You can execute or find the mentioned binaries (i.e. which id, which apachectl, echo $PATH, ls -l /usr/bin/id)... Commented Oct 21, 2019 at 20:19
  • the first line is of apache2ctl is #!/bin/sh and ls -l /bin/sh lrwxrwxrwx 1 root root 4 May 20 2016 /bin/sh -> dash how does it look like at your system? Commented Oct 21, 2019 at 20:22
  • the trouble starts in envvars right after the line export PATH="/var/www/.local/bin" Commented Oct 22, 2019 at 16:07

1 Answer 1

0

The trouble was I destroyed the path. The PATH export should have read

export PATH=$PATH:/var/www/.local/bin 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.