LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-31-2005, 07:29 PM   #1
Erik Thorsson
Member
 
Registered: Jun 2004
Location: NYC
Distribution: Fedora Core 1
Posts: 64

Rep: Reputation: 15
Setting up vhosts in apache 1.3.33


I can't seem to get them to work. I tried copying in the relevant lines from a working httpd 2.x httpd.conf on my current Fedora Core server into /etc/apache/httpd.conf, but no luck.

These are the relevant lines in my current /etc/apache/httpd.conf file on a Debian Sarge install with the 2.6.8-1 kernel, installed two days ago.

...
ServerName www.thenameofmydomain.com
...
Port 80
...
NameVirtualHost *

<VirtualHost *>
ServerAdmin e@thenameofmydomain.net
DocumentRoot /var/www/html
ServerName www.thenameofmydomain.net
ErrorLog logs/thenameofmydomain.net-error_logi
CustomLog logs/thenameofmydomain.net-access_log common
</VirtualHost>
...


Only trying one vhost for now, until I can get the server up. I've tried both the '*' and '*:80' in place of it and neither will work.


/usr/sbin/apache -S gives me...

oak:/etc/apache# /usr/sbin/apache -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server www.thenameofmydomain.net (/etc/apache/httpd.conf:1050)
port 80 namevhost www.thenameofmydomain.net (/etc/apache/httpd.conf:1050)
oak:/etc/apache#


Trying to start apache from the init.d script, I get the oh-so-helpful output...

oak:/etc/apache# /etc/init.d/apache start
Starting web server: apache failed
oak:/etc/apache#
 
Old 01-31-2005, 08:40 PM   #2
Erik Thorsson
Member
 
Registered: Jun 2004
Location: NYC
Distribution: Fedora Core 1
Posts: 64

Original Poster
Rep: Reputation: 15
More info...

Okay, poking around... I already read the 1.3 docs at apache.org, BTW. No workie. It *looks* like my config is okay, but the server won't start using /etc/init.d/apache start


Found apachectl...

oak:/etc/apache# apachectl configtest
Syntax OK
oak:/etc/apache#


Syntax of my httpd.conf file is good, no?

oak:/etc/apache# apachectl start
/usr/sbin/apachectl start: httpd could not be started
oak:/etc/apache#


Again...

usr/sbin/apache -S gives me...

oak:/etc/apache# /usr/sbin/apache -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server www.thenameofmydomain.net (/etc/apache/httpd.conf:1050)
port 80 namevhost www.thenameofmydomain.net (/etc/apache/httpd.conf:1050)
oak:/etc/apache#


Config looks good, right? Why won't it run? Incidentally, if I remove all my virtual hosts, the server starts right up. :\

-E
 
Old 01-31-2005, 09:46 PM   #3
Erik Thorsson
Member
 
Registered: Jun 2004
Location: NYC
Distribution: Fedora Core 1
Posts: 64

Original Poster
Rep: Reputation: 15
Got it.

Okay. Problem was with my virtual hosts' logs. I guess it was trying to write them to /etc/apache/logs (ServerRoot + logs/...). When I commented out the ErrorLog and CustomLog directives (as shown below) apache started right up.

What a stupid error. And nice of apachectl/apache to let me know what was wrong so I didn't spend all night running in circles around the web.

<VirtualHost *>
ServerAdmin e@thenameofmydomain.net
DocumentRoot /var/www/html
ServerName www.thenameofmydomain.net
#ErrorLog logs/thenameofmydomain.net-error_logi
#CustomLog logs/thenameofmydomain.net-access_log common
</VirtualHost>

There will be time to get the logging straight later. For now though, my server is up, and that's what matters.

-E
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Vhosts in apache please. GEEF Linux - Software 2 10-29-2004 07:18 PM
apache + dns + vhosts albertos Slackware 1 08-03-2003 07:03 PM
apache 2.0.44 vhosts sqn Slackware 4 06-19-2003 12:54 AM
apache vhosts question sqn Linux - Networking 0 04-01-2003 04:27 PM
Vhosts on RH 8.0 - Apache 2.0.40 Drogo Linux - Software 5 02-06-2003 11:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration