 |
 |
 |
 |
| Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc. |

9th May 2008, 07:51 AM
|
|
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.
|

9th May 2008, 08:21 PM
|
 |
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
|

9th May 2008, 10:36 PM
|
|
Registered User
|
|
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304

|
|
|
Post exact and complete error messages.
|

10th May 2008, 06:01 AM
|
|
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]
|

13th May 2008, 05:49 AM
|
 |
Registered User
|
|
Join Date: Jan 2008
Location: New Delhi, India
Posts: 2,068

|
|
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
|

27th May 2008, 03:52 PM
|
|
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
|

27th May 2008, 05:00 PM
|
 |
Registered User
|
|
Join Date: Jan 2008
Location: New Delhi, India
Posts: 2,068

|
|
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
|

28th May 2008, 01:58 AM
|
 |
Registered User
|
|
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168

|
|
|
I see "apachectl configtest". Are you using compiled source of Apache or you are using the Apache's httpd RPM?
|

28th May 2008, 03:21 AM
|
|
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
|
|

28th May 2008, 03:27 AM
|
|
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.
|

28th May 2008, 04:53 AM
|
 |
Registered User
|
|
Join Date: Jan 2008
Location: New Delhi, India
Posts: 2,068

|
|
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 downUnable 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
|

29th May 2008, 12:58 AM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 39

|
|
|
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.
|

31st May 2008, 02:07 AM
|
|
Registered User
|
|
Join Date: Oct 2007
Posts: 36

|
|
Quote:
|
Originally Posted by notageek
|
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.
|

31st May 2008, 05:58 PM
|
 |
Registered User
|
|
Join Date: Jan 2008
Location: New Delhi, India
Posts: 2,068

|
|
|
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.
__________________
Robot Nite - Designated device drivers drink free
|

1st June 2008, 01:08 AM
|
|
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?
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 20:13 (Saturday, 18-05-2013)
|
|
 |
 |
 |
 |
|
|