PDA

View Full Version : Apache Not working!


Slyke
2008-03-04, 07:40 AM CST
OK, So first time used Fedora Core 6.

I've installed Apache, and tried to get it working.

When i try to start Apache by using:

/sbin/service httpd start or /etc/rc.d/init.d/httpd start

I get:
Starting httpd: httpd: Syntax error on line 188 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_access.so into server: /etc/httpd/modules/mod_access.so: cannot open shared object file: No such file or directory
With [Failed] in red.

Now i've tried using:
/usr/share/system-config-httpd/httpd.conf.xsl

But sadly:
-bash: /usr/share/system-config-httpd/httpd.conf.xsl: Permission denied

It doesn't matter if i'm root or not, i always get this error.

If someone knows how to fix the Apache config file, it would be greatly appreciated =).

pete_1967
2008-03-04, 09:07 AM CST
Did you use the GUI tool (in System->Administration->Services->thereabouts) to configure your server?

If so, it'll overwrite /etc/httpd/conf/httpd.conf enabling all possible modules (even those that are not installed). Someone mentioned original httpd.conf gets backed up, and someone said that both versions get loaded under certain circumstances (I've never used the GUI tool so can't confirm that).

Anyways, check above mentioned directory for your httpd.conf files, check the installed modules in /etc/httpd/modules/ and comment out all that are not in latter directory, in your httpd.conf

Stop and start your server.

Later you can then start to install and enable more modules, or disable ones you have no use for.

Slyke
2008-03-04, 09:24 AM CST
Yes, i did use the GUI version.

Thank you very much, i did see a backup config file in my wonders around trying to fix it myself. I'll replace the new one with the old one and see if that works.


Could you please tell me how to get root access? Like instead of opening up a terminal, typing su -, then typing sudo nautilus. Is there some type of "Open as root" somewhere? This would speed things up greatly.

pete_1967
2008-03-04, 09:29 AM CST
su [-] -c [program_name]

e.g `su - -c nautilus`

If you're logged in as root, you don't need to use 'sudo' for any command, sudo is a method to allow user run commands normally requiring root privileges, as user.


Use `man [command]` and/ or `info [command]` to get more information about command you want to use.


If you use ampersand (&) at the end of your command, e.g. `su - -c nautilus &`, it will place the process to the background and you can continue using same console for other tasks, otherwise CTRL+C in console will terminate the program you are running from it.

Slyke
2008-03-04, 09:36 AM CST
Thank you.

But now i get this error:

(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs



I checked my config file, and tried changing the Listen *:80 line to:
Listen *:80
Listen :80
Listen 80
Listen 127.0.0.1:80

But nothing worked. Listen *:80 Was the default.

Slyke
2008-03-04, 09:39 AM CST
Awesome, thanks for the tips with the root problem. I will make a little script for it =). If only it would allow the user i ue now, lol. I hate closing a nautilus window everytime i change folders.

pete_1967
2008-03-04, 09:41 AM CST
Thank you.

But now i get this error:

(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs



I checked my config file, and tried changing the Listen *:80 line to:
Listen *:80
Listen :80
Listen 80
Listen 127.0.0.1:80

But nothing worked. Listen *:80 Was the default.

Now it's time for you to click either/ or both of the links in my signature. There are plenty of solutions posted to your 2nd problem.

Slyke
2008-03-04, 09:57 AM CST
Actually, it started working when i used the root code you posted above.

Thank you for all your help =).

BlueC
2008-03-06, 02:34 AM CST
what is in /etc/hosts ?

paste the output of "cat /etc/hosts"

also, you are trying to start the service as root, right?

Slyke
2008-03-06, 02:37 AM CST
[Slyke@webserver ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 webserver.phoxenix webserver localhost.localdomain localhost webserver
::1 localhost6.localdomain6 localhost6
[Slyke@webserver ~]$


Yeah, of course =).

Also You might want to see:
[root@webserver ~]# nmap localhost

Starting Nmap 4.52 ( http://insecure.org ) at 2008-03-07 05:28 EST
Interesting ports on webserver.phoxenix (127.0.0.1):
Not shown: 1707 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp
8000/tcp open http-alt

Nmap done: 1 IP address (1 host up) scanned in 0.152 seconds
[root@webserver ~]#

BlueC
2008-03-06, 02:42 AM CST
ok, and your httpd.conf is listening on localhost:80 ?

e.g.

Listen 80
ServerName localhost:80

or

Listen 80
ServerName 127.0.0.1:80

and also, running "iptables -L" on your shell gives something like this:

ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https

leigh123linux
2008-03-06, 02:47 AM CST
Info from the other closed double post merged

http://forums.fedoraforum.org/showthread.php?p=974781#post974781

Slyke
2008-03-06, 03:19 AM CST
From the iptables:
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT esp -- anywhere anywhere
ACCEPT ah -- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT tcp -- anywhere anywhere tcp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT udp -- anywhere anywhere state NEW udp dpt:netbios-ns
ACCEPT udp -- anywhere anywhere state NEW udp dpt:netbios-dgm
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:netbios-ssn
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:microsoft-ds
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:telnet
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited


So they are in there, what to do now?


Inside my httpd.conf file:
Listen 80
ServerName 127.0.0.1:80

The servername was www.example.com:80, and it was commented, so i changed it to what i have above, saved it, tried to restart Apache, but it was the same error =(.


@ The moderator:
It wasn't a double post, one was with F6, the new 1 was with F8, and they were totally different problems, but sorry.

Slyke
2008-03-06, 06:24 AM CST
Fixed it.

system-config-httpd.conf this file had another Listen *:80 in it, after i commented it out, it worked fine =D. Thanks for all your help.