Estou tentando configurar um pequeno VPS. Quando foi provisionado para mim, recebi o endereço IP, que dispensa uma página apache2. Eu preferiria configurar as coisas usando o nginx. Eu perguntei ao host sobre como migrar para o nginx e recebi:
Apache is included with the template used to create the server.
All software installation, removal, updating and configuration is up to the end user. We provide pre-made server templates to you of the most commonly used software packages to help you get started.
Com base no link , estou tentando para desligar o servidor apache usando:
deploy@server:~$ sudo systemctl stop apache2.service
deploy@server:~$ sudo systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead) since Thu 2017-01-12 21:24:23 EST; 4 days ago
Docs: man:systemd-sysv-generator(8)
Process: 28696 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCES
Process: 28681 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCC
Jan 17 11:09:17 server systemd[1]: Stopped LSB: Apache2 web server.
Warning: Journal has been rotated since unit was started. Log output is incomplete
Mas a página padrão ainda está visível no URL. O que estou fazendo errado?
editar:
deploy@server:~$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
deploy@server:~$ sudo service apache2 stop
[sudo] password for deploy:
deploy@server:~$
a página da web ainda está ativa. Observe que implantar é uma conta não raiz que eu criei.
edição 2:
deploy@server:~$ ps aux | egrep apache2
deploy 17196 0.0 0.1 11228 888 pts/0 S+ 12:22 0:00 grep -E --color=auto apache2
edite 3: Eu encontrei o seguinte:
The binary is called apache2. Due to the use of environment variables, in the default configuration, apache2 needs to be started/stopped with /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not work with the default configuration.
edição 4: mudei para root:
root@server:/var/www/html# /etc/init.d/apache2 stop
[ ok ] Stopping apache2 (via systemctl): apache2.service.
root@server:/var/www/html#
Nenhuma alteração. Eu também editei o texto no arquivo index.html e isso está sendo exibido corretamente.
edite 5:
root@server:/var/www/html# sudo systemctl stop apache2.service
root@server:/var/www/html# lynx http://localhost
Eu ainda vejo a página no navegador lynx
edite 6:
root@server:/var/www/html# sudo lsof -i tcp:80 | egrep LISTEN
nginx 28487 root 6u IPv4 603899449 0t0 TCP *:http (LISTEN)
nginx 28487 root 7u IPv6 603899450 0t0 TCP *:http (LISTEN)
nginx 28488 www-data 6u IPv4 603899449 0t0 TCP *:http (LISTEN)
nginx 28488 www-data 7u IPv6 603899450 0t0 TCP *:http (LISTEN)
edite 7:
root@server:/var/www/html# sudo update-rc.d -f apache2 remove
root@server:/var/www/html# sudo systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)
Jan 17 12:59:58 server apache2[17860]: Action 'start' failed.
Jan 17 12:59:58 server apache2[17860]: The Apache error log may have more inform
Jan 17 12:59:58 server apache2[17860]: *
Jan 17 12:59:58 server apache2[17876]: * Stopping Apache httpd web server apach
Jan 17 12:59:58 server apache2[17876]: *
Jan 17 12:59:58 server systemd[1]: Started LSB: Apache2 web server.
Jan 17 13:01:04 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 14:16:05 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 14:16:54 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 14:20:45 server systemd[1]: Stopped LSB: Apache2 web server.
edite 8:
Jan 17 13:01:04 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 14:16:05 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 14:16:54 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 14:20:45 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 16:38:44 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 16:41:50 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 16:50:48 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 16:51:20 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 16:51:33 server systemd[1]: Stopped LSB: Apache2 web server.
Jan 17 16:51:45 server systemd[1]: Stopped LSB: Apache2 web server.
root@server:/var/www/html# sudo update-rc.d -f apache2 remove
root@server:/var/www/html#