Is there a way to restart Apache after boot?

On this XP PRO PC, IIS is using port 80, and Apache 2.2 is using port 8080.  When the computer is started, Apache dies because the port isn't available at that time.  A restart works okay.  I guess this is due to IIS being started at the same time.

So is there a way to schedule Apache to be restarted a minute after boot, or whenever it fails?  Or delay it's automatic start?  
wilri01Asked:
Who is Participating?
 
ncooConnect With a Mentor Commented:
In your conf you have?

Listen 1.2.3.4:8080

Change that just to

Listen 8080

It's what I use on server 2003 with out any problems, even with windows updates causing restarts.

A script could be written to run in the background that starts apache when it's not running.

A VB script should be able to do it.

Try the conf change first. Do you have anything else in your conf file, virtual hosts?
0
 
ncooCommented:
Have you installed apache as a service?

if not goto Run and type CMD.

Navigate to your apache/bin forlder in CMD

Type: httpd -k install -n "Apache2"

Under control panel goto Admin Tools -> Services

Find Apache2 double click it and choose startup Type: Auto

Apply and Ok.

Any restart of windows will start apache.
0
 
ncooCommented:
If apache is already a service.

Under control panel goto Admin Tools -> Services

Find Apache2 double click it and choose startup Type: Auto

Apply and Ok.

Any restart of windows will start apache.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
wilri01Author Commented:
Apache starts, but has an error.  What I need, asuming I can't fix the error, is to do a restart a little later.  The error is something like the port 8080 isn't available to listen on.  Evidently, Apache is trying to start before networking gets up fully.
0
 
ncooCommented:
I've never known apache have to wait for networking, I am running it under XP and Server 2003 with out any issue like this.

Can you open your httpd.conf file and confirm it says:

Listen 8080

Have you got multiple instances of Apache running? Open Apache Monitor to check.

Can you paste the details from the apche error log, look for "ErrorLog" driver/folder/file in your conf file if you're not sure where it is located

Do you have any other applications installed running on 8080?

0
 
wilri01Author Commented:
The listen is on ipAddress:8080.  This is the only application using the port. Like I said, it works later on a restart of Apache.  And the error is that this port is not available.  The computer is on a large LAN, so I'm guessing network connections are simply not established yet.  The error log previously showed that even the domain controller could not be found and Group Policy could not be applied.  Yesterday we had a 1 second power hit and when the machine restarted, it worked okay.  The problem is when a Windows update is pushed that requires rebooting, or a more serious power outage.

This is the first time I've experienced this myself, but it's also the only machine where IIS is also running (on port 80).

So you don't know of a way to use Windows Task Scheduler to do an Apache restart shortly after a computer boot?  Maybe a script that does a wait for 30 seconds and then issues the restart?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.