View previous topic :: View next topic |
Author |
Message |
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Sun Nov 15, 2015 10:01 pm Post subject: cant start apache [Solved] |
|
|
Today I had to change the router TP-LINK for ZyXEL. After reboot hostname has changed from localhost to dhcppc1. Quote: | /etc/host
127.0.0.1 localhost
::1 localhost
| /etc/conf.d/hostname Quote: | hostname="localhost"
| and
Quote: | # echo $HOSTNAME
dhcppc1
|
Quote: | # /etc/init.d/apache2 restart
* Starting apache2 ...
* start-stop-daemon: failed to start `/usr/sbin/apache2' [ !! ]
* ERROR: apache2 failed to start
| I have to say, that I am confused and do not know how to fix it.
Last edited by apiaio on Mon Nov 23, 2015 6:04 pm; edited 1 time in total |
|
Back to top |
|
|
Buffoon Veteran
Joined: 17 Jun 2015 Posts: 1369 Location: EU or US
|
Posted: Sun Nov 15, 2015 10:07 pm Post subject: |
|
|
Configure your DHCP client not to pull hostname from DHCP server. Or even better, do not use DHCP at all. |
|
Back to top |
|
|
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Mon Nov 16, 2015 4:56 pm Post subject: |
|
|
Let's say solved. Apache works after editing /etc/dhdcpcd.conf
but I am not absolutely satisfied. After connecting to the router HOSTAME is still dhcppcX.
I am not able Quote: | Configure your DHCP client not to pull hostname from DHCP server. | as Buffoon suggested. How to do that? |
|
Back to top |
|
|
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Tue Nov 17, 2015 7:10 pm Post subject: |
|
|
Unfortunatelly is not the best solution too. E.g. after rebooting from Windows apache doesnt start. I do not know why. So that I removed apache from startup services and after reboot when I neet to use apache I run Code: | sysctl kernel.hostname=localhost
/etc/init.d/apache2 start | But main problem, that ZyXEL assigns hostname of my comp persists. |
|
Back to top |
|
|
kikko Apprentice
Joined: 29 Apr 2014 Posts: 276 Location: Milan, IT
|
Posted: Tue Nov 17, 2015 7:30 pm Post subject: |
|
|
Hi apiaio
which dhcp client are you using? There is a pretty big difference between e.g. dhclient and dhcpcd
On the other hand, you can also configure your dhcp server (the ZyXEL AP) to not push the hostname for your internal network
Regards _________________ Regards
root is the root of all evil |
|
Back to top |
|
|
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Tue Nov 17, 2015 8:19 pm Post subject: |
|
|
Hi kikko.
Using dhcpcd. Concerning hostname I am not sure if is possible to change ZyXEL's configuration.
But I am sure that must exists the way how to ignore sent hostname.
I have installed Sabayon, which hostname is aswell overwritten by hostname sent by server, but apache starts without any problems. |
|
Back to top |
|
|
freke l33t
Joined: 23 Jan 2003 Posts: 977 Location: Somewhere in Denmark
|
Posted: Tue Nov 17, 2015 8:43 pm Post subject: |
|
|
Then I'd start comparing the apache-configs |
|
Back to top |
|
|
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Wed Nov 18, 2015 3:52 pm Post subject: |
|
|
freke wrote: | Then I'd start comparing the apache-configs | I did, but no significant differencies found. Concerning dhcpcd config's files dhdcpcd.conf are the same and others is not compareble becouse my Gentoo uses OpenRC and SL Systemd. |
|
Back to top |
|
|
kikko Apprentice
Joined: 29 Apr 2014 Posts: 276 Location: Milan, IT
|
Posted: Wed Nov 18, 2015 9:35 pm Post subject: |
|
|
Hi apiaio
you should try to start httpd daemon directly on the command line, in order to get more "valuable" output
commands are like this:
Code: | /sbin/httpd -f /etc/apache2/httpd.conf -t |
Start
Code: | /sbin/httpd -f /etc/apache2/httpd.conf -k start |
Check it, I'm not 100% sure about httpd location
Regards _________________ Regards
root is the root of all evil |
|
Back to top |
|
|
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Thu Nov 19, 2015 3:15 pm Post subject: |
|
|
Sorry kikko.
I cant locate httpd in /bin or /sbin neither Gentoo nor SL. |
|
Back to top |
|
|
freke l33t
Joined: 23 Jan 2003 Posts: 977 Location: Somewhere in Denmark
|
Posted: Thu Nov 19, 2015 5:22 pm Post subject: |
|
|
for Gentoo that'd be /usr/sbin/apache2 instead of /usr/(s)bin/httpd |
|
Back to top |
|
|
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Mon Nov 23, 2015 9:09 am Post subject: |
|
|
Quote: | dhcppc1 miro # sysctl kernel.hostname=localhost
kernel.hostname = localhost
dhcppc1 miro # /usr/sbin/apache2 -f /etc/apache2/httpd.conf -t
apache2: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
Syntax OK
dhcppc1 miro # /usr/sbin/apache2 -f /etc/apache2/httpd.conf -k start
apache2: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
no listening sockets available, shutting down
Unable to open logs
dhcppc1 miro #
|
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Nov 23, 2015 1:55 pm Post subject: |
|
|
apiaio wrote: | I am not able "configure your DHCP client not to pull hostname from DHCP server" as Buffoon suggested. How to do that? |
apiaio ... you would do the following:
/etc/conf.d/net: | dhcp_eth0="nosendhost" |
... but that isn't really your problem, the issue is that apache can't resolve the FQDN (Fully Qualified Domain Name) ... 'localhost' isn't a FQDN but the name of the 'loopback' (127.0.0.1) ... it also isn't really your 'hostname', every machines loopback is 'localhost'.
/etc/conf.d/hostname: | hostname="foo" |
/etc/hosts: | 127.0.0.1 foo localhost |
Code: | # dig +short localhost
127.0.0.1 |
So, you either have apache 'listen' on the loopback ... via changing apache2.conf to 'Listen 127.0.0.1:80', or you provide a FQDN in /etc/hosts, or DNS, (that matches the machines IP).
best ... khay |
|
Back to top |
|
|
apiaio Guru
Joined: 04 Dec 2008 Posts: 417
|
Posted: Mon Nov 23, 2015 6:03 pm Post subject: |
|
|
Thanks, solved. But this part I dont understand Quote: | ... via changing apache2.conf | Where is apache2.conf? |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Nov 23, 2015 6:57 pm Post subject: |
|
|
apiaio wrote: | Thanks, solved. But this part I dont understand "... via changing apache2.conf"
Where is apache2.conf? |
apiaio ... you're welcome. Sorry, httpd.conf.
best ... khay |
|
Back to top |
|
|
|