Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] unable to start apache server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Sun Nov 13, 2022 3:21 am    Post subject: [SOLVED] unable to start apache server Reply with quote

hi guys how are you doing, i am trying to setup LAMP on my machine, it is under hardened/selinux profile.
i installed php, mariadb successfully apache is installed successfully as well, however when i try to execute
Code:
 /etc/init.d/apache2 start
as root i keep getting errors about missing modules so i added the missing modules. however now when i want to run
Code:
 /etc/init.d/apache2 start
after making sure all the modules are installed, i get this error
Code:
apache2: Syntax error on line 153 of /etc/apache2/httpd.conf: Cannot load modules/mod_proxy_http2.so into server: /usr/lib64/apache2/modules/mod_proxy_http2.so: undefined symbol: ap_proxy_location_reverse_map
apache2                   | * ERROR: apache2 failed to start

for checking if it works by opening localhost on the host machine, it does not work, i cannot open that page whether on firefox or chromium browsers
please help me guys, thank you
_________________
i would like to thank everyone that contributed to the gentoo project in any means


Last edited by abdus on Sat Nov 19, 2022 11:33 am; edited 1 time in total
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Sun Nov 13, 2022 5:27 am    Post subject: Reply with quote

i found this https://forums.gentoo.org/viewtopic-t-949708-start-0.html
which helped with the modules
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Sun Nov 13, 2022 5:58 am    Post subject: Reply with quote

my case now is similar to this https://forums.gentoo.org/viewtopic-t-948826-start-0.html i followed the instructions but still not working
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Sun Nov 13, 2022 6:03 am    Post subject: Reply with quote

the verbose output of the error is
Code:

apache2                   |apache2                   | * Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/apache2 start
apache2                   | * Starting apache2 ...
apache2                   | * start-stop-daemon: fopen `/var/run/apache2.pid': No such file or directory
apache2                   | * Detaching to start `/usr/sbin/apache2' ...
apache2                   | *   start-stop-daemon: failed to start `/usr/sbin/apache2'                                                                    [ !! ]
apache2                   | * ERROR: apache2 failed to start

_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21619

PostPosted: Sun Nov 13, 2022 4:51 pm    Post subject: Reply with quote

What is the output of namei -l /run /var/run? You should have:
Code:
$ namei -l /run /var/run
f: /run
drwxr-xr-x root root /
drwxr-xr-x root root run
f: /var/run
drwxr-xr-x root root /
drwxr-xr-x root root var
lrwxrwxrwx root root run -> /run
drwxr-xr-x root root   /
drwxr-xr-x root root   run
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Sun Nov 13, 2022 5:39 pm    Post subject: Reply with quote

the output is just like yours
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21619

PostPosted: Sun Nov 13, 2022 6:28 pm    Post subject: Reply with quote

That suggests the diagnostic about the pidfile is not relevant. What is written to the Apache logs when it fails to start?
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Mon Nov 14, 2022 2:06 am    Post subject: Reply with quote

where to find the log??
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Mon Nov 14, 2022 12:29 pm    Post subject: Reply with quote

Maybe this helps:

https://ocroquette.wordpress.com/2018/04/30/apache-undefined-symbol-ap_proxy_location_reverse_map/

Greetings Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Mon Nov 14, 2022 1:15 pm    Post subject: Reply with quote

thank you for your help but for the error of "syntax error" i just followed the thread above and i only had to comment the lines that start those modules. now i have the error
Code:
apache2                   |apache2                   | * Executing: /lib/rc/sh/openrc-run.sh /lib/rc/sh/openrc-run.sh /etc/init.d/apache2 start
apache2                   | * Starting apache2 ...
apache2                   | * start-stop-daemon: fopen `/var/run/apache2.pid': No such file or directory
apache2                   | * Detaching to start `/usr/sbin/apache2' ...
apache2                   | *   start-stop-daemon: failed to start `/usr/sbin/apache2'

_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Mon Nov 14, 2022 8:43 pm    Post subject: Reply with quote

then as Hu already wrote; check the logfiles.

greetings Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Tue Nov 15, 2022 3:49 am    Post subject: Reply with quote

the log file is supposed to be "access.log" when executing the command locate access.log, i get no output.
locate command is supposed to work well with me, i made sure it does
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
hdcg
Tux's lil' helper
Tux's lil' helper


Joined: 07 Apr 2013
Posts: 120

PostPosted: Tue Nov 15, 2022 5:05 am    Post subject: Reply with quote

Hi abdus,

assuming you did not change the default log configuration.

The log file of interest will be:
Code:
/var/log/apache2/error_log

as Apache is not able to start. The access log
Code:
/var/log/apache2/access_log

will only be written after Apache is running and accepting requests.

Best Regards,
Holger
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Tue Nov 15, 2022 5:51 am    Post subject: Reply with quote

thank you very much for the info
the output file is here https://dpaste.com/4NHESALRH
it says the module mod_request needs to be loaded
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Tue Nov 15, 2022 6:05 am    Post subject: Reply with quote

where can i find that module? it isn't listed in APACHE2_MODULES when i want to reemerge apache package
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21619

PostPosted: Tue Nov 15, 2022 1:30 pm    Post subject: Reply with quote

Some modules may be available by default, and not subject to a Portage configuration flag. Was mod_request.so built for you? It is for me:
Code:
/usr/lib64/apache2/modules/mod_request.so
However, even if it is installed, it may not be enabled in your Apache configuration. You could also choose to disable use of mod_auth_form so that you do not need mod_request.
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Tue Nov 15, 2022 9:07 pm    Post subject: Reply with quote

Hu wrote:
Some modules may be available by default, and not subject to a Portage configuration flag. Was mod_request.so built for you? It is for me:
Code:
/usr/lib64/apache2/modules/mod_request.so
However, even if it is installed, it may not be enabled in your Apache configuration. You could also choose to disable use of mod_auth_form so that you do not need mod_request.


copy that, and usually "a2enmod" and "a2dismod" should help you in this case as well.

greetings Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1657

PostPosted: Tue Nov 15, 2022 9:12 pm    Post subject: Reply with quote

bbgermany wrote:
Hu wrote:
Some modules may be available by default, and not subject to a Portage configuration flag. Was mod_request.so built for you? It is for me:
Code:
/usr/lib64/apache2/modules/mod_request.so
However, even if it is installed, it may not be enabled in your Apache configuration. You could also choose to disable use of mod_auth_form so that you do not need mod_request.


copy that, and usually "a2enmod" and "a2dismod" should help you in this case as well.


Those 2 commands are a Debian specific addition. Normal configuration file editing is required on Gentoo.
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Wed Nov 16, 2022 9:04 pm    Post subject: Reply with quote

grknight wrote:
Those 2 commands are a Debian specific addition. Normal configuration file editing is required on Gentoo.


OMG, how could i miss this. Im working with debian servers for too long already. Im sorry :-(

greetings Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Thu Nov 17, 2022 12:17 am    Post subject: Reply with quote

i put
Code:
LoadModule request_module modules/mod_request.so
to /etc/apache2/httpd.conf
apache server did not want to start, i disabled mod_auth_form still not wanting to start
the new lines in error log are
Code:
[Thu Nov 17 07:09:39.752305 2022] [:notice] [pid 20869:tid 139940753247680] ModSecurity for Apache/2.9.5 (http://www.modsecurity.org/) configured.
[Thu Nov 17 07:09:39.752382 2022] [:notice] [pid 20869:tid 139940753247680] ModSecurity: APR compiled version="1.7.0"; loaded version="1.7.0"
[Thu Nov 17 07:09:39.752390 2022] [:notice] [pid 20869:tid 139940753247680] ModSecurity: PCRE compiled version="8.45 "; loaded version="8.45 2021-06-15"
[Thu Nov 17 07:09:39.752396 2022] [:notice] [pid 20869:tid 139940753247680] ModSecurity: LIBXML compiled version="2.10.2"
[Thu Nov 17 07:09:39.752400 2022] [:notice] [pid 20869:tid 139940753247680] ModSecurity: Status engine is currently disabled, enable it by set SecStatusEngine to On.
[Thu Nov 17 07:09:39.823091 2022] [lbmethod_bybusyness:emerg] [pid 20870:tid 139940753247680] AH10151: mod_proxy must be loaded for mod_lbmethod_bybusyness
[Thu Nov 17 07:09:39.823124 2022] [:emerg] [pid 20870:tid 139940753247680] AH00020: Configuration Failed, exiting
i had not to use wgetpaste, it doesn't want to work, i'm sorry for that.
it says i need to load mod_proxy which is already uncommented in /etc/apache2/httpd.conf
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Thu Nov 17, 2022 4:53 am    Post subject: Reply with quote

Hi,

did you see this line:

Code:

[Thu Nov 17 07:09:39.823091 2022] [lbmethod_bybusyness:emerg] [pid 20870:tid 139940753247680] AH10151: mod_proxy must be loaded for mod_lbmethod_bybusyness


Enable mod_proxy or disable all the modules that are mentioned if you do not enable mod_proxy and retry.

greetings Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
hdcg
Tux's lil' helper
Tux's lil' helper


Joined: 07 Apr 2013
Posts: 120

PostPosted: Thu Nov 17, 2022 5:00 am    Post subject: Reply with quote

Hi abdus,

please check the config file in detail.

Per default mod_proxy is guarded by a define
Code:
<IfDefine PROXY>
LoadModule proxy_module modules/mod_proxy.so
</IfDefine>


To enable mod_proxy with this config, add -D PROXY to /etc/conf.d/apache2. Like
Code:
APACHE2_OPTS="... -D PROXY ..."

Do not remove the other already defined options.

Furthermore if you modify httpd.conf directly, make sure the module order matches. I am not quite sure, but your error may also occur if mod_proxy is loaded after the depending module.

Best Regards,
Holger
Back to top
View user's profile Send private message
abdus
Apprentice
Apprentice


Joined: 10 Feb 2021
Posts: 189
Location: bandung

PostPosted: Sat Nov 19, 2022 11:32 am    Post subject: Reply with quote

i enabled the mod_proxy the way you said, it caused me to add some other modules since they are needed there was an erro saying that those modules are not found so i added them to APACHE2_MODULES , and it worked.
thank you very much for your help god bless you and bless this comunity.
i appreciate your help. see you
_________________
i would like to thank everyone that contributed to the gentoo project in any means
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum