Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

[SOLVED] unable to start apache server

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
23 posts • Page 1 of 1
Author
Message
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

[SOLVED] unable to start apache server

  • Quote

Post by abdus » Sun Nov 13, 2022 3:21 am

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: Select all

 /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: Select all

 /etc/init.d/apache2 start 
after making sure all the modules are installed, i get this error

Code: Select all

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
Last edited by abdus on Sat Nov 19, 2022 11:33 am, edited 1 time in total.
i would like to thank everyone that contributed to the gentoo project in any means
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Sun Nov 13, 2022 5:27 am

i found this 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
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Sun Nov 13, 2022 5:58 am

my case now is similar to this 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
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Sun Nov 13, 2022 6:03 am

the verbose output of the error is

Code: Select all

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
Top
Hu
Administrator
Administrator
Posts: 24398
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sun Nov 13, 2022 4:51 pm

What is the output of namei -l /run /var/run? You should have:

Code: Select all

$ 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
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Sun Nov 13, 2022 5:39 pm

the output is just like yours
i would like to thank everyone that contributed to the gentoo project in any means
Top
Hu
Administrator
Administrator
Posts: 24398
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sun Nov 13, 2022 6:28 pm

That suggests the diagnostic about the pidfile is not relevant. What is written to the Apache logs when it fails to start?
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Mon Nov 14, 2022 2:06 am

where to find the log??
i would like to thank everyone that contributed to the gentoo project in any means
Top
bbgermany
Veteran
Veteran
User avatar
Posts: 1844
Joined: Mon Feb 21, 2005 8:19 am
Location: Oranienburg/Germany

  • Quote

Post by bbgermany » Mon Nov 14, 2022 12:29 pm

Maybe this helps:

https://ocroquette.wordpress.com/2018/0 ... verse_map/

Greetings Stefan
Desktop: Ryzen 7 5800X, 32GB, 2TB, RX7700XT
Noebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Mon Nov 14, 2022 1:15 pm

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: Select all

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
Top
bbgermany
Veteran
Veteran
User avatar
Posts: 1844
Joined: Mon Feb 21, 2005 8:19 am
Location: Oranienburg/Germany

  • Quote

Post by bbgermany » Mon Nov 14, 2022 8:43 pm

then as Hu already wrote; check the logfiles.

greetings Stefan
Desktop: Ryzen 7 5800X, 32GB, 2TB, RX7700XT
Noebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Tue Nov 15, 2022 3:49 am

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
Top
hdcg
Tux's lil' helper
Tux's lil' helper
Posts: 122
Joined: Sun Apr 07, 2013 8:30 am

  • Quote

Post by hdcg » Tue Nov 15, 2022 5:05 am

Hi abdus,

assuming you did not change the default log configuration.

The log file of interest will be:

Code: Select all

/var/log/apache2/error_log
as Apache is not able to start. The access log

Code: Select all

/var/log/apache2/access_log
will only be written after Apache is running and accepting requests.

Best Regards,
Holger
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Tue Nov 15, 2022 5:51 am

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
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Tue Nov 15, 2022 6:05 am

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
Top
Hu
Administrator
Administrator
Posts: 24398
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Tue Nov 15, 2022 1:30 pm

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: Select all

/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.
Top
bbgermany
Veteran
Veteran
User avatar
Posts: 1844
Joined: Mon Feb 21, 2005 8:19 am
Location: Oranienburg/Germany

  • Quote

Post by bbgermany » Tue Nov 15, 2022 9:07 pm

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: Select all

/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 7 5800X, 32GB, 2TB, RX7700XT
Noebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Top
grknight
Retired Dev
Retired Dev
Posts: 2565
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Tue Nov 15, 2022 9:12 pm

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: Select all

/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.
Top
bbgermany
Veteran
Veteran
User avatar
Posts: 1844
Joined: Mon Feb 21, 2005 8:19 am
Location: Oranienburg/Germany

  • Quote

Post by bbgermany » Wed Nov 16, 2022 9:04 pm

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 7 5800X, 32GB, 2TB, RX7700XT
Noebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Thu Nov 17, 2022 12:17 am

i put

Code: Select all

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: Select all

[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
Top
bbgermany
Veteran
Veteran
User avatar
Posts: 1844
Joined: Mon Feb 21, 2005 8:19 am
Location: Oranienburg/Germany

  • Quote

Post by bbgermany » Thu Nov 17, 2022 4:53 am

Hi,

did you see this line:

Code: Select all

[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 7 5800X, 32GB, 2TB, RX7700XT
Noebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Top
hdcg
Tux's lil' helper
Tux's lil' helper
Posts: 122
Joined: Sun Apr 07, 2013 8:30 am

  • Quote

Post by hdcg » Thu Nov 17, 2022 5:00 am

Hi abdus,

please check the config file in detail.

Per default mod_proxy is guarded by a define

Code: Select all

<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: Select all

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
Top
abdus
Apprentice
Apprentice
Posts: 190
Joined: Wed Feb 10, 2021 1:01 pm
Location: bandung

  • Quote

Post by abdus » Sat Nov 19, 2022 11:32 am

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
Top
Post Reply

23 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic