Page 1 of 1

Changed port in httpd.conf, worked until I rebooted...

PostPosted: 29. December 2007 22:14
by shifuimam
I'm on XP/Pro SP2. I have IIS running for another (ASP) site I'm working on.

I changed httpd.conf to use port 8080, since IIS was using 80. This worked just fine...until I rebooted. Now the XAMPP control panel appears to try to use port 80 to start Apache. If I stop IIS, I can get XAMPP to start Apache on port 80.......except that it's not *actually* using port 80, since I still have to put http://localhost:8080 in my address bar to get to the site that is hosted on XAMPP.

Am I missing something here? I was under the impression that XAMPP would just use whatever was in httpd.conf when starting Apache...

Any help is appreciated. Thanks!

PostPosted: 29. December 2007 22:56
by Scory
>Now the XAMPP control panel appears to try to use port 80 to start Apache

Why do you think that? Is there a related message? Or similar?

PostPosted: 29. December 2007 23:44
by Izzy
There are 2 locations to change in the httpd.conf file:

Listen 80
to
Listen 8080

And

ServerName localhost:80
to
ServerName localhost:8080

The latter is the entry often overlooked.

Save the file and restart Apache to have the edits recognized and always make a backup of conf and ini files before editing.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 29. December 2007 23:46
by shifuimam
I changed both the listening and the server port - there is no mention of port 80 anywhere in httpd.conf.

When I start Apache, the output window in the XAMPP Control Panel says "Apache started [Port 80]" - then it shuts off without giving any other messages until I turn off IIS and start it, which works since port 80 is freed up.

There's not a mention of port 80 in my Apache error log, either. There are several lines about port 8080, however...

PostPosted: 29. December 2007 23:59
by Izzy
Did you set the server to start as a service at any time without subsequentlty uninstalling the Apache Service - which is evident after you rebooted your PC which would have reinstalled the Apache Service on port 80.?

If so then follow this to remove the old service:

Double click on the xampp\apache\apache_uninstallservice_2.2.bat
and/or
apache_uninstallservice.bat

If that fails to uninstall the Apache Service try this which will remove the old Apache service.

Close/Exit the control panel.

Open a command prompt
Click start
Click on Run...
Type: cmd.exe

Remove old or sticking services.
Apache
Type:
sc delete apache2.2
Click OK

Close the command console

Start the control panel and try again or use the bat file provided in the xampp directory to give feedback on any errors it encounters during start up.


BTW - sc is an acceptable abbreviation for sc.exe Windows Service Controller and will delete any stray services that won't shut down by any normal means, among other services commands.

Microsoft explains the Service Controller Commands here.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 30. December 2007 01:19
by shifuimam
This is the error I got when I ran that batch file:

Code: Select all
System error 1060 has occurred.

The specified service does not exist as an installed service.


So, I'd venture to guess that Apache isn't running as a service...

The other command you mentioned didn't work either, since Windows doesn't see Apache2.2 as a service. When I restarted XAMPP after this, it still shows that it's starting Apache on 80 (but serving content on 8080).

PostPosted: 30. December 2007 01:29
by Izzy
You did not mention what version of XAMPP you are running so I took a guess that you had the latest version with the module Apache 2.2.

The messages are saying that there is no Apache service installed which is what we want to hear, but your original thread message indicated that, after booting, a service was being started - hence the posts about removing the Apache service if it was installed.

But just to check, after you reboot and before you attempt to start any of the XAMPP Modules look in your Windows Task Manager for any instances (2) of apache.exe.
Right click on the Task Bar and select Task Manager then select the Processes tab.

You can do this again after starting Apache and you should see 2 apache.exe processes running - Apache has started and for you on port 8080.

You can also check this by reading the xampp\apache\logs\error.log file.
It should tell you what ports Apache is listening on - for you it should read 443 and 8080.



Depending on your XAMPP version just entering sc delete apache may have been required.

Also make sure the Svc box next to the Apache Module in the Control Panel has no tick in it.

BTW - you will always have to type http://localhost:8080 in your browser to get to the XAMPP Welcome page after changing the httpd.conf file.
It will not work by simply typing in http://localhost and you can ignore any messages in the XAMPP Control Panel about port 80 as this is normal and would need to be changed by the Control Panel developers - the messages are hard coded in the exe file and are not obtained from the server, like the server's log files are.

If you are using XAMPP Control Panel Version 2.5 there is an ini file in the xampp directory perhaps called xampp.ini
Note that Version 2.5 now also honors an xampp.ini file (see included sample).

You can change the ports in it to reflect 8080.
http://www.nat32.com/xampp/index.htm

Download the http://www.nat32.com/xampp/xampp25.zip file for the latest version and the source code.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 30. December 2007 17:37
by Scory
Instead of using the Control Panel of Xampp, start a command shell (cmd.exe), "cd" into the apache/bin folder (i.e. "c:\program files\xampp\apache\bin") and start Apache manually by simply typing "apache" and hit return.

Apache will tell you why it does not start up, so can see the reason for the problems. It maybe due to Port 80 occupation, but maybe also completely different reason. Be sure that IIS is running before doing your tests.

Greets
Scory

PostPosted: 03. January 2008 06:23
by Minks
Hi,

I've similar problem. And despite correcting the necessary steps I still can't run my local xammp.

The strange thing is that I was using it with on problem for 8 months until I did a spyware scan. Now I apache is always busy at port 80.

Is there anywhere I can rectify the problem. I really miss using my xammp.

Thanks

PostPosted: 03. January 2008 06:57
by Izzy
Is there anywhere I can rectify the problem. I really miss using my xammp.

Not until you provide much more detail of your problem and exactly what you tried to effect a solution - the forum volunteers who provide help to other members don't like to have their time, which they donate free of charge, wasted.

BTW - I find it strange that the original poster was on line browsing this forum just seconds before you signed up and posted your question and even stranger is that you both share the same IP????

PostPosted: 03. January 2008 07:15
by Minks
Solve my own problem. I disable skype. That's the good new.

The bad news is that I deleted my xammp before the solution. In actual fact, I didn't even have to go through all those http config and stopping service routes.

Believe it or not, I never came to this forum before and certainly do not know or related to the original poster. My ISP provides their users with dynamic IPs, so maybe you could tell them to stop doing so!

And sorry if I was such a bother! Don't worry I won't bother you again and you can ban me from coming by if you feel that I'm a nuisance or whatever.

Again, so sorry that I've wasted your previous time!