I have an ubuntu 10.4 installation with apache2 running by default in port 80. I want gae to respond to that address instead of apache. I have changed the conf files for apache in order to use another port but still the 80 port gets bind to it. Despite if I stop apache /etc/init.d/apache2 stop still getting responses from the port. Am I missing something?

link|improve this question

80% accept rate
'I have changed the conf files for apache in order to use another' Could you be more specific? – Casual Coder Oct 2 '10 at 10:50
I have edited /etc/apache2/ports.conf and added the line Listen 8500 in and put in comments NameVirtualHost *:80 – Chris-Top Oct 2 '10 at 12:17
What about original line Listen 80 ? Or have you just changed Listen 80 to Listen 8500 ? If you have no Listen 80 in your /etc/apache2/ports.conf then some other app is listening on that port. – Casual Coder Oct 2 '10 at 12:35
feedback

2 Answers

up vote 0 down vote accepted

Find who use 80 port

netstat -anltp | grep \:80

Kill it:

kill `netstat -anltp | grep \:80 | sed -e 's/.*LISTEN[ ]*\([0-9]*\).*/\1/'`
link|improve this answer
bash: kill: 69.59.196.211:80: arguments must be process or job IDs, I get several errors like that. I don't like the idea of shutting down everything though :) – Chris-Top Oct 3 '10 at 11:25
Find netstat -anltp | grep \:80, and kill PID – bindbn Oct 3 '10 at 12:40
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - I guess this is the one that I should kill but there is not pid only a dash. I want to bind my localhost address is this going to respond to 127.0.0.1? – Chris-Top Oct 3 '10 at 13:07
Try: ss -anp | grep \:80 – bindbn Oct 3 '10 at 13:32
feedback

Stop Apache if you still want it to run on 80:

sudo apache2ctl stop

Then run GAE as sudo using python 2.5:

cd <google_app_directory> 
sudo python2.5 dev_appserver.py -a 127.0.0.1 -p 80 /home/<your_username>/<app_directory>

This works great for me as i often use apache on 80 as well so i can switch between the two when required.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.