Web Hosting Talk







View Full Version : Configuring httpd.conf for Apache


LancerForums
02-27-2002, 05:07 PM
Hi,

I need some help configuring my Apahce httpd.conf file for my new server. I'm running v. 1.3.x and when I try and start up apache it seems fine, but when I check it's status is output this:

httpd dead but subsys locked

I have webmin installed and was wondering if that could configure my site for me.

Here's what I am trying to setup. I currently have only one site online, but may have more in the future so I was trying to setup httpd.conf to use virtual hosts.

Here are the settings I have:

Listen 80
Listen 209.51.159.xxx
BindAddress *
Port 80
User apache
Group apache
DocumentRoot "/home"
<Directory "/home">
...
</Directory>
NameVirtualHost 209.51.159.xxx
<VirtualHost 209.51.159.xxx>
ServerName www.lancerforums.com
ServerAlias lancerforums.com
ServerAdmin webmaster@lancerforums.com
DocumentRoot /home/lancer/www
ErrorLog logs/lancerforums.com-error_log
CustomLog logs/lancerforums.com-access_log combined
</VirtualHost>


Let me know if you need more info. I put xxx in the ip for security reasons, but in my file it is correct.

Thanks,

Mark

jahsh
02-27-2002, 05:26 PM
try this:
/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/httpd start

if that doesnt work:
rm /var/lock/subsys/httpd

LancerForums
02-27-2002, 05:50 PM
This is what I get when I try to start it again:

Starting httpd: [Wed Feb 27 16:33:36 2002] [alert] httpd: Could not determine the server's fully qualified domain name, using
127.0.0.1 for ServerName

When I run /etc/rc.d/init.d/httpd status I get:

httpd dead but subsys locked

Now, if I type:

httpd stop

if gives the same error message, but then when I check the status of httpd it says:

httpd (pid 27699 27698 27697 27696 27695 27694 27693 27692 27691) is running...

:confused:

I tried deleting the file you told me, but it only exists when httpd is running and when I delete it httpd stops.

Any clude what the problem could be. Httpd never really worked from the first type I tried to restart it when it was a complete default. The weird thing was at that time the default apache www was showing up fine so I must be screwing something up.

Mark

jahsh
02-27-2002, 07:25 PM
make sure you have the server IP/domain name in /etc/hosts
as well as 127.0.0.1 locahost

bert
02-27-2002, 08:03 PM
Hi Mark,

Just try what jahsh said. Your /etc/hosts file should look similar to this:

127.0.0.1 localhost.localdomain localhost
Y.O.UR.IP host.domain.com

Also, make sure you have the proper DNS servers configured in /etc/resolv.conf:

search domain.com
nameserver XX.XX.XX.XX
nameserver XX.XX.XX.XX

Last, but not least, change the hostname of the system. Make sure it matches what the /etc/hosts file has. You can check it by typing hostname.

Hope this helps :)

LancerForums
02-28-2002, 12:07 AM
Ok, here's what my new hosts file and resolv.conf look like:

/etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 carma localhost.localdomain localhost
209.51.159.xxx host.domain.com

/etc/resolv.conf:

nameserver 209.51.128.xx
nameserver 209.51.128.xx

I tried restarting apache and no luck again. ServerName is still commented out in httpd.conf. Do I need to uncomment that line?

Here's my old server settings if that helps any.

/etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
216.177.33.xx lancerforums.com www.lancerforums.com

/etc/resolv.conf:
search lancerforums.com
lookup file bind
nameserver 216.177.33.xx

Thanks,

Mark

LancerForums
02-28-2002, 12:12 AM
Is it possible to setup the web server through webmin? Maybe that would be easier, since I'm clueless when it comes to DNS, etc.

Mark

bert
02-28-2002, 12:19 AM
I am not familiar at all with Webmin, but have you tried getting rid of the VirtualHost entry in httpd.conf and restarting apache ? I had a problem similar to yours a few days ago, and it turned out to be a conflict with DNS settings and a VirtualHost entry.

Try deleting the only VirtualHost entry you have and try to restart apache to see if that helps. At least by doing that you can determine the source of the problem.

LancerForums
02-28-2002, 12:33 AM
I commented out my virtualhost tags and it still gives the "Could not determine the server's fully qualified domain name" warning message. There's something I'm doing wrong because it was working with the default apache www directory. After I tried to change that the errors started showing up.

Mark

LancerForums
02-28-2002, 12:56 AM
Weird, I removed the virtualhost tags and started httpd with ServerName as lancerforums.com. I didn't get an error, but I still had the syslock message when I checked httpd's status. I then typed httpd stop and now the page loads up :confused: This can't be the way I should handle this. Does anyone know what could be causing this?

Mark

LancerForums
02-28-2002, 01:10 AM
Ok, now I realized if I set document root to /home/lancer/www it gives an error 403, but when it's /home it works fine... :mad:

Mark

bert
02-28-2002, 09:44 AM
Mark,

If you uncomment the VirtualHost tags and leave the ServerName as lancerforums.com will it work?

Also, change the ServerName from lancerforums.com to something like host.lancerforums.com.

Micheal
02-28-2002, 11:12 AM
Last, but not least, change the hostname of the system. Make sure it matches what the /etc/hosts file has. You can check it by typing hostname.



Ok how do you do this?

bert
02-28-2002, 11:24 AM
Just type hostname at the command:


root# hostname
server17.pronicsolutions.com

LancerForums
02-28-2002, 01:28 PM
My virtual tags are commented out right now. When I uncomment them I get the same problems with Apache and the 403 error.

When I type hostname it just says carma. Should I change ServerName to reflect that?

Thanks,

Mark

MotleyFool
03-01-2002, 09:51 AM
For httpd to start your hostname should resolve to a valid IP.. ie if you want to name your host as carma.lancerforums.com then you should either register the nameserver carma.lancerforums.com with internic.net and assign it the IP on your server or you should add a DNS entry in your SOA server of lanceforums.com [ie the server that has the IP 216.177.51.219]
<edit>
I see that netsol is your registrar; you register a host [nameserver] with them for carma.lancerforums.com and while the DNS propogates you add an A record for the subdomain carma.lancerforums.com in your DNS server
</edit>

After that you type apachectl graceful at the prompt as su and it should work is what the fool thinks

Cheers
Balaji

jahsh
03-01-2002, 09:01 PM
take carma out of your /etc/hosts

127.0.0.1 localhost
x.x.x.x www.domainname.com