ubuntu apache restart error - apache

I am getting below error...
What to do?
* Restarting web server apache2 /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

To solve this problem You need set ServerName.
vim /etc/apache2/conf.d/name
For example set add ServerName localhost or any other name:
ServerName localhost
Restart Apache 2
service apache restart

Related

AH00558: httpd: Could not reliably determine the server's fully qualified domain name,Set the 'ServerName' directive globally to suppress this message

I've tried to run apache server with
sudo apachectl start
sudo apachectl stop
and I encountered these errors
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using exampleui-MacBookPro.local. Set the 'ServerName' directive globally to suppress this message
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:8080
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
AH00015: Unable to open logs
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Hoonui-MacBookPro.local. Set the 'ServerName' directive globally to suppress this message
httpd (pid 6276?) not running
So I searched stackoverflow and exchanged ServerName localhost in etc/apache2/httpd.conf file to ServerName localhost:8080 and it was uncommented already.
It didn't change even after changing ServerName into
localhost
localhost:80
localhost:8080
127.0.0.1
and I also tried to kill process with kill -9 pid but nothing changed

getting error while configure two websites on different port no of same ip?

I tried to configure virtual host in apache configuration file . my requirement is host two sites in same ip but different ports.
Listen 192.168.2.10:80
Listen 192.168.2.10:9021
NameVirtualHost 192.168.2.10:80
NameVirtualHost 192.168.2.10:9021
<VirtualHost 192.168.2.10:80>
DocumentRoot /var/www/html/white-socks
ServerName www.white-socks.com
</VirtualHost>
<VirtualHost 192.168.2.10:9021>
DocumentRoot /var/www/html/black-socks
ServerName www.black-socks.com
</VirtualHost>
That is my configuration in "httpd.conf".
But i am getting error like below
[root#ram conf]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for ram
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(13)Permission denied: make_sock: could not bind to address 192.168.2.10:9021
no listening sockets available, shutting down
Unable to open logs
[FAILED]
[root#ram conf]#
What is my mistake and what i have to do to solve this ?

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.

Creating subdomains on apache2 server with dynamic IP

So basically I'm having issues creating a subdomain on my server. I'm running apache2 on a Ubuntu 12.04 server and have dynamic IP set up with No-IP.com.
I have mydomain.com working, but want to create test.mydomain.com directing towards a subfolder in my /var/www/ directory (where everything for my website is located).
I modified the code on apache vhosts examples page and put this in my httpd.conf file:
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost localhost:80
<VirtualHost localhost:80>
DocumentRoot /var/www/
ServerName mydomain.com
# Other directives here
</VirtualHost>
<VirtualHost localhost:80>
DocumentRoot /var/www/test
ServerName test.mydomain.com
# Other directives here
</VirtualHost>
When I try and restart the service:
sudo /etc/init.d/apache2 restart
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
(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
Action 'start' failed.
The Apache error log may have more information.
Any help is greatly appreciated. Please let me know if I'm forgetting to include any necessary information.
Update
I tried using *:80 but I still got an error, that's why I switched to localhost.
sudo /etc/init.d/apache2 restart
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Nov 21 15:03:51 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Nov 21 15:03:51 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
(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
Action 'start' failed.
The Apache error log may have more information.
UPDATE I figured out what was going on. I had a matching configuration entry in my ports.conf file. Once I removed that, everything worked fine.
Your apache conf seems correct if you replace localhost with *. That means that you should use NameVirtualHost *:80 and <VirtualHost *:80>
However, you must tell the DNS server to forward subdomains to your dynamic IP. Since you have a .com domain from a paid DNS service, you must login to your DNS provider and setup A records or CNAME records to your IP (add the same settings you have in your main .com domain). If you use the a ddclient or similar client to automatically update the domains, you can configure it to update the subdomain as well.
In any case, use command nslookup yourdomain.com and nslookup subdomain.domain.com to see if the subdomain is updated successfully. Note that updates in DNS may take hours before they are actually in effect.
EDIT:
Sorry just noticed : (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80. This means that somebody else is already using port 80, so the apache server cannot bind to that address. Use sudo netstat -anltp | grep :80 to see which program has bound port 80. Also, check your conf files to make sure that you have no more NameVirtualHost *:80 directives.
Last, apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName is not an error, it's just a warning so you shouldn't be worried about this
Possible that there a service using port :80
Try netstat -tulpn |grep :80 on command line to see which service is occupying this port. In my case, it was nginx. I stopped the service then started the one I wanted to use (apache2).

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"