Thanks for your help. I recently did the following:
- Ran
sudo yum update
on my ec2 instance running the Amazon Linux ami - I then added a virtual host to my vhost.conf for a subdomain.
- While the server is still accessible, When I ran
sudo httpd restart
I received the following:
.
Stopping httpd: [FAILED]
Starting httpd: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:1
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
[FAILED]
Also, if I run the restart command without sudo service httpd restart
I receive the following message:
rm: cannot remove `/var/run/httpd/httpd.pid': Permission deniedLED]
rm: cannot remove `/var/run/httpd/httpd.pid': Permission denied
Starting httpd: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:1
(13)Permission denied: AH00058: Error retrieving pid file /var/run/httpd/httpd.pid
AH00059: Remove it before continuing if it is corrupted.
[FAILED]
Best Answer
From what you have provided seems that there is another process using port 80
Try to do the following:
First you need to be a root user to execute them, either you add sudo before the command, or before doing anything, switch to the user root like this:
and type the root password.
Then, proceed with:
The above command displays list of connections that are using port 80
Then execute the following command to kill the process that is using port 80
Replace process id with the process number that is shown on the screen from the previous command.
Then execute this command to start httpd process:
If the above did not work with you then try thisTry this i have just tested it:
Then perform the restart: