-   Linux - Networking (
-   -   apache config (

xpace 08-23-2005 09:16 AM

apache config
Hi guys,

It's a bit long story with my problem, but I'll try to make it short.

I'm kind of new to linux especially to mandrake 9.2 which I have installed just few days ago and trying to set it up as a server. I had already RH 9 before and all was working fine.
Now I've done exactly the same thing with mandrake and everything was ok until now, where I'm lost. It' just happened after rebooting my computer.

I can't see my website anymore as I'm getting message : The connection was refused when attempting to connect to "myserver"

I've checked the httpd.conf file and also I have anotherone there httpd2.conf and I don't know why, but they all look same and everything seems to be ok.

I can ping my pc I can browse the internet, I can do everything but see my website on it.

Can please anyone help, I've spent so much time with this and I don't wanna give up.

Any help would be really great



ramil 08-23-2005 01:35 PM

It seems that you ve myserver:80 firewalled or apache configs deny access to your website.

If you type this in command-line, what do you see?: `telnet myserver 80`. Replace myserver with your server's real hostname or ip address.

xpace 08-23-2005 05:40 PM

this is what i get

telnet: connect to address Connection refused
telnet: Unable to connect to remote host: Connection refused

what do you think and why it hapened just after reboot by itself?



ramil 08-23-2005 06:14 PM

Ok, here's what I think.

1) You need to find apache's PIDs using `ps -ax`, then use `netstat -na -p inet` to see all IP address/port pairs used by server processes (including apache). Make sure that apache is listening on the desired addess:port.

2) Read your httpd.conf, is Listen directive defined correctly? That is, did you specify the required adress:port?

3) Is apache started? Is it setup to start on boot?

4) Check your firewall settings.

Regaring why it happened only after reboot, there are many reasons, one of them is changing httpd.conf w/o restarting apache, but when you'd restart your machine, apache re-read the conf. Same can happen with firewall settings. Another possible reason is, if you have DHCP driven network, you might have just got another IP address after reboot, while you have specified the old IP in your httpd.conf. THere are many more reasons. Let's just try to identify your problem...

xpace 08-23-2005 06:42 PM

first os all thanks for you time

I've ran all the commands you gave me, but I couldn't find any apache related file listed.
my IP is static and I didn't change anything in httpd.conf file, firewall is off

anyway if you could please have a look at this file
the apache is actual file without extension, that's the listing of those 2 commands you gave me and on the end its actual httpd.conf file listed, so if you don't mind please have a look and tell me what's going on

I apreciate it.


Ghost_runner 08-23-2005 09:42 PM

try running

apachectl start

as root, apache may just not be starting automatically, if this works then you can add it to rc.local or somewhere (not sure on mandrake, but somewhere in a rc.d or similar)

xpace 08-24-2005 02:30 AM

apache is started and also I have restarted it few times

still same stuff


xpace 08-24-2005 02:36 AM

now I've tried apachectl status

and I got answer that apache is *not* running.

how is this possible and what is the problem

can anyone help?


ramil 08-24-2005 03:37 AM

xspace, i coudn't see apache process in the listings you've sent. So this makes me believe that apache is not running.

try running the following to check httpd.conf syntax check: httpd -t

if you're using this, run the following to check vhost confs: http -S

make sure that `/var/run/` file does not exist, if apache finds this file on startup, it will terminate immediately, thinking that another instance is already running; sometimes, if you do `kill -9` on apache, it will leave this file

at the last, do `apachectl start` and see what it tells you, if it goes off silently, you need to check the logs, i think that the error messages would go to system logs, not apache ones

ramil 08-24-2005 03:39 AM

you don't need to do vhost conf check as you don't have it in your httpd.conf

xpace 08-24-2005 06:20 AM


try running the following to check httpd.conf syntax check: httpd -t
well I'll do it if you tell me how, I've tried tu put in command line "check: httpd -t"
and it returns bad command or something like that

I know now that the apache is not running and I can't start it even when it shows me "started OK"

it's kind of weird stuff

but please heeeeeeeeeeeeeeeelp!!!!


Ghost_runner 08-24-2005 08:11 AM

I'm guessing it doesn't even show you an error mesg, like httpd already running, so it would be a simple matter of rm'ing the lock file. Your httpd.conf seems much simpler than mine, so I don't see that there are anything strange going on with it. Your setup problems really got me stumped.

ramil 08-24-2005 10:28 AM

Did you remove apache's pid file? Did you check your logs?

I agree that there's no need to run syntax check on on your apache conf, but just fyi on how-to, you type `httpd -t /path/to/httpd.conf` -- that's it

xpace 08-25-2005 03:58 AM


i didn't fine the apache's pid file so probably it doesn't exist, and I don't really know where to find those system logs, can you direct me ?


ramil 08-25-2005 04:36 AM

try these files:

All times are GMT -5. The time now is 06:19 AM.