ERRO APACHE no CentOS

1. ERRO APACHE no CentOS

Lucas Lisboa
LisboaSantos

(usa Outra)

Enviado em 04/03/2022 - 15:50h

Boa Tarde Pessoal, tenho tido esse erro ao inicializar o apache.

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.


systemctl status httpd.service


● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sex 2022-03-04 15:38:25 -03; 7s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 6359 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 6359 (code=exited, status=1/FAILURE)

Mar 04 15:38:12 teste.com httpd[6359]: [Fri Mar 04 15:38:12.145719 2022] [so:warn] [pid 6359] AH01574: module wsgi_module is alread...skipping
Mar 04 15:38:25 teste.com httpd[6359]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using... message
Mar 04 15:38:25 teste.com httpd[6359]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Mar 04 15:38:25 teste.com httpd[6359]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
Mar 04 15:38:25 teste.com httpd[6359]: no listening sockets available, shutting down
Mar 04 15:38:25 teste.com httpd[6359]: AH00015: Unable to open logs
Mar 04 15:38:25 teste.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 04 15:38:25 teste.com systemd[1]: Failed to start The Apache HTTP Server.
Mar 04 15:38:25 teste.com systemd[1]: Unit httpd.service entered failed state.
Mar 04 15:38:25 teste.com systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
(venv) [root@senai etc]# sudo systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
(venv) [root@senai etc]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sex 2022-03-04 15:46:09 -03; 1min 7s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 6376 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 6376 (code=exited, status=1/FAILURE)

Mar 04 15:45:55 teste.com httpd[6376]: [Fri Mar 04 15:45:55.386176 2022] [so:warn] [pid 6376] AH01574: module wsgi_module is alread...skipping
Mar 04 15:46:09 teste.com httpd[6376]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using... message
Mar 04 15:46:09 teste.com httpd[6376]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Mar 04 15:46:09 teste.com httpd[6376]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
Mar 04 15:46:09 teste.com httpd[6376]: no listening sockets available, shutting down
Mar 04 15:46:09 teste.com httpd[6376]: AH00015: Unable to open logs
Mar 04 15:46:09 teste.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 04 15:46:09 teste.com systemd[1]: Failed to start The Apache HTTP Server.
Mar 04 15:46:09 teste.com systemd[1]: Unit httpd.service entered failed state.
Mar 04 15:46:09 teste.com systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

