Apache http server port change issue - apache

OS: Windows 7
I need to use Apache http server. For the same I downloaded it from Apache lounge. Now, after extracting the Apache24 folder to C:\, if I try to execute httpd.exe command from the bin folder, its giving me the OS 10013 error:
(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 [::]:80
(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 0.0.0.0:80
To resolve the same, I modified http.conf file for the following scenario:
a) Changed LISTEN 80 to "LISTEN 8080": Result: again executing the httd.exe command doesn't do anything at all. The command prompt simply sits idle
b) Added "LISTEN 8080" below to LISTEN 80 statement: Result: Again gives back the above OS 10013 error
c) in addition to case b, I also uncommented the servername entry in httpd.conf and made it like: "ServerName localhost:80" : Result: still the same OS 10013 error pops up.

Related

What is wrong with my apache Virtual host setup?

I have set up the virtual host like its displayed in the apache documentation:
NameVirtualHost Localhost:8080
<VirtualHost Localhost:8080>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot D:\Users\daniel_diezel\Apache24\htdocs
</VirtualHost>
<VirtualHost Localhost:8080>
ServerName www.otherdomain.tld
DocumentRoot D:\Users\daniel_diezel\Apache24\htdocs
</VirtualHost>
After i saved it and started the httpd.exe the following error accured while starting Apache:
`
(OS 10013)Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulõssig. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs`
But if i change the Port to 8080 its working.
But the problem no is when the apache starts i cant find the server when i type https://domain.ltd in my browser but if I go for Localhost:8080 it shows me the index file on the site.
What can i do to fix it?
There seems to be two different issues. According to your file structure I assume you are using Windows.
Port usage
Port 80 might be already in use. Open CMD and type netstat -ano and find all processes using port 80 apart from the system process (typically PID 4). Identify the processes by using the command tasklist and look for the PIDs using port 80 from the step before.
Now open your task manager and stop all processes if they are not relevant to keep your system running. Now the port binding error should be gone.
Accessing local domain names
domain.tld is resolved by your configured DNS-provider, so it is looked up to be found in the internet. If you want to resolve domain-names locally (before reaching out for the DNS) you have to add it to your host file.
Open C:/Windows/drivers/etc/hosts with a editor of your choice an add the following line:
127.0.0.1 domain.tld
Now everything should work as expected. If you want to use different ports you can also use 127.0.0.1:port domain.tld

Apache version conflict (cont)

Concerning the post Apache versions conflict. I tried again the installation of apache following the steps from https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions
I still have some problems if I want to test localhost from my local Site folder.
Result of apache log
Regarding the error
Could not reliably determine the server's fully qualified domain name,
using 127.0.0.1. Set the 'ServerName'...
I tried the option of adding ServerName localhost in the file /etc/apache2/apache2.conf https://askubuntu.com/questions/454497/apache2-could-not-reliably-determine-the-servers-fully-qualified-domain-name but I don't know if that is that is the right file, because i'm working with apache 2.4 (/usr/local/etc/apache2/2.4/httpd.conf)
Additionally, if I run the command sudo apachectl -k restart I got this
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
In my file /etc/apache2/httpd.conf
I have this:
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User amhg
Group staff
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost
DocumentRoot /Users/amhg/Sites
<Directory /Users/amhg/Sites>
#
AllowOverride All
and I uncommented LoadModule rewrite_module libexec/mod_rewrite.so
Any suggestions?
Thank you in advance!
you can see all of your apache installed version with command :
rpm -qa | grep httpd
in your log file I do not see any error.
can you sent all of your log file?
and can you explain what do you see in browser when go to :
http://localhost

Can't switch Apache port binding

I have apache 2.2 http server installed on windows 7. Port 80 is already being used and I am attempting to bind apache to an alternative free port. I have amended the C:\Apache\ApacheHTTPserver\Apache24\conf\httpd.txt file to change the value of Listen 80 to Listen 88 or Listen 7777 (I have checked the ports 88 and 7777 are free) and also changed ServerName localhost:80 to ServerName localhost:88 or ServerName localhost:7777 respectively. But when I attempt to start the Apache service I am given an error and it states this in the logs;
The Apache service named reported the following error:
OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : make_sock: could not bind to address 0.0.0.0:80
Why will this not change the Apache port number?
I have discovered what I was doing wrong. I was editing the httpd.conf file by locating it in Windows Explorer and opening in notepad and saving. But when I opened the httpd.conf file using Start >> Apache HTTP Server 2.2 >> Configure Apache Server and amend the port to 88 the service starts okay

httpd error after install for Openldap

I have made all the settings for openldap, less then httpd.
After I installed httpd, when I tried to start it with "serice httpd start",
display the following error:
[root#elara pub]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
I understood from net, that i need to kill a process, but I'm very confused, because I'm nubbie in Linux.
Can' someone tell me a solution for my problem?
Sounds like you installed OpenLDAP incorrectly to listen at port 80. The correct port for LDAP is 389; 636 for LDAPS.

Apache restart on Ubuntu - error "could not bind to address 0.0.0.0.80"

I'm a n00b - trying to get apache2 set up on Ubuntu 9.10 (Karmic Koala) on Rackspace Cloud. I have set up/configured OpenSSL and installed Apache, but Apache won't start. I assume its a misconfiguration in my /etc/apache2/sites-available/ssl or /etc/apache2/sites-available/default files)
When I try to restart apache using the command:
sudo /etc/init.d/apache2 restart
I get the following error message:
[error] (EAI 2)Name or service not known: Could not resolve host name *.80 -- ignoring!
[error] (EAI 2)Name or service not known: Could not resolve host name *.80 -- ignoring!
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
...fail!
For my /etc/apache2/sites-available/ssl I have used a virtual host of *:443.
For my /etc/apache2/sites-available/default i have used a virtual host of *:80
Turn off Skype. It's use port number 80 for incoming messages. Eventually check what use this port at the moment using netstat.
Second resolve is simply: Add ServerName localhost to main config. file.
Check /etc/hosts. Be sure that your machine name and localhost domain definition is correct (ie: "127.0.0.1 localhost.localdomain localhost"
However it is highly unlikely, check /etc/apache2/ports.conf if it contains explicitly "0.0.0.0"