I was following along with a tutorial on Youtube and everything was going well until I started the service for Apache24. I realized that something was running on port 80. I looked in my command prompt and I realized that there are two things that were with port 80. The first one was Apache24 which is listening to port 80 and the other is chrome which is established on port 80. What should I do?
Try finding out which service hogs port 80 and stop that service. Or, kill the offending process.
netstat -tulpen will show you which process (it's process ID is listed as PID on the very right of the output) uses port 80 (listed underneath Local Address, look for the :80 part). Note the PID.
Do a kill {PID}, so if the PID is, for example, 123, do kill 123. If that does not work, try to be be more ride and issue a kill -9 {PID}.
Related
My apache services are working on solaris server. It will be running normally for days but suddenly it hangs. httpd will shown process running but telnet localhost will not connect.
telnet localhost will only connect if you are running a local telnet server...I believe Sun started turning that off by default in Solaris 10.
telnet localhost 80 will try to connect to port 80, where your Apache server might be running. But many Apache configurations are not set to listen on localhost. Instead, try telnet XXX 80, where XXX is the IP number that Apache is listening on. You can see a list of the IP addresses on your current zone with ifconfig -a.
If Apache really IS hanging, you are going to need to gather more information, like
what happens when you telnet into it
what is the output of netstat -an | grep LISTEN | grep '\*\.80'
does it start working again when you HUP the main process (look for the pid which is the parent of all the others)
what is in the main Apache error_log?
Apache is extremely stable, and if it's hanging, you likely have a either an astable plugin, or somehow you are consuming too many of some resource (like you have a 1000-child limit and 1000 people doing http long poll or something)
So something is using port 80, I know this because I am trying to start a process that uses port 80 and it wont start because port 80 is occupied, I dont know what is using port 80, all I know is that it is being used and I need to end whatever process is using it so I can start this other process.
How can I do that? I already checked task manager and it says nothing is using port 80.
If you're familiar with the command prompt, you can type the following to see what is using port 80:
netstat -anb | findstr :80
Then you can use task manager to end the process that is using it (as long as you have permissions).
03:32:35[Apache]Problem detected!
03:32:35[Apache]Port 80 in use by "Unable to open process" with PID 4!
03:32:35[Apache]Apache WILL NOT start without the configured ports free!
03:32:35[Apache]You need to uninstall/disable/reconfigure the blocking application
03:32:35[Apache]or reconfigure Apache and the Control Panel to listen on a different port
03:32:35[Apache]Attempting to start Apache app...
03:32:35[Apache]Status change detected: running
As log said, Port 80 is already used by another process
to check wich process use port :
WINDOWS: netstat -a -b
LINUX : sudo netstat -tulpn (must run with root)
To change the port of Apache, you have to modify this file:
APACHE_INSTALLATION_PATH/conf/httpd.conf and change this configuration Listen 80 to the port you want to use, example : Listen 8085
N.B: in your browser you must type this url http://www.mywebsite.com:8085 instead of http://www.mywebsite.com ( == http://www.mywebsite.com:80)
You must restart your apache server
I think that skype is using port 80, but i'm not sure
After installing AMPPS for Windows, while trying to launch Apache I get an error saying,
Apache port:443 is being used by another application.
I do not have any other programs (that I know of) such as Skype that are currently running. How can I monitor my 443 port or change the port for Apache?
By the way, I have McAfee as an anti-virus.
Open command prompt(start -> run -> cmd) and type the following command :
C:\> netstat -aon | findstr 0.0:443
Last column of the output is the PID of the application using port 443.
You can find the application name in Task Manager. Go to Process Tab then in Menu Bar of Task Manager go to View -> Select Column -> Check "PID" and press Ok. Search for the PID in the list(Click Below "Show processes from all users" in case if you don't find the PID), corresponding process is the application which is using port 443. Stop or Uninstall it to make your AMPPS Apache work.
For terminate any process:
open cmd as administrator
netstat -aon | findstr 0.0:443
shows: TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 4876, NOTE THE PID 4876
taskkill /pid 4876 /f
For disable port of other program(vmware):
open VMware Workstation
Edit->Preferences...->Shared VMs->Change Settings->Yes->Disable Sharing
You can change the port. -> Ok
I was facing the same issue as on port 443, vmware service was running, i went to task manager and stopped the service and then started apache and it worked fine.
After getting the pid number using netstat -aon | findstr 0.0:443, if you are having trouble finding pid 443 in Task Manager then:
Kill the process 443 by using the cmd: taskkill /pid 443.
You will avoid downloading any software or any other headache.
Here is the more elaborated way to solve this issue based on comments from Jigar and Daniel Dropik(Thank You guys),
So check with which service you are getting this port issue, in my case it was with Apache and MySQL.
Starting with Apache, either click on "Logs" in XAMPP control panel and open error log to see the problem or go to XAMPP installation directory and run "apache_start.bat" batch file, this will also give to the problem cause.
Now you have got the Port number which causing trouble,
Now follow Jigar's comment and run
netstat -aon | findstr 0.0:443
Remember 443 is the port number so enter the port number causing the issue.
This command will give the PID of the process using the port like below,
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 4996
So 4996 is the process ID(PID) that you want to stop.
Now using Task Manager you could see and kill the process but some processes could not displayed by Task Manager, in this case you have to download Mycrosoft's Process Explorer, unzip the downloaded package and run the ".exe" file as an Administrator.
You will find a bunch of processes running, sort them using PIDs and you will find your service.
Select that service and stop it.
Then go to the XAMPP control panel and run Apache and you will be able to start it this time.
Follow same process for MySQL as well.
Enjoy :)
First off you must find the process using that port. we can find it with below command.
netstat -aon | findstr 443
then we might finish finded process either below command:
taskkill /PID PORTNUMBER /F
OR
you can go to taskmanager and find the process from process bar ( with swiching PID column) and click on end task.
go to Ampps\apache\conf\extra
open file httpd-ssl.conf with note++
change the port
Listen 443--->change port
VirtualHost default:443--->"change port **>
DocumentRoot "D:/Ampps/www"
ServerName localhost:443--->**change port
and saved
I'm using SSH to access my university's afs system. I like to use rmate (remote TextMate), which requires SSH tunneling, so I included this alias in my .bashrc.
alias sshr=ssh -R 52698:localhost:52698 username#corn.myschool.edu
It has always worked until now.
I had the same problem. In order to find the port that is already open, you have to issue this command on the 'corn.myschool.edu' computer:
sudo netstat -plant | grep 52698
And then kill all of the processes that come up with this (replace xxxx with the process ids)
sudo kill -9 xxxx
(UPDATED: changed the option to be -plant as it is a nice mnemonic)
I had another SSH connection open. I just needed to close that connection before I opened my SSH tunnel.
Further Explanation:
Once one ssh connection has been established, subsequent connections will produce a message:
Warning: remote port forwarding failed for listen port 52698
This message is harmless, as the forward can only be set up once and one forward will work for all ssh connections to the same machine. The original ssh session that opened the forward will stay open when you exit the shell until all remote editing sessions are finished.
I experienced this problem, but it was while connecting to a server on which I don't have sudo priviliges, so the top response suggesting runing sudo netstat ... wasn't feasible for me.
I eventually figured out it was because there were still instances of rmate running, so I used ps to list the running processes and then kill -9 pid (where pid is the process ID for rmate).
This solved my problem reported here as well. To avoid this notification "AllowTcpForwarding" should be enabled in SSH config.
In my case, the problem was that the remote system didn't have DNS properly set up, and it couldn't even resolve its own hostname. Make sure you have a working DNS in /etc/resolv.conf at the remote system.