PDA

View Full Version : Apache issue



jbrines
13th November 2015, 07:25 PM
Hi Guys,

I have screwed up my web server of my F23 and don't know how to resolve it, please help :)

When I go to the Test page I just get a listing of links, I would attach but it keeps failing, how do I get the test page back?

sehh
13th November 2015, 09:10 PM
Why not re-install the httpd RPM?

It should create a clean configuration under /etc/httpd/conf with the extension .rpmnew if the old one is still there, then you can compare the two.

jbrines
13th November 2015, 09:18 PM
Why not re-install the httpd RPM?

It should create a clean configuration under /etc/httpd/conf with the extension .rpmnew if the old one is still there, then you can compare the two.

How do you reinstall it without removing it and installing it?

nsnbm
13th November 2015, 11:45 PM
Use the reinstall command of dnf, or rpm?

jbrines
14th November 2015, 11:48 AM
Use the reinstall command of dnf, or rpm?

Thanks for that, done it. Now I am getting "This page can't be displayed" I have restarted the service and still the same

jbrines
14th November 2015, 03:55 PM
Thanks for that, done it. Now I am getting "This page can't be displayed" I have restarted the service and still the same

Got the page working but still giving a listing of pages instead of the test page!!!!

jbrines
14th November 2015, 07:58 PM
I actually think php isn't working

smr54
14th November 2015, 09:24 PM
Do you have the php module installed? Is there an index.php? What do you see when you go to localhost/index.php. What do you get at localhost/index.html?

This is dated but may help

I haven't tried to run apache on a systemd system, so I don't know if how its logs work, but generally, one also looks at httpd-error and access logs for clues as well. /var/log/messages is another I look at (I run it on CentOS-6.x and FreeBSD servers.) I don't know what systemd uses to replace /var/log/messages, but it's another place to look.

jbrines
14th November 2015, 09:39 PM
Do you have the php module installed? Is there an index.php? What do you see when you go to localhost/index.php. What do you get at localhost/index.html?

This is dated but may help

I haven't tried to run apache on a systemd system, so I don't know if how its logs work, but generally, one also looks at httpd-error and access logs for clues as well. /var/log/messages is another I look at (I run it on CentOS-6.x and FreeBSD servers.) I don't know what systemd uses to replace /var/log/messages, but it's another place to look.

PHP is installed, when I go to the php file it just shows the code of the page!

smr54
14th November 2015, 10:00 PM
Sorry, I had meant to post a link.
https://www.howtoforge.com/fedora-21-apache-mysql-php-lamp


If php just shows the php code, then it means php isn't running. It may be installed but not activated in apache. The link above may be useful, though actually, it just says to install php and restart apache. See if making a php.info page gives a result, as opposed to just the php code.

Is httpd.conf loading the php module?

(Again, not sure what Fedora does these days, but in CentOS it would be /etc/httpd/conf.d, and you would see a php.conf in there.)

My guess is that checking logs will be useful, again, not sure how systemd does it.

jbrines
14th November 2015, 10:04 PM
Sorry, I had meant to post a link.
https://www.howtoforge.com/fedora-21-apache-mysql-php-lamp


If php just shows the php code, then it means php isn't running. It may be installed but not activated in apache. The link above may be useful, though actually, it just says to install php and restart apache. See if making a php.info page gives a result, as opposed to just the php code.

Is httpd.conf loading the php module?

(Again, not sure what Fedora does these days, but in CentOS it would be /etc/httpd/conf.d, and you would see a php.conf in there.)

My guess is that checking logs will be useful, again, not sure how systemd does it.

I can't even get the Test Page!!!!

smr54
14th November 2015, 11:50 PM
Check the logs. That would be the next logical step.

jbrines
15th November 2015, 06:16 PM
Removed and install PHP and HTTPD, still the same issue, here is the error log.


[Sun Nov 15 17:00:08.332433 2015] [core:notice] [pid 3706] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Sun Nov 15 17:10:38.209515 2015] [mpm_prefork:notice] [pid 3706] AH00170: caught SIGWINCH, shutting down gracefully
[Sun Nov 15 17:10:44.778134 2015] [suexec:notice] [pid 4598] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Nov 15 17:10:44.996141 2015] [auth_digest:notice] [pid 4598] AH01757: generating secret for digest authentication ...
[Sun Nov 15 17:10:44.996796 2015] [ssl:warn] [pid 4598] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Sun Nov 15 17:10:44.999927 2015] [lbmethod_heartbeat:notice] [pid 4598] AH02282: No slotmem from mod_heartmonitor
[Sun Nov 15 17:10:45.422527 2015] [mpm_prefork:notice] [pid 4598] AH00163: Apache/2.4.17 (Fedora) OpenSSL/1.0.2d-fips PHP/5.6.15 configured -- resuming n
ormal operations
[Sun Nov 15 17:10:45.422693 2015] [core:notice] [pid 4598] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[root@brines-acer httpd] #

smr54
15th November 2015, 07:59 PM
Are you using SSL? I think the first thing is to see if you can get a simple apache server going with a default index.html.
http://forums.fedoraforum.org/showthread.php?t=300533 was a person with a firewall issue.

I'm not familiar with Fedora's apache, so really can't be much more help. But, if it's not working. First see if httpd, without any SSL or php, works. You can temporarily disable the firewall. If that fixes it, you know the problem is there. If it doesn't, you can put it back in place. Then, maybe try setenforce 0 to temporarily put SELinux in permissive. If it works, then the problem is SELinux related.


Generally speaking, first try it with the simplest setup possible. Once that works, you can take it from there.