unable to install apache 2.2. Showing port 80 and 443 already in use - apache

unable to install apache 2.2.Showing port80 and 443 allreday in use.
Help needed
Asmita

You have a webserver running already. Assuming you're on some version of Linux (you don't say) you can identify the process running on that port using lsof.
lsof -i :80
See here for more detail

Related

XAMPP 7.2.8-0 Mac Apache web server update/install won't start anymore

I am running MacOS Sierra Version 10.12.6 and I have just tried to upgrade to the latest version of XAMPP on localhost.
I have just upgraded from XAMPP 7.1.10 to 7.2.8-0 by performing an install of the xampp-osx-7.2.8-0-installer.dmg file.
It appears now that I am getting a conflict between AVAST running on port 80
The system was working before running both AVAST and XAMPP 7.1.10 I assume on the default port of 80 but I did not check before the upgrade to 7.2.8
Disabling the AVAST Shields still resulted in processes on port 80
colins-iMac:phpmyadmin colinhart$ sudo lsof -i :80
Password:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
com.avast 29044 root 46u IPv4 0xf605aed3cc5db167 0t0 TCP colins-imac:61319->host213-123-242-66.in-addr.btopenworld.com:http (ESTABLISHED)
com.avast 29044 root 57u IPv4 0xf605aed3d4de9a5f 0t0 TCP colins-imac:61274->64.95.190.66:http (ESTA
and XAMPP also running on Port 80 by default, I have tried changing the port for XAMPP to an available one 80+ to no avail
I am desperate to get this working now as I am unable to develop, so any help would be much appreciated.
I will continue trying to fix the problem by reviewing answers to similar queries.
UPDATE I uninstalled AVAST and installed AVIRA, and yet the Apache Web server still stops soon after Starting
Thanks
Colin
The resolution to the problem having tried virtually all suggestions given by previous answers on this site, was to change the /etc/hosts file as suggested in this response
Unable to start XAMPP Apache server on MacOS-Sierra
To solve this :
Executed following command
sudo -e /etc/hosts
Then, changed following entries
127.0.0.1 localhost
::1 localhost
to
127.0.0.1 localhost MacBook-Pro.local
::1 localhost MacBook-Pro.local
where MacBook-Pro.local is the name returned by hostname command in terminal session
colins-iMac:~ colinhart$ hostname
colins-iMac
colins-iMac:~ colinhart$
in my case the name should be colins-iMac
Many Thanks
Colin
Deleting the lib folder from XAMPP files and reinstalling worked for me
Check this SOF answer

Apache configured to listen on port 80 only but instead listening on port 8080 as well

I was not able to use port 8080 because it was apparently already used.
In order to see which program was using it, I typed the following command in my terminal (on MacOS):
sudo lsof -n -i :8080
Here's the result:
httpd is also listening on port 80, which I found out by using the following command:
sudo lsof -n -i :80 | grep LISTEN
Here's the result:
So I went to find out what this "httpd"-process was. Apparently it is basically the web server installed on my machine. The web server installed on my machine is Apache2.
Given this fact I concluded that Apache2 was apparently configured to listen on port 80 AND on port 8080.
BUT: Here's the crazy thing: I went to the folder /etc/apache2 and opened the file "httpd.conf". In the file Apache is configured to listen on port 80 only !!!
Why the hell is it also listening on port 8080 ?!
How can I make it listen on port 80 only ?

RethinkDB: Port 8080 does not start after setting up system startup

I followed the guide on RethinkDB Documentation
After setting up RethinkDB on system startup on Ubuntu 14.04 server, port 8080 does not start.
I checked rethinkdb log.
2015-10-29T18:28:53.207447805 0.086002s notice: Listening for administrative HTTP on 127.0.1.1, 10.17.0.6, 159.203.115.29, 10.132.204.34
What am I doing wrong?
Maybe you already had something listen on port 8080 but only for 127.0.0.1, from your log, the server did listen on 127.0.1.1, 10.17.0.6, 159.203.115.29, 10.132.204.34.
Try to check your /etc/hosts to see if you assign something to 127.0.1.1 and check the binding
lsof -i :8080
Once you found out the program that listen on, try to remove/stop it from binding to that.
Also, you can try to run this command directly:
rethinkdb --bind all
to ensure that RethinkDB will bind to all ips.

Nancy Mono Self-Host won't start on port 80

I have a self hosted Nancy application running on a Raspberry Pi and I can't get it to bind to port 80!
It works on port 81, 8090 and I even tried other "reserved" ports such as 443. They all work except 80.
I'm starting the app with sudo so it shouldn't be permissions and 81 works too.
sudo mono Lambda.Console.exe
The obvious culprit for this is that something else is using port 80 but I can't find out what it is. I have tried the usual;
netstat -ln - nothing is listening on port 80
telnet port 80 - connection is refused, suggesting nothing is listening
Does anyone have other suggestions? Can a process still be using the port? I'm stuck at this point.
Cheers
Dave
This is bug in Mono HttpListener I created pull request here: https://github.com/mono/mono/pull/891
Unfortunately I did not find workaround I will try to find robust workaround in Nancy since versions releases are more frequent.
I also found a work around for the issue that involves mapping port 80 to the port your Nacy app has actually bound too.
sudo /sbin/iptables -t nat -A PREROUTING -i eth+ -p tcp --dport 80 -j REDIRECT --to-port 8080
You can undo this using the same command but using -D instead of -A and if you want to check it exists then use -C
Ideally it would be best to use the Nancy patch from #david-karlas or if it comes along a mono fix but if you have to use an old mono version with old Nancy version then this works too.

Why does running "apachectl -k start" not work, but "sudo apachectl -k start" does?

I'm working on my OS X with the default installation of Apache. For some reason, when I run the "apachectl" command without the "sudo" I get "no listening sockets available / unable to open logs." I'm guessing this is a permissioning thing, so can someone help me out? I'm using Apache 2.2.
Also, side question, where the the Apache script file that is basically the "exe" that linux executes? I'm trying to intergrate my server with Aptana Studio, and it requires the path to the Apache install. I know in Windows, this would be "C:\path\to\httpd.exe", but I don't know how this works in linux.
Is your server listening on port 80? (Usually) only root is allowed to open ports below 1024. Hence the need for sudo.
As you can see, lots of people wonder how to get around this. One possible solution is to perform port-forwarding on your router. (I'm assuming here that you are behind a router...). Then incoming connections on port 80 can be forwarded to e.g. port 8080. Thus only locally does one need to connect to port 8080. (There may be more elegant solutions... somebody else will post them.)
I think generally (on both OS X and Linux - I'm not sure which one you're referring to) the httpd binary is located at: /usr/sbin/httpd
If you need to be able to restart Apache, and you can't do so as root (for whatever reason..), then you may have to settle for a non 'well known' port.
try this
(with php)
$a = shell_exec('sudo -u root -S /etc/init.d/apache2 restart < /home/$user/passfile');
password should stored in passfile