Score:0

How can I let apache server work always on my ec2 instance?

lu flag

I am learning aws's EC2 server. I configured apache and php. I started the apache server with the command

Sudo service httpd start

But every time I stop my pc, or the next day, when I want to continue the course. I have to start again the apache server. I mean it is not on started status always.

Imagine if I have a website running on that instance, it means that users won't be able to go on to my website. Or If want my website to be available every time, I don't have to logout from my aws account. Can you explain me what is the problem.

I am using the right now the 12 months free offer on aws. It's an Amazon Linux 2 with a Linux 4.14 version

berndbausch avatar
us flag
Does the AWS server run all the time? In this case, something kills Apache, perhaps there is an out of memory condition. Check the httpd logs and the kernel messages (Amazon Linux 2 seems to have systemd, thus `sudo journalctl -k -e` shows you the last kernel messages). Or if the AWS server gets rebooted, you have to ensure that httpd is started automatically, probably `sudo systemctl enable httpd`.
berndbausch avatar
us flag
By the way, serverfault is for problems with professional IT environments and is not the right place for asking your question. The best site is unix.stackexchange.com.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.