Fedora Linux Support Community & Resources Center
  #1  
Old 9th May 2008, 07:51 AM
Query Offline
Registered User
 
Join Date: Oct 2007
Posts: 36
configuration syntax error in httpd.conf.

I got configuration syntax error in httpd.conf.. dont' know why. We have three ips pointing to the /var/www/html. I would like to make one ip for /var/www/mydomain.com. I add the following line in httpd.conf and make /var/www/mydomain.com owned by apache. but I still got error.

<VirtualHost xxx.xxx.xx.xx>
ServerAdmin webmaster@mydomain.com
DocumentRoot /var/www/mydomain.com
#ServerName blahblah
ErrorLogs logs/mydomain.com-error_log
accessLogs logs/mydomain.com-access_log

</VirtualHost>

P.s

1) I got syntax error be it commend that line of ServerName out or not.
2) I don't run my own DNS server. I have an A-record pointing to that ip by my Domain name provider.

Please help! Thanks in advance.
Reply With Quote
  #2  
Old 9th May 2008, 08:21 PM
BandC Offline
Registered User
 
Join Date: Nov 2004
Posts: 1,105
Are you sure you have a directory called /var/www/mydomain.com on your server (It is possible but it is a kinda unconventional place to put it)?

/var/www/mydomain.com has to be a physical directory that exists on your server.

Maybe you meant /var/www/html/mydomain.com
__________________
IMHO GNOME FTW! BTW KDE WAD? FWIW. HTH. AFAIK YMMV. OMG WTF BBQ! :rolleyes:

Do you like surfing forums but wish people would stop using obscure abbreviations and acronyms?
Then my Firefox/Chrome extension ABBREX is for you!
It automatically adds hover tooltips to abbreviations displaying their meanings on any web page you visit!

Check it out at: http://abbrex.com
Reply With Quote
  #3  
Old 9th May 2008, 10:36 PM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,306
Post exact and complete error messages.
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
  #4  
Old 10th May 2008, 06:01 AM
Query Offline
Registered User
 
Join Date: Oct 2007
Posts: 36
Quote:
Originally Posted by BandC
Are you sure you have a directory called /var/www/mydomain.com on your server (It is possible but it is a kinda unconventional place to put it)?

/var/www/mydomain.com has to be a physical directory that exists on your server.

Maybe you meant /var/www/html/mydomain.com
I created /var/www/mydomain.com on my server. So yes,. I am sure I have such directory. I have even created a Listen directive on httpd.conf

Listen xxx.xx.xx.xx:80

I got this error after I reload apache:
----
Reloading httpd: not reloading due to configuration syntax error
[FAILED]
Reply With Quote
  #5  
Old 13th May 2008, 05:49 AM
notageek Online
Registered User
 
Join Date: Jan 2008
Location: Bangalore, India
Posts: 2,128
Hello:

To enable VirtualHosts, you need to have the following line uncommented before you define Virtual hosts.

Code:
NameVirtualHost *:80
Here's a complete example of VirtualHost

Code:
# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>

DocumentRoot /www/example1
ServerName www.example1.com

# Other directives here


</VirtualHost>

<VirtualHost *:80>

DocumentRoot /www/example2
ServerName www.example2.org

# Other directives here


</VirtualHost>
__________________
Robot Nite - Designated device drivers drink free
Reply With Quote
  #6  
Old 27th May 2008, 03:52 PM
Query Offline
Registered User
 
Join Date: Oct 2007
Posts: 36
Well.. you are right about NameVirtualHost to be commented out.. however I still got error:

# apachectl configtest
[Tue May 27 06:54:46 2008] [warn] NameVirtualHost *:80 has no VirtualHosts
Syntax OK
Reply With Quote
  #7  
Old 27th May 2008, 05:00 PM
notageek Online
Registered User
 
Join Date: Jan 2008
Location: Bangalore, India
Posts: 2,128
Quote:
[Tue May 27 06:54:46 2008] [warn] NameVirtualHost *:80 has no VirtualHosts
Its unable to find <VirtualHosts> declaration, and btw its a warning not an error you also get Syntax OK

Start Apache, you should have working web server (not sure what it'll host though )
__________________
Robot Nite - Designated device drivers drink free
Reply With Quote
  #8  
Old 28th May 2008, 01:58 AM
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 43
Posts: 4,168
I see "apachectl configtest". Are you using compiled source of Apache or you are using the Apache's httpd RPM?
Reply With Quote
  #9  
Old 28th May 2008, 03:21 AM
Query Offline
Registered User
 
Join Date: Oct 2007
Posts: 36
Quote:
Originally Posted by notageek
Its unable to find <VirtualHosts> declaration, and btw its a warning not an error you also get Syntax OK

Start Apache, you should have working web server (not sure what it'll host though )
failed. Does it mean that I can't use it on port80, which is occupied by my other website?

Quote:
# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Tue May 27 19:14:48 2008] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address xxx.xxx.yyy.xx:80
no listening sockets available, shutting down
Unable to open logs
Reply With Quote
  #10  
Old 28th May 2008, 03:27 AM
Query Offline
Registered User
 
Join Date: Oct 2007
Posts: 36
Quote:
Originally Posted by marcrblevins
I see "apachectl configtest". Are you using compiled source of Apache or you are using the Apache's httpd RPM?
No idea.. It's the VPS the host has given me.
Reply With Quote
  #11  
Old 28th May 2008, 04:53 AM
notageek Online
Registered User
 
Join Date: Jan 2008
Location: Bangalore, India
Posts: 2,128
Quote:
# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Tue May 27 19:14:48 2008] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address xxx.xxx.yyy.xx:80
no listening sockets available, shutting down
Unable to open logs
Aww!! I fought this error before here's the link, read on.
http://forums.fedoraforum.org/forum/...d.php?t=180486

Perhaps it'll be easier for us to help you if you could post httpd.conf.
__________________
Robot Nite - Designated device drivers drink free
Reply With Quote
  #12  
Old 29th May 2008, 12:58 AM
Soapta Offline
Registered User
 
Join Date: May 2008
Posts: 41
i struggled myself with the http configuration gui a couple a days ago. then i noticed that it creates the file /etc/httpd/conf.d/system-config-httpd.conf and decided to manually modify it to get it working. after that reloaded it using the gui and ended up with following hints:

- main tab - delete everything from available adresses
- virtual hosts tab
- default virtual host - handle all remaining requests
- www.dom1.com - virtual host name - www.dom1.com
- document root directory - /var/www/dom1.com
- name based virtual host
- ip address - 192.168.1.5
- host name - www.dom1.com

wich after pressing ok button will show

www.dom1.com on 192.168.1.5

repeat for all other name based virtual hosts and save.

all other variations i tried resulted in a messed up the config file and non-working apache.
Reply With Quote
  #13  
Old 31st May 2008, 02:07 AM
Query Offline
Registered User
 
Join Date: Oct 2007
Posts: 36
Quote:
Originally Posted by notageek
Aww!! I fought this error before here's the link, read on.
http://forums.fedoraforum.org/forum/...d.php?t=180486

Perhaps it'll be easier for us to help you if you could post httpd.conf.
Hi.. notageek Which part of httpd.conf do you want? I have posted my virtualHost part earlier.

I have read the thread. It seems my problem is different in that I have apache running on port 80 with my first IP. I just can't get virtual host to work on my second ip with port 80.

Is it possible to have both ips on port 80 with different documentroot?

Last edited by Query; 31st May 2008 at 03:27 AM.
Reply With Quote
  #14  
Old 31st May 2008, 05:58 PM
notageek Online
Registered User
 
Join Date: Jan 2008
Location: Bangalore, India
Posts: 2,128
There's a possibility of a typo in your httpd.conf

Here's mine with two working Virtualhosts, maybe this helps.

Use vimdiff yourfile myfile to read the difference.
Attached Files
File Type: conf httpd.conf (33.7 KB, 84 views)
__________________
Robot Nite - Designated device drivers drink free
Reply With Quote
  #15  
Old 1st June 2008, 01:08 AM
Query Offline
Registered User
 
Join Date: Oct 2007
Posts: 36
Well.. ServerName should be provided in the virtual host . How can I add one for my virtual host?
Reply With Quote
Reply

Tags
configuration, error, httpdconf, syntax

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP/APACHE Server Configuration Question & httpd.conf jazzer386 Using Fedora 4 29th August 2008 07:15 PM
httpd.conf configuration ashiers Servers & Networking 9 13th January 2008 07:46 PM
httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /us Kingtu Servers & Networking 2 5th April 2007 12:54 AM
Httpd Syntax error mrman2787 Servers & Networking 4 18th August 2005 10:10 PM
ci problems with /etc/httpd/conf/httpd.conf lonelylost_brar Servers & Networking 2 8th June 2005 08:17 PM


Current GMT-time: 12:22 (Thursday, 24-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat