Score:0

How do I restart a web server used by WordPress running on AWS EC2

mc flag

I have inherited ownership of an AWS EC2 instance running WordPress. I am unfamiliar with Unix. I do not know how WordPress was installed. I do not know how to check what web server is running. WordPress is telling me I should upgrade to a new version of PHP. I have not been able to connect to the AWS EC2 instance with an RSA key (a different issue) so instead have been logging into AWS and am using Amazon Cloudshell.

I have followed a set of steps to enable PHP version 8.2 which I think has worked as:

sudo amazon-linux-extras | grep php

_ php8.0 available [ =stable ]

_ php8.1 available [ =stable ]

68 php8.2=latest enabled [ =stable ]

WordPress tells me the site is running PHP 7.0.30 and I expected to see that version in the php list but it didn't appear.

After enabling php8.2, WordPress still flags that I should upgrade to a new version of PHP. The last step in the instructions I've been following is to "Restart your Webserver". I have tried the command to do this but it did not work:

sudo systemctl restart httpd

Failed to get D-Bus connection: Operation not permitted

which httpd

/usr/bin/which: no httpd in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/node_modules/aws-cdk/bin:/home/cloudshell-user/.local/bin:/home/cloudshell-user/bin)

What do I need to do to restart my web server?

in flag
Are you sure the server is running Ubuntu? The Apache web server is not called `httpd` on Ubuntu-based servers
ant777 avatar
mc flag
Thank you. I got an email from Amazon yesterday telling me I am running Ubuntu 18.04 LTS and its time to upgrade, so pretty certain I am running Ubuntu. I saw something that suggested I use sudo systemctl restart apache2 for Ubuntu, but got the same D-Bus message.
ant777 avatar
mc flag
I've just managed to figure out how to get my RSA key working properly and was able to connect to the AWS server. I discovered the installation is bitnami and the command to restart the web server is: sudo /opt/bitnami/ctlscript.sh restart apache. Sadly I've now discovered that all the php updating I've done before this doesn't affect bitnami installs and it looks like updating php involves starting a new server and migrating stuff to it. Anyways, I've answered my own question.
I sit in a Tesla and translated this thread with Ai:

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.