"journalctl -xe"
Mar 04 15:45:17 teste.com systemd-logind[671]: Removed session 18.
-- Subject: Sessão 18 foi terminada
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- Um sessão com o ID 18 foi terminada.
Mar 04 15:45:55 teste.com sudo[6368]: root : TTY=pts/0 ; PWD=/etc ; USER=root ; COMMAND=/bin/systemctl start httpd
Mar 04 15:45:55 teste.com sudo[6368]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Mar 04 15:45:55 teste.com polkitd[653]: Registered Authentication Agent for unix-process:6370:1811186 (system bus name :1.139 [/usr/bin/pkttya
Mar 04 15:45:55 teste.com systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unidade httpd.service sendo iniciado
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A unidade httpd.service está sendo iniciada.
Mar 04 15:45:55 teste.com httpd[6376]: [Fri Mar 04 15:45:55.386176 2022] [so:warn] [pid 6376] AH01574: module wsgi_module is already loaded, s
Mar 04 15:46:09 teste.com httpd[6376]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using teste.com.
Mar 04 15:46:09 teste.com httpd[6376]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Mar 04 15:46:09 teste.com httpd[6376]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
Mar 04 15:46:09 teste.com httpd[6376]: no listening sockets available, shutting down
Mar 04 15:46:09 teste.com httpd[6376]: AH00015: Unable to open logs
Mar 04 15:46:09 teste.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 04 15:46:09 teste.com systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: A unidade httpd.service falhou
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A unidade httpd.service falhou.
--
-- O resultado é failed.
Mar 04 15:46:09 teste.com systemd[1]: Unit httpd.service entered failed state.
Mar 04 15:46:09 teste.com systemd[1]: httpd.service failed.
Mar 04 15:46:09 teste.com polkitd[653]: Unregistered Authentication Agent for unix-process:6370:1811186 (system bus name :1.139, object path /
Mar 04 15:46:09 teste.com sudo[6368]: pam_unix(sudo:session): session closed for user root
lines 2847-2881/2881 (END)

Alguém entende o que está acontecendo?

Sds



  


2. Re: ERRO APACHE no CentOS

Daniel Lara Souza
danniel-lara

(usa Fedora)

Enviado em 04/03/2022 - 16:18h


pelo erro , ja tem alguma aplicação rodando nessas porta 80 443
de uma olhada com o comando



ss -plunta




3. Re: ERRO APACHE no CentOS

Lucas Lisboa
LisboaSantos

(usa Outra)

Enviado em 04/03/2022 - 20:18h


Eu reinstalei o httpd. o status httpd está ok, mas agora da erro quando tento fazer alguma requisição.

[root@teste ~]# tail -f /var/log/httpd/error_log
[Fri Mar 04 20:10:41.282202 2022] [wsgi:error] [pid 13535] [remote 10.81.234.6:48558] Traceback (most recent call last):
[Fri Mar 04 20:10:41.282232 2022] [wsgi:error] [pid 13535] [remote 10.81.234.6:48558] File "/var/www/html/flaskapp/flaskapp.wsgi", line 8, in <module>
[Fri Mar 04 20:10:41.282274 2022] [wsgi:error] [pid 13535] [remote 10.81.234.6:48558] from flaskapp import app as application
[Fri Mar 04 20:10:41.282303 2022] [wsgi:error] [pid 13535] [remote 10.81.234.6:48558] AttributeError: find_module
[Fri Mar 04 20:12:05.345959 2022] [wsgi:error] [pid 13535] [remote ::1:45402] mod_wsgi (pid=13535): Failed to exec Python script file '/var/www/html/flaskapp/flaskapp.wsgi'.
[Fri Mar 04 20:12:05.346011 2022] [wsgi:error] [pid 13535] [remote ::1:45402] mod_wsgi (pid=13535): Exception occurred processing WSGI script '/var/www/html/flaskapp/flaskapp.wsgi'.
[Fri Mar 04 20:12:05.346041 2022] [wsgi:error] [pid 13535] [remote ::1:45402] Traceback (most recent call last):
[Fri Mar 04 20:12:05.346071 2022] [wsgi:error] [pid 13535] [remote ::1:45402] File "/var/www/html/flaskapp/flaskapp.wsgi", line 8, in <module>
[Fri Mar 04 20:12:05.346115 2022] [wsgi:error] [pid 13535] [remote ::1:45402] from flaskapp import app as application
[Fri Mar 04 20:12:05.346145 2022] [wsgi:error] [pid 13535] [remote ::1:45402] AttributeError: find_module


Já os códigos estão assim:

flaskapp.wsgi

import sys
sys.path.insert(0, '/var/www/html/flaskapp')

activate_this = '/var/www/html/flaskapp/vidatenv/bin/activate_this.py'
with open(activate_this) as file_:
exec(file_.read(), dict(__file__=activate_this))

from flaskapp import app as application


flaskapp.py


import flask

app = flask.Flask(__name__, template_folder=".", static_url_path='/')
app.config['ENV'] = 'development'
#app.config['DEBUG'] = True
app.config['TESTING'] = True
app.config.from_object(__name__)

app.static_folder = '.'

@app.route('/', methods=['GET', 'POST'])
def index():
return flask.render_template('index.html') # , columns=flask.session["columns"]

if __name__ == "__main__":
# app.debug = True
app.run(host="0.0.0.0")





4. Re: ERRO APACHE no CentOS

leandro peçanha scardua
leandropscardua

(usa Ubuntu)

Enviado em 04/03/2022 - 21:20h


Verificou as permissões do usuário apache (www-data) em /var/www/html/flaskapp/vidatenv/bin/activate_this.py ?


5. Re: ERRO APACHE no CentOS

Lucas Lisboa
LisboaSantos

(usa Outra)

Enviado em 05/03/2022 - 06:24h

Chequei as permissões, faltava a de execução, mas não mudou nada no funcionamento.

[root@teste bin]# ls -lrt activate_this.py
-rw-rw-r--. 1 root root 1199 Mar 4 15:46 activate_this.py
[root@teste bin]# chmod +x activate_this.py
[root@teste bin]# ls -lrt activate_this.py
-rwxrwxr-x. 1 root root 1199 Mar 4 15:46 activate_this.py








Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts