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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

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
ncooCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.