Open ghost opened 5 years ago
Same problem here with stopping Apache. I'm killing the service with pkill -f httpd
.
Same issue but it didn't stop and even deleting termux and clearing data leaves apache running
I've added a termux-services script for httpd so it is now possible to start and stop httpd with sv up httpd
and sv down httpd
(after running pkg upgrade; apt install termux-services
)
@Grimler91 it didn't help me itself but thanks… it have given me the idea to solve it
the problem was that the apachectl
couldn't rebind to the specified port
this is a problem running apache with no superuser previlages
i fixed that with this
netstat -tulpn
# get PID
kill -TERM {PID}
apachectl -k start
Thanks alot
Can you do strace httpd -X &> process.log
in one session and then strace httpd -k stop &> killing.log
in another? Assuming it won't be killed, just Ctrl-C in the former. Report back with the files attached.
You may also want to check (and compare it with the pid in pgrep -a httpd
) $PREFIX/var/run/apache2/httpd.pid
after starting it (but before killing it).
Hello, thanks you for your research and your help in finding a solution. after long research and testing I will share with you my solution on termux (debian):
1) echo "ServerName localhost" >> /data/data/com.termux/files/usr/etc/apache2/httpd.conf
pour l'erreur : * Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
commande apache normalement (erreur!):
apachectl start -------(for the firt time)
apachectl stop -------(erreur)
apachectl restart ------- (erreur)
apachectl -t -D DUMP_INCLUDES
Usuellement (work) :
Arrêt apache avec killall (pkg install psmisc
) :
killall -9 httpd
redémarrage complet apache:
killall -9 httpd ; rm ${PREFIX}/var/run/apache2/httpd.pid ; apachectl -k start
marche aussi si android redémarre sans avoir stoppé apache.
killall -9 httpd ; rm ${PREFIX}/var/run/apache2/httpd.pid ; apachectl -k start
autre solution : netstat by @Grimler91 @AbdelazizSharaf001
redémarrage apache:
netstat -tulpn
-- to get PID
kill -TERM {PID}
---To kill PID associé a httpd et a son port 8080
apachectl -k start
$ netstat -tulpn
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:24800 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:18016 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:25000 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5037 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5555 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8470 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:18011 0.0.0.0:* LISTEN -
tcp6 0 0 :::8080 :::* LISTEN 10042/httpd
tcp6 0 0 :::9527 :::* LISTEN -
tcp6 0 0 :::18014 :::* LISTEN -
udp 0 0 0.0.0.0:22469 0.0.0.0:* -
udp6 576 0 :::18012 :::* -
udp6 0 0 :::9528 :::* -
https://parzibyte.me/blog/en/2019/04/28/install-apache-php-7-android-termux/
sorry for my french-english thanks for your contribution cordially
Kill MariaDB
killall -9 mysqld_safe || killall -9 mysql
Kill Apache HTTPD
killall -9 httpd
killall -9 mysqld_safe || kill all -9 mysql
Nothing related to this issue and also command part kill all -9 mysql
has typo.
killall -9 mysqld_safe || kill all -9 mysql
Nothing related to this issue and also command part
kill all -9 mysql
has typo.
Sorry ,Fixed.
This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is it still reproducible?
I can start the server fine. The qualified domain name error is pretty common error when you first test apache. I'm having trouble stopping the service though.
using
does not kill the server.
also killall and removing the pid file doesn't kill the server.
cleared cache in browser to double check after running kill commands and nothing happens. the process still runs in the background.
also comes back up empty handed.
mlocate also comes up empty handed
this is not okay, especially if in a public network.
also there is no
var/www/html
as far as i can tellreturns nothing.
server root is set to
$PREFIX
which leads to a dead end.after poking around
${PREFIX}/etc/apache2/httpd.conf
, i find document root is set to${PREFIX}/share/apache2/default-site/htdocs
which breaks convention, but considering termux doesn't have the standard heiarchy, this makes sense in a weird way. I would still have left it as${PREFIX}/var/www
, but its not a big deal.After looking at the error log
I found no real helpful clues.
because
apachectl
is a wrapper forhttpd
, i looked at the shell script to see if there was anything special about it aside from config options which led to lynx (haven't looked at it yet though).i decided to run the
stop
commands usinghttpd -k
directly, but that didnt do anything either.logcat -d "*:W"
.strace -fv -s 2048 -o strace.log {program name}
.UPDATE: After some trial and error,
ps aux
returned the httpd PIDs and I was able to usekill -SIGINT {PID}
to end the process.Its still weird that
ps aux
didn't pick up on this until last minute though. Maybe something to do with the terminal session.I created new terminal sessions to open files with
less
to check them out and on the last tty i decided to give a try again and this time it showed up.After clearing the browser cache, I was able to verify that the httpd service had ended. I stil have no idea why the processes wouldn't show up after starting apache though.