Install and Start httpd in AWS Launch Configuration
I'm trying to make a Launch Configuration for my AWS Cloud Environment.
I wan't to install httpd and start it up on the fly, when the autoscaling group spins up a new EC2 instance.
I can SSH into the instance manually and install httpd with:
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
But I can't make it happen, with the Launch Configuration under Advance Details -> User Data
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
Any ideas why it's not the same?
Update
After adding #!/bin/bash
as @Mark-B suggested, then service is kindda installed. It gives the following error when restarting the service. Maybe it could be a hint for you, to figure out what is wrong?
amazon-web-services amazon-ec2
add a comment |
I'm trying to make a Launch Configuration for my AWS Cloud Environment.
I wan't to install httpd and start it up on the fly, when the autoscaling group spins up a new EC2 instance.
I can SSH into the instance manually and install httpd with:
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
But I can't make it happen, with the Launch Configuration under Advance Details -> User Data
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
Any ideas why it's not the same?
Update
After adding #!/bin/bash
as @Mark-B suggested, then service is kindda installed. It gives the following error when restarting the service. Maybe it could be a hint for you, to figure out what is wrong?
amazon-web-services amazon-ec2
add a comment |
I'm trying to make a Launch Configuration for my AWS Cloud Environment.
I wan't to install httpd and start it up on the fly, when the autoscaling group spins up a new EC2 instance.
I can SSH into the instance manually and install httpd with:
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
But I can't make it happen, with the Launch Configuration under Advance Details -> User Data
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
Any ideas why it's not the same?
Update
After adding #!/bin/bash
as @Mark-B suggested, then service is kindda installed. It gives the following error when restarting the service. Maybe it could be a hint for you, to figure out what is wrong?
amazon-web-services amazon-ec2
I'm trying to make a Launch Configuration for my AWS Cloud Environment.
I wan't to install httpd and start it up on the fly, when the autoscaling group spins up a new EC2 instance.
I can SSH into the instance manually and install httpd with:
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
But I can't make it happen, with the Launch Configuration under Advance Details -> User Data
sudo yum update -y
sudo yum install httpd -y
sudo service httpd start
Any ideas why it's not the same?
Update
After adding #!/bin/bash
as @Mark-B suggested, then service is kindda installed. It gives the following error when restarting the service. Maybe it could be a hint for you, to figure out what is wrong?
amazon-web-services amazon-ec2
amazon-web-services amazon-ec2
edited Nov 23 '18 at 16:29
RedHawkDK
asked Nov 23 '18 at 15:57
RedHawkDKRedHawkDK
6028
6028
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
User-data can be used for more than running startup scripts. To indicate to the cloud-init process that the user-data is a script, you need to add this as the first line of your user-data:
#!/bin/bash
Hi Mark. That makes sense! Thanks. Any ideas, why the server still isn't starting up the same way, as when I start it up manually? sudo service httpd status --- > httpd (pid 2734) is running... so it apparently looks fine...
– RedHawkDK
Nov 23 '18 at 16:18
@RedHawkDK that second issue looks like a duplicate of this: stackoverflow.com/questions/5856205/…
– Mark B
Nov 23 '18 at 19:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53449702%2finstall-and-start-httpd-in-aws-launch-configuration%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
User-data can be used for more than running startup scripts. To indicate to the cloud-init process that the user-data is a script, you need to add this as the first line of your user-data:
#!/bin/bash
Hi Mark. That makes sense! Thanks. Any ideas, why the server still isn't starting up the same way, as when I start it up manually? sudo service httpd status --- > httpd (pid 2734) is running... so it apparently looks fine...
– RedHawkDK
Nov 23 '18 at 16:18
@RedHawkDK that second issue looks like a duplicate of this: stackoverflow.com/questions/5856205/…
– Mark B
Nov 23 '18 at 19:50
add a comment |
User-data can be used for more than running startup scripts. To indicate to the cloud-init process that the user-data is a script, you need to add this as the first line of your user-data:
#!/bin/bash
Hi Mark. That makes sense! Thanks. Any ideas, why the server still isn't starting up the same way, as when I start it up manually? sudo service httpd status --- > httpd (pid 2734) is running... so it apparently looks fine...
– RedHawkDK
Nov 23 '18 at 16:18
@RedHawkDK that second issue looks like a duplicate of this: stackoverflow.com/questions/5856205/…
– Mark B
Nov 23 '18 at 19:50
add a comment |
User-data can be used for more than running startup scripts. To indicate to the cloud-init process that the user-data is a script, you need to add this as the first line of your user-data:
#!/bin/bash
User-data can be used for more than running startup scripts. To indicate to the cloud-init process that the user-data is a script, you need to add this as the first line of your user-data:
#!/bin/bash
answered Nov 23 '18 at 16:03
Mark BMark B
100k15157172
100k15157172
Hi Mark. That makes sense! Thanks. Any ideas, why the server still isn't starting up the same way, as when I start it up manually? sudo service httpd status --- > httpd (pid 2734) is running... so it apparently looks fine...
– RedHawkDK
Nov 23 '18 at 16:18
@RedHawkDK that second issue looks like a duplicate of this: stackoverflow.com/questions/5856205/…
– Mark B
Nov 23 '18 at 19:50
add a comment |
Hi Mark. That makes sense! Thanks. Any ideas, why the server still isn't starting up the same way, as when I start it up manually? sudo service httpd status --- > httpd (pid 2734) is running... so it apparently looks fine...
– RedHawkDK
Nov 23 '18 at 16:18
@RedHawkDK that second issue looks like a duplicate of this: stackoverflow.com/questions/5856205/…
– Mark B
Nov 23 '18 at 19:50
Hi Mark. That makes sense! Thanks. Any ideas, why the server still isn't starting up the same way, as when I start it up manually? sudo service httpd status --- > httpd (pid 2734) is running... so it apparently looks fine...
– RedHawkDK
Nov 23 '18 at 16:18
Hi Mark. That makes sense! Thanks. Any ideas, why the server still isn't starting up the same way, as when I start it up manually? sudo service httpd status --- > httpd (pid 2734) is running... so it apparently looks fine...
– RedHawkDK
Nov 23 '18 at 16:18
@RedHawkDK that second issue looks like a duplicate of this: stackoverflow.com/questions/5856205/…
– Mark B
Nov 23 '18 at 19:50
@RedHawkDK that second issue looks like a duplicate of this: stackoverflow.com/questions/5856205/…
– Mark B
Nov 23 '18 at 19:50
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53449702%2finstall-and-start-httpd-in-aws-launch-configuration%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown