I am trying to configure an ec2 as my web server that will scale out under a load balancer, but as the httpd.conf comments say,
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User apache
Group apache
The default user and group for a standard Amazon Linux RMI are apache. I would like to change this to a user and group I have created, say, my-user.
As you'll know, the User/Data section of an ec2 can contain a bash script that will perform actions when the ec2 is provisioned. I have:
#!/bin/bash
yum install httpd24 mysql57 php71 php71-mysql\* -y
Is it possible to use CLI commands to change the httpd user and group from this bash script after installing httpd - or use environment variables in the httpd.conf?
In the end, I found this worked for me: