Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 stopped working after update
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
walterbyrd
n00b
n00b


Joined: 26 Apr 2017
Posts: 48

PostPosted: Fri Jul 07, 2017 7:44 pm    Post subject: Apache2 stopped working after update Reply with quote

Code:

# uname -a
Linux fir 4.9.34-calculate #1 SMP PREEMPT Thu Jun 29 11:17:11 UTC 2017 x86_64 AMD Athlon(tm) II X4 640 Processor AuthenticAMD GNU/Linux


Code:

# apache2 -v
Server version: Apache/2.4.25 (Unix)
Server built:   Jun 16 2017 12:26:08


I think I am running php 5.6. Since I cannot load the module, I am not sure how to tell.

I used the instructions from the wiki:

https://wiki.gentoo.org/wiki/Apache
https://wiki.gentoo.org/wiki/PHP

This is a new apache2 install. I don't think it was working right before the update.

Before the update, I created this file: /var/www/localhost/htdocs/index.php

Code:

<html>
 <body>
  <?php phpinfo(); ?>
 </body>
</htm>


And it worked.

But, anything I put in a sub-directory off /var/www/localhost/htdocs/ would not work.
i.e. /var/www/localhost/htdocs/moodle/index.php would not work.

After I did a system update, apache2 will not start at all.

Code:

# rc-config start apache2
Starting init script
netmount          | * Mounting network filesystems ...                    [ ok ]
apache2           | * apache2 has detected an error in your setup:
apache2           |apache2:

Syntax error on line 150 of /etc/apache2/httpd.conf:
Syntax error on line 7 of /etc/apache2/modules.d/70_mod_php.conf:
Syntax error on line 2 of /var/lib/eselect-php/mod_php.conf:
:
Cannot load modules/mod_php.so into server: /usr/lib64/apache2/modules/mod_php.so:
cannot open shared object file: No such file or directory
apache2           | * ERROR: apache2 failed to start


Here is line 150 of /etc/apache2/httpd.conf
Code:
Include /etc/apache2/modules.d/*.conf


Here is line 7 of /etc/apache2/modules.d/70_mod_php.conf
Code:
Include "/var/lib/eselect-php/mod_php.conf"


Here is line 2 of /var/lib/eselect-php/mod_php.conf
Code:
LoadModule php7_module modules/mod_php.so


I am not sure why that specifies php7 - I never put that there.
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Sat Jul 08, 2017 10:38 am    Post subject: Reply with quote

Please post the output of:
Code:
emerge -pv www-servers/apache dev-lang/php


Also, did you run etc-update or similar tools after the upgrade?
Back to top
View user's profile Send private message
walterbyrd
n00b
n00b


Joined: 26 Apr 2017
Posts: 48

PostPosted: Sun Jul 09, 2017 6:30 pm    Post subject: Reply with quote

Code:

# emerge -pv www-servers/apache dev-lang/php

Local copy of remote index is up-to-date and will be used.

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary  N     ] dev-libs/oniguruma-5.9.5::gentoo  USE="-combination-explosion-check -crnl-as-line-terminator -static-libs" ABI_X86="(64) -32 (-x32)" 0 KiB
[binary  N     ] dev-libs/libmcrypt-2.5.8-r4::gentoo  0 KiB
[binary   R    ] www-servers/apache-2.4.25:2::gentoo  USE="ssl threads -debug -doc -ldap (-libressl) (-selinux) -static -suexec" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias -access_compat -asis -authn_dbd -authz_dbd -cache_disk -cache_socache -cern_meta -charset_lite -dbd -dumpio -http2 -ident -imagemap -lbmethod_bybusyness -lbmethod_byrequests -lbmethod_bytraffic -lbmethod_heartbeat -log_forensic -macro -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_fcgi -proxy_ftp -proxy_html -proxy_http -proxy_scgi -proxy_wstunnel -ratelimit -remoteip -reqtimeout -slotmem_shm -substitute -version" APACHE2_MPMS="-event -prefork -worker" 0 KiB
[binary  N     ] app-eselect/eselect-php-0.9.2::gentoo  USE="apache2 fpm" 0 KiB
[binary  N     ] dev-lang/php-7.0.19:7.0::gentoo  USE="acl apache2 berkdb bzip2 cli crypt ctype curl exif fileinfo filter fpm ftp gd gdbm hash iconv ipv6 json mysql nls opcache pdo phar posix readline session simplexml sockets sqlite ssl threads tokenizer truetype unicode webp xml xmlreader xmlwriter zip zlib -bcmath -calendar -cdb -cgi -cjk -coverage -debug -embed -enchant (-firebird) -flatfile -gmp -imap -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit (-libressl) -mhash -mssql -mysqli -oci8-instant-client -odbc -pcntl -phpdbg -postgres -qdbm -recode (-selinux) -sharedmem -snmp -soap -spell (-systemd) -sysvipc -tidy -wddx -xmlrpc -xpm -xslt" 0 KiB

Total: 5 packages (4 new, 1 reinstall, 5 binaries), Size of downloads: 0 KiB

 * IMPORTANT: 3 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Mon Jul 10, 2017 12:09 pm    Post subject: Reply with quote

You probably need to install dev-lang/php. And read news items with eselect.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Mon Jul 10, 2017 12:28 pm    Post subject: Reply with quote

walterbyrd wrote:
Code:

# emerge -pv www-servers/apache dev-lang/php
...
[binary  N     ] dev-lang/php-7.0.19:7.0::gentoo  USE="acl apache2 berkdb bzip2 cli crypt ctype curl exif fileinfo filter fpm ftp gd gdbm hash iconv ipv6 json mysql nls opcache pdo phar posix readline session simplexml sockets sqlite ssl threads tokenizer truetype unicode webp xml xmlreader xmlwriter zip zlib -bcmath -calendar -cdb -cgi -cjk -coverage -debug -embed -enchant (-firebird) -flatfile -gmp -imap -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit (-libressl) -mhash -mssql -mysqli -oci8-instant-client -odbc -pcntl -phpdbg -postgres -qdbm -recode (-selinux) -sharedmem -snmp -soap -spell (-systemd) -sysvipc -tidy -wddx -xmlrpc -xpm -xslt" 0 KiB
Where is your old PHP ?
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Mon Jul 10, 2017 12:34 pm    Post subject: Re: Apache2 stopped working after update Reply with quote

walterbyrd wrote:
[code]But, anything I put in a sub-directory off /var/www/localhost/htdocs/ would not work.
Are those PHP scripts displayed as text ? Because that means it works as expected. You've to tell Apache to *run* PHP-scripts in a particular subdir instead displaying them as text files (the later is the default mode of a web server).
Back to top
View user's profile Send private message
walterbyrd
n00b
n00b


Joined: 26 Apr 2017
Posts: 48

PostPosted: Mon Jul 10, 2017 3:52 pm    Post subject: Reply with quote

fturco wrote:
You probably need to install dev-lang/php. And read news items with eselect.


I thought I had. This was working.

Code:

<html>
 <body>
  <?php phpinfo(); ?>
 </body>
</htm>


After the update, I could no longer start apache2.

Even if PHP is not installed, shouldn't apache2 start?


Last edited by walterbyrd on Mon Jul 10, 2017 3:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
walterbyrd
n00b
n00b


Joined: 26 Apr 2017
Posts: 48

PostPosted: Mon Jul 10, 2017 3:55 pm    Post subject: Re: Apache2 stopped working after update Reply with quote

Quote:
Are those PHP scripts displayed as text ?


No. I was getting some error. I should have taken better notes.

Now, apache2 will not even run. If I can get apache2 running again, I will see what happens.
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Mon Jul 10, 2017 6:12 pm    Post subject: Reply with quote

walterbyrd wrote:
Even if PHP is not installed, shouldn't apache2 start?

Apache won't start if you include PHP modules in the configuration files and PHP is missing.
Back to top
View user's profile Send private message
walterbyrd
n00b
n00b


Joined: 26 Apr 2017
Posts: 48

PostPosted: Tue Jul 11, 2017 12:21 am    Post subject: Reply with quote

After updating. I have apache2 running again.

I have an app called opigno running in a subdirectory off /var/www/localhost/htdocs

When I try to run /var/www/localhost/htdocs/opigno/index.php

I get:

Code:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.
Apache Server at fir Port 80



The permissions are wide open.


Last edited by walterbyrd on Wed Jul 12, 2017 5:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Tue Jul 11, 2017 2:59 am    Post subject: Reply with quote

Per the hint from the output you quoted, what does the error log say about this failure?
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Tue Jul 11, 2017 7:31 am    Post subject: Reply with quote

walterbyrd wrote:
Code:
...
More information about this error may be available in the server error log.
Please look into the files in /var/log/apache2 - there's likely the information you need.
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