Apache won't start

13 posts / 0 new
Last post
#1 Fri, 04/29/2016 - 16:14

Apache won't start

Hi all, I have installed Webmin and VirtualMin on a new server today (CentOS 6.7).

I have created a virtual server and uploaded a site (I haven't changed the DNS settings against the domain hosted elsehwere just yet).

When I try to preview the site, it just goes to a blank page with an error.

I think this is because apache isn't running.

I've tried to start it but get the following:

Starting httpd: (98)Address already in use: make_sock: could not bind to address no listening sockets available, shutting down Unable to open logs [FAILED]

Can anyone help please?

Many thanks, Craig

Fri, 04/29/2016 - 17:57

Address already in use = apache's already running. Confirm that with ps -x | grep apache or look at "System Information" status page. In recent days, another admin had a blank page due to a Python issue. Click "Support" atop this page and you can search for it.

Fri, 04/29/2016 - 19:17


Yup, as AustinTX mentioned, it sounds like there may be an existing Apache process running... we've seen those occasionally get "stuck". It should just be a matter of killing that process, then restarting Apache.


Sat, 04/30/2016 - 01:41

Thanks for the replies.

The status information page shows that apache isn't running, and when I try to run, I get the initial error.

It also shows that httpd isn't running in Bootup and Shutdown, and then I try to start it, I get the same error.

I tried ps -x | grep apache but got the following: Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ 3351 pts/0 S+ 0:00 grep apache

If I run the following via SSH, i get the same error: /etc/rc.d/init.d/httpd start.

Starting httpd: (98)Address already in use: make_sock: could not bind to address no listening sockets available, shutting down Unable to open logs

Please help, I'm getting a bit desperate! :(

Should I scrap it all and start again from scratch?

Sat, 04/30/2016 - 02:14

Well, as a Linux admin, you are familiar with ps and using it to get the process number to kill. Remember some versions of ps don't like a dash, and others don't care if it's there or not. Try the command again with variations. Look up how to find a running process on your version of Linux, and then kill -9 apache2 (or apache or httpd) then restart it as andreychek suggested. 8^D

Also, your uploaded website might just not work until you access it by domain name. How are you browsing to it? By raw IP address? Put an entry for it in your HOSTS file so your PC's browser will send the right headers to the test web server at it's current location.

Sat, 04/30/2016 - 02:52

Thanks for the reply. I'll be the first to admit i'm still learning all of this.

I have 2 other servers that seem to be running ok with no issues like this at all. One has the same version of CentOS.

I'm wondering if there is something wrong with this server installation?

I've ran the ps command and it returns: 5703 pts/0 S+ 0:00 grep apache

Does that help at all?

If I do ps aux | less apache, it returns:

craigs 6309 0.0 0.0 103304 896 pts/0 S+ 09:49 0:00 grep apache

I'm trying to preview the website from VirtualMin by going to Services --> Preview Website.

Again I have no issues on my other servers doing this, before I have altered the DNS settings against the domain.

I've checked the httpd status in SSH, and it says it is stopped. When I try to start, I get the same error! :(

I don't know what to do.

Sat, 04/30/2016 - 03:24

Sorry, the two ps searches you performed only showed the grep command you had issued to filter for "apache". Apache itself doesn't appear to be running.

When you use the Preview Website link, look on the status bar of your browser. I think you will see it is referring to it by domain name, which will not work until you update your domain registration to point to the IP of your Virtualmin server. Or put a suitable line in your workstation's HOSTS file so the hostname will work, from your workstation, for testing purposes: domain.com

I don't know why you can't start Apache on this server. Perhaps when you installed it you selected Nginx to try it out? There was an issue with the repositories yesterday - you might have built your system before that problem was fixed. You could scrap and rebuild your Virtualmin server over again (shouldn't really take long), or you could clone your other CentOS VM server and change it's hostname.

Sat, 04/30/2016 - 03:37

I think I'm going to scrap it and rebuild.

Can I just confirm the order that I did things yesterday.

As soon as the server was available.

1/ Create new user with sudo permission and disable root access. 2/ Upgraded the PHP version using the instructions in the webmin doc for multiple php. 3/ Install webmin using these instructions:

wget http://software.virtualmin.com/gpl/scripts/install.sh sudo /bin/sh install.sh

4/ Logged into Webmin then created the virtual server.

Should that be ok?

When previewing the website, the url is in this format: https://xxx.xxx.xxx.xxx:10000/virtual-server/link.cgi/xxx.xxx.xxx.xxx/ur...

I've done this in the past for domain names where I haven't altered anything, just to try out the site on a new server before moving it.

Sat, 04/30/2016 - 03:53

I can't imagine those steps would cause any problem but I'm not a developer just a guy who uses VM like you. Let us see if an expert can think of possible issues.

Sat, 04/30/2016 - 08:10

I just had a thought about something that I had to do differently this time, to what I did before when I installed virtualmin.

During the installer, it asked for a fully qualified hostname. I wasn't certain, but I entered the name of the server... Was that a mistake?

Sat, 04/30/2016 - 09:30

I generally suggest troubleshooting the problem you're experiencing rather than starting over, as starting over doesn't guarantee the problem will be fixed.

But in general when doing an install, I'd suggest installing your distro, then immediately installing Virtualmin before anything is changed.

Once Virtualmin is installed and working, then you can do additional things, like setting up a second PHP version.

Also, an FQDN is something like "host.domain.com" -- it's the full name you're going to give your server.


Sat, 04/30/2016 - 09:38

Well, I've literally just got one step further now, by comparing the httpd conf file from one server that is working, to this one.

It turned out that on the working one, it is only listening on port 80, not 80 and 443 like this one.

So I altered the file to only listen on port 80, and it started, and the website previews!!

So, is this bad practice?

Sat, 04/30/2016 - 15:38

Hmm, connecting the dots here; your website shows as blank page until https support is disabled - perhaps the problem comes down to your browser blocking "mixed content" and not giving you any visual indication. Since you uploaded this website for test purposes and enabled https, you might need to see that it has an appropriate encryption certificate. Go to Server Administration, Manage SSL Certificate and generate a new self-signed cert to overwrite whatever is in play.

Topic locked