LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-04-2007, 12:54 AM   #1
roopunix
Member
 
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208

Rep: Reputation: 30
Apache strange behaviour.


I am running Fedora core 5 with Apache.If you see the following virtual host config you can see i have configured 3 Webhosting
the first 2 www.itlg.com and cyber.itlg.com is working fine, i mean the website is loaded on the browser with auhtentication as it has been configured for.But the last one citrus.itlg.com does not show up the website it should show up.It only shows the Fedora core Default page.with no aunthenticationa also.The dns has been configured well.I have tried with dig command
[root@itlg ~]# dig citrus.itlg.com
; <<>> DiG 9.3.2 <<>> citrus.itlg.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36306
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;citrus.itlg.com. IN A

;; ANSWER SECTION:
citrus.itlg.com. 86400 IN A 10.69.1.2

;; AUTHORITY SECTION:
itlg.com. 86400 IN NS mail.itlg.com.

;; ADDITIONAL SECTION:
mail.itlg.com. 86400 IN A 10.69.1.2

;; Query time: 1 msec
;; SERVER: 10.69.1.2#53(10.69.1.2)
;; WHEN: Thu Jan 4 12:38:48 2007
;; MSG SIZE rcvd: 84

The httpd -t shows that that the syntax is OK.But however when i try to issue comand
#httpd ---it give an error output

[root@itlg ~]# httpd
(98)Address already in use: make_sock: could not bind to address 10.69.1.2:80
no listening sockets available, shutting down
Unable to open logs
But still my first two web hosting are running fine.I have the access.log under /var/log but still it shows unable to open logs.

My Virtual Host Config

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
NameVirtualHost 10.69.1.2
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<VirtualHost cyber.itlg.com>
ServerName cyber.itlg.com
DocumentRoot /usr/local/bandwidthd/htdocs
<Directory /usr/local/bandwidthd/htdocs>
AuthType Basic
AuthName Darkness
AuthUserFile /etc/httpd/conf/webpass
require valid-user
</Directory>
</VirtualHost>
<VirtualHost www.itlg.com>
ServerName www.itlg.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AuthType Basic
AuthName darkness
AuthUserFile /etc/httpd/conf/webpass
require valid-user
</Directory>
</VirtualHost>
<VirtualHost citrus.itlg.com>
ServerName citrus.itlg.com
DocumentRoot /var/www/htm
<Directory /var/www/htm>
AuthType Basic
AuthName darkness
AuthUserFile /etc/httpd/conf/webpass
require valid-user
</Directory>
</VirtualHost>

[root@itlg ~]#


My Listening Port.

# Listen: Allows you to bind Apache to specific IP addresses and/or
# Change this to Listen on specific IP addresses as shown below to
#Listen 12.34.56.78:80
Listen 10.69.1.2:80


Please give me your Inputs.

Last edited by roopunix; 01-04-2007 at 01:57 AM.
 
Old 01-04-2007, 02:12 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,236

Rep: Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685Reputation: 1685
Quote:
<VirtualHost cyber.itlg.com>
This and the other similar directives are not correct. You should change your config like this:
Code:
NameVirtualHost *:80
...
<VirtualHost *:80>
ServerName cyber.itlg.com
...
</VirtualHost>
<VirtualHost *:80>
ServerName www.itlg.com
...
</VirtualHost>
<VirtualHost *:80>
ServerName citrus.itlg.com
...
</VirtualHost>
Of course you should take a backup first of your config.
Read this for more info.
To check your vhosts run:
Code:
httpd -S
To restart apache you should use your distro's stop/start scripts, or you can run:
Code:
apachectl restart
If it still doesn't work then perhaps you have to take a look at your Selinux settings.

Regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache strange behaviour ganz_friedrich Linux - Software 0 10-29-2006 03:28 PM
Apache 2.0.54 DocRoot strange behaviour with VirtualHost dimsh Linux - Newbie 2 12-24-2005 03:31 AM
Strange Behaviour! joshuarowley LQ Suggestions & Feedback 1 12-08-2005 03:36 PM
Strange behaviour Anmol SUSE / openSUSE 2 10-27-2005 11:05 PM
Strange Behaviour mikeyt_3333 Linux - General 4 08-06-2001 03:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:57 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration