How can I run Apache Http Server? - apache

I am using Windows 7(32-bit OS).I downloaded httpd-2.4.4-win32-ssl_0.9.8.zip using the following link
The followed same rules,According to the following link
I got following error while server starting time.
<OS 10048> Only one usage of each socket address <protocol/network address/port> is normally permitted. :make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, Shutting down.
so, I changed port number in Apache/conf/httpd.config following way.
Find the Server Root:
Listen 80
Changed it to :
Listen 20
Find server root:
#ServerName www.example.com:80
Changed it to :
ServerName localhost:20
after this, I Re-installed .This time I didn't get any errors.I started server and open the following URL in browser but it's not working.
http://localhost/20
for my conformation,I open cmd and typed netstat -a -o. it showing port 20 is activating state.
How can i fix this?
Thanks

Related

Monit Httpd interface not working

I am trying to use httpd interface to view monit results in web browser.
I have used the below commands in my monitrc file.
set httpd port 2812
allow monit:monit
But when i try to log into web browser with http://localhost:2812/
The page fails with page not found error.
I have ensured that there is no firewall restriction for localhost:2812 port and also from the local host, the port is listening for monit.
$netstat -nlpt |grep 2812
tcp 0 0 0.0.0.0:2812 0.0.0.0:* LISTEN 42291/monit
I dont even get any failure logs under monit.log
Appreciate your help on this concern.
If you want to be able to access from "localhost", you need also the following line:
set httpd port 2812
allow localhost # <-----
allow monit:monit
Regards
Reference: https://www.mmonit.com/monit/documentation/monit.html#MONIT-HTTPD

Error during Apache Installation

I am just integration all the three as mentioned here
While installing apache,
Listen 127.0.0.1:80
is added in httpd.conf It says
(OS 10013)An attempt was made to access a socket in a way forbidden by its
access permissions. : AH00072: make_sock: could not bind to address
127.0.0.1:80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
I just checked what process is using port 80
netstat -tna
shows pid 4 is using
When i check
tasklist
it says SYSTEM process is using.
How do i make use of system port 80 for apache? How do i resolve this error?
Open a CMD prompt (as Admin) and type this iisreset /stop

Port 443 in use by "Unable to open process" with PID 4

I have a very strange problem with my Apache 2.4 working with Xampp 1.8.2 on Windows Server 2008 R2.
When I tried to start Apache server in XAMPP, an error message is shown:
[Apache] Problem detected!
[Apache] Port 443 in use by "Unable to open process" with PID 4!
[Apache] Apache WILL NOT start without the configured ports free!
[Apache] You need to uninstall/disable/reconfigure the blocking application
[Apache] or reconfigure Apache and the Control Panel to listen on a different port
However, the process with PID 4 is system! I've tried to restart my computer and it doesn't work.
I have installed Apache 2.4 via a tar.gz file sereral days ago, and uninstalled it. So, I don't think this behavior will cause the problem.
And here's the result using commond netstat -a -n -o | findstr 443
C:\Users\Administrator>netstat -a -n -o | findstr 443
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 4
TCP [::]:443 [::]:0 LISTENING 4
Can you tell me what to do?
Just change the sll port in httpd-ssl.conf file. It would be under C:\xampp\apache\conf\extra.
Find "443" and replace it with other values(e.g 8181), then start your apache again
I had the same problem: port-443-in-use-by-unable-to-open-process-with-pid-4
First I disabled the weather tile in Win* that apparently phones home to Redmond for updates after this showed on netstat list.
This didn't solve the problem. I looked at the post already here which mentioned VPNs, so
I went to Control Panel\Network and Internet\Network and Sharing Center and clicked on Change adapter settings
I clicked on Incoming Connections and right clicked on properties
The VPN click box at the bottom of the General tab was on, so I unchecked it
Under Users, I also unchecked a previous user I had allowed to copy some data weeks before
Then I clicked okay
Closed the control panel and restarted the XAMPP control panel
It fired right up without a problem.
Similarly, I experienced this:
Port 443 in use by "Unable to open process" with PID 6012!
When starting XAMPP Control Panel v3.2.1 for the first time.
In Task Manager I found that PID 6012 was Apache web server.
A copy of it was running in the background without the GUI,
and when I invoked the GUI it was trying to start another copy.
Killed the phantom copy and then XAMPP started up fine.
I didn't have to change any port settings.
Modify this
LocalDisk **>>** xampp **>>** apache **>>** conf **>>** httpd.conf
Line 58: Listen **80**
for this
Line 58: Listen **8080**
Modify this:
Line 220: ServerName localhost: **80**
for this
Line 220: ServerName localhost: **8080**
Modify this:
LocalDisk **>>** xampp **>>** apache **>>** conf >> extra **>>** httpd-ssl.conf
Line 36: Listen **443**
for this
Line 36: Listen **444**
Modify this:
Line 121: <VirtualHost _default_:**443**>
Line 125: ServerName www.example.com:**443**
For this
Line 121: <VirtualHost _default_:**444**>
Line 125: ServerName www.example.com:**444**
Simply run as Administrtor "xampp-control.exe"
I had the same problem. Another way to solve this problem when running XAMPP on Windows:
Open a CMD prompt and type in command:
net stop was /y
Run Dialog Box (press keys Win+R)
.. then type: services.msc
I then scrolled down to:
World Wide Web Publishing Service
Double clicked on it and clicked STOP (if this service status is Started)
3.Start Apache again with XAMPP :)
Link Ref: http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
Some process is using this port, so you can change the port that is used by xampp, to be able to use it.
For this job you have to do this:
1- Open httpd-ssl.conf in xampp\apache\conf\extra
2- Look for the line containing Listen 443
3- Change port number to anything you want. I use 4430. ex. Listen 4430.
4- Replace every 443 strings in that file with 4430.
5- Save the file.
Probably some process is using that port, i would guess you have another webserver running with ssl/tls already. You must trac down what process is using the port and shut it down. The fact that it does not help to restart your computer makes me think that you may find what you are looking for in msconfig. Try to have a look there, open prompt and write msconfig
post 443 is normaly used by secure http, => https
I have never used windows server but there could be some built in webserver that autostarts, have you ever installed another webserver?
Try use the command Netstat -a -n -o to see what process that is blocking. you can the process pid from the output.
The
Routing and RAS - service is your problem i guess look at this post
it does this, thats why its blocking:
SSTP tunneling protocol
Secure Socket Tunneling Protocol (SSTP) is a new form of virtual private networking (VPN) tunnel with features that allow traffic to pass through firewalls that block PPTP and L2TP/IPsec traffic. SSTP provides a mechanism to encapsulate PPP traffic over the SSL channel of the HTTPS protocol. The use of PPP allows support for strong authentication methods, such as EAP-TLS. The use of HTTPS means traffic will flow through TCP port 443, a port commonly used for Web access. Secure Sockets Layer (SSL) provides transport-level security with enhanced key negotiation, encryption, and integrity checking.
from tecsupport.ms
Below steps by sztupy worked for me
I went to Control Panel\Network and Internet\Network and Sharing Center and clicked on Change adapter settings
I clicked on Incoming Connections and right clicked on properties
The VPN click box at the bottom of the General tab was on, so I unchecked it
Under Users, I also unchecked a previous user I had allowed to copy some data weeks before
Then I clicked okay
Closed the control panel and restarted the XAMPP control panel
I simply went to the XAMMP config button in the XAMPP control panel GUI and clicked on Server and Port settings and I changed the SSL port value.
I had the same problem when I installed xampp on Windows 7. I installed Windows server and Web Deployment Agent Service (MsDepSvc.exe) which uses port 80. So I had an error PID 4 listening to port 80 when I ran apache.
Solution
Open task manager: (Ctrl+Shift+Esc) then find "MsDepSvc.exe" and disable it. Finally restart xampp
ref: http://www.honk.com.au/index.php/2010/10/20/windows-7-pid-4-listening-port-80-apache-cannot-star/
Here it was the "Work Folders" feature having been added on a Server 2012 R2. By default it is listening for HTTPS client requests on port 443 via the "System" process.
There is a Technet blog post explaining how to change that port number. Don't forget to add a corresponding firewall rule for your custom port and disable the existing one for port 443 though.
I got this same error and managed to fix it by closing Skype and running XAMP as Administrator, works perfectly now. So right click THE XAMP icon and click run as admin.
The port is being used by another process,
PID 4 means it is Windows System, you can open a cmd window with "super user/administrator" priviledges and write "net stop http", it will stop all the web services. Then check if it freed the port.
I had the same problem and it happened to be the "Routing and Remote Access Service". You open Services in the windows search, and then look for the specific service name. Change the startup of it to manual or automatic (whatever you decide).
Use some app like TCPView to help what port each App PID is using.
The origin of the problem seems to be Microsoft not knowing what the word disable Microsoft VPN means...
I ran task manager and looked for httpd.exe in process. Their were two of them running. I stopped one of them gone back to xampp control pannel and started apache. It worked.
I had the same problem and solved by doing following.
Go to Task Manager, click on services tab, order by pid's than if you find the related process, kill it otherwise, right click and click on show details, the process should be shown now. order by pid's than kill the related process.
I had this same problem with port 443, process id 4 and everything. For me it was not the VPN using the port, it was IIS. To fix this I opened up IIS and right clicked on my instance and stopped it. Then IIS Express(Or apache if you're using that) was able to use port 443. Hope this helps someone else.
I had a similar issue where port 443 was blocked by PID 4. After breaking my head for several hours I found the command netsh show urlacl which gave me an idea of the system process blocking the port.
To run command run cmd or windows shell in administrator mode.
netsh
http
show urlacl
I got response a which showed 443 was blocked by NT Service SSTPSvc Reserved URL
Response
https://+:443/sra_{BA195980-CD49-458b-9E23-C84EE0ADCD75}/
User: NT SERVICE\SstpSvc
Listen: Yes
Delegate: Yes
User: BUILTIN\Administrators
Listen: No
Delegate: No
User: NT AUTHORITY\SYSTEM
Listen: Yes
Delegate: Yes
With this information I followed the microsoft link to change the listening port for SSTP based vpn. https://support.microsoft.com/en-in/kb/947032
This resolved my port issue.
A simple way to fix this is to change the XAMP port to a random number.
The solution by "Mark Seagoe" worked for me too.
I got a message that "Port 443 in use by Unable to open process with PID 14508".
So i opened task manager and killed this process 14508. This was used by my previous xampp version and it was orphaned.
so no need to change any ports or anything, this is a simple two step process and it worked .
STEPS
Un-install apache(xampp) software from your windows.
Delete the xampp folder from c folder.
Delete the folder from recycle-bin to permanently delete the xampp folder
Restart your computer.
Finally install a clean copy of apache(xampp) software.
(By Engineer Rafiq Ahmad Qureshi)
qureshi.rafiq111#gmail.com

Apache on Windows not releasing port 80 on service stop, and will not restart

When I try to restart Apache it throws the following error:
============================================
Apache 2 is starting ...
(OS 10048)Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden.
: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
=============================================
I used netstat, and found that the PID holding port 80 was the same PID that Apache was previously using. This PID does not show up in task manager, and it is not found when taskkill is attempted on it.
It seems that Apache is somehow holding onto the port on exit. The only way I can restart the Apache service is by changing the Listen port each time, or by restarting the server itself.
Has anyone come across this before, and if so, is there anything I can do to fix it?
If this is a windows machine then apps like apache usually are lanuched as a service.
You can close it with
CMD+R -> services.msc , search for
apache and press stop
or
cmd -> net stop apache
or
cmd -> net stop apache2

Apache installation on Windows 7

I am a newbie with Apache. I am learning .. after the installation when I tried to start the service I got the following errors.
The Apache service named reported the following error:
Unable to open logs .
The Apache service named reported the following error:
no listening sockets available, shutting down .
The Apache service named reported the following error:
(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 .
The Apache service named reported the following error:
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.6 for ServerName .
The following error usually means that some other program is listening on the HTTP port (80).
(OS 10048)Only one usage of each
socket address (protocol/network
address/port) is normally permitted. :
make_sock: could not bind to address
0.0.0.0:80 .
In my experience, IM (chat) clients like to connect to port 80.
From a command prompt, (cmd.exe) run the command:
netstat -an
See if there is a listener on port 80 (Look for a line that says:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
=== ====
the important thing being TCP and 80. If you find something, you'll need to track it down using something like TcpView
If Skype is your problem and it seems it usually is, alter Skype's port usage.
Click on Tools in Skype,
click on Options,
click Advanced,
click Connections.
In Connection is the option to use another port, I use a high numbered port such as 65432, then un-click the alternative use of port 80 and 443.
Close and restart Skype.
modifying C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd sloved the problem.
If you had installation problems, note that you might experience some errors such “ no services installed ”
if Apache is trying to share port 80 with another web server or application, such as a locally installed
firewall application. To fix this, you can tell Apache to use a different port. Open your httpd.conf file
in the conf subdirectory ( C:\Program Files\Apache Software Foundation\Apache2.2\conf by
default) and locate the following lines:
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the < VirtualHost >
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Change the last line of this block to read:
Listen 8080
skype uses port 80, try logout and shut down the program...
now run apache
if you are using windows os and believe that skype is not the suspect, then you might want to check the task manager and check the "Show processes from all users" and make sure that there is NO entry for httpd.exe. Otherwise, end its process. That solves my problem.
Changing in the config file every occurrence of the path to apache (eg: "C:/Users/xxxx/Desktop/Apache Software Foundation/") to the new location (in case you shifted directory of apache installation by copy paste) solved my problem. Hope it helps you too..
Please note that, not only http port 80, may your ssl port 443 is being used by any other service or software.
I have installed vmware workstation on my PC, so a process which was initiated by Vmware Workstation was using ssl port 443.
In my case, it was vmware-hostd.exe which was utilizing ssl port 443.
Try shutting down vmware-hostd.exe or simply change your ssl-httpd.conf and modify Listen from 443 to 8080 or something else.
While choosing the port number please be sure that you don't enter any port which can be used by any other software on your PC.
just provide the listen address and port in httpd.conf file. that will not show IP related error as
Listen IP_ADDRESS:PORT
If you change port ( not port 80) then port conflict will not occur and server comes up.
Below blog may help you :-
http://apache2-4-9-webserver-installation.blogspot.com/2014/06/how-to-install-apache-http-server.html
Port 80 conflict. There are a number of well-known Windows programs which use
port 80:
IIS
The most likely culprit is Microsoft Internet Information Server. Stop the
service with the command from the command line on Windows 7/Vista:
net stop was /y
If needed start the services again with the command from the command line on
windows /Vista:
net start was /y