LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-25-2011, 02:18 AM   #1
JimmyTaylor
LQ Newbie
 
Registered: Mar 2009
Posts: 7

Rep: Reputation: 0
Apache port redirection? Vhosts


Hi all,

I'm running a server with Ubuntu 10.04 installed. I recently set up a VirtualHost (I'll call it my.website.com), like I have in the past without any problems. But this time, I'm stumped. When I connect to my.website.com, it should hit port 80, right? It doesn't; rather, it hits port 8000. I don't have any rewrites/redirections (I checked wherever possible) and checked apache2.conf (httpd.conf is empty). Below are the Vhosts (the third Vhost is the one I set up):
Code:
NameVirtualHost 210.220.230.240:80
NameVirtualHost 210.220.230.241:80

<VirtualHost 210.220.230.240:80>
        ServerName log.website.com
        ServerAlias log.website.com
	DocumentRoot /home/website/public_html/logs
	ServerAdmin webmaster@website.com
        UseCanonicalName Off

# DocumentRoot /home/website/public_html/logs
# Directory /home/website/public_html/logs
# AuthDBMUserFile /home/website/passwd

	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/website/public_html/logs>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride AuthConfig
		Order allow,deny
		allow from all
                AuthName "Private"
                AuthType Basic
                AuthBasicProvider dbm
                AuthDBMUserFile /home/website/passwd
                Require valid-user
	</Directory>
	ScriptAlias /cgi-bin/ /home/website/public_html/cgi-bin/
	<Directory "/home/website/public_html/cgi-bin/">
		AllowOverride None
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /home/website/logs/website_error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /home/website/logs/website_access.log combined
        CustomLog /home/website/logs/website.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
	ServerSignature On

</VirtualHost>

<VirtualHost 210.220.230.241:80>
        ServerName log.website2.com
        ServerAlias log.website2.com
	DocumentRoot /home/website2/public_html/logs/
	ServerAdmin webmaster@website.com
        UseCanonicalName Off

	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/website2/public_html/logs>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride AuthConfig
		Order allow,deny
		allow from all
                AuthName "Private"
                AuthType Basic
                AuthBasicProvider dbm
                AuthDBMUserFile /home/website2/passwd
                Require valid-user
	</Directory>
	ScriptAlias /cgi-bin/ /home/website2/public_html/cgi-bin/
	<Directory "/home/website2/public_html/cgi-bin/">
		AllowOverride None
		Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /home/website2/logs/website2_error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /home/website2/logs/website2_access.log combined
        CustomLog /home/website2/logs/website2.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
	ServerSignature On

</VirtualHost>

<VirtualHost 210.220.230.240:80>
        ServerName my.website.com
        ServerAlias my.website.com
        DocumentRoot /home/website/user
        ServerAdmin webmaster@website.com
        UseCanonicalName Off

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        <Directory /home/website/user>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride AuthConfig
                Order allow,deny
                allow from all
			AuthName "Private"
			AuthType Basic
			AuthBasicProvider dbm
			AuthDBMUserFile /home/website/botpasswd
			Require valid-user
        </Directory>


        <Directory "/home/support/public_html/cgi-bin/">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /home/support/logs/support_error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /home/support/logs/support_access.log combined
        CustomLog /home/support/logs/support.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
        ServerSignature On

</VirtualHost>
Oh yeah, ports.conf doesn't have a listen on 8000, in case you are wondering.

It surely seems like a redirection, and if it is, what's causing it?

Thanks in advance for your help!

Last edited by JimmyTaylor; 03-25-2011 at 02:20 AM.
 
Old 03-25-2011, 04:56 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if it's a redirection you'll see a 302 response. Easiset way to be sure is to curl -v the domain name, as that will just dump the first response, so if you are being redirected you'll see it there.
 
Old 03-25-2011, 01:21 PM   #3
JimmyTaylor
LQ Newbie
 
Registered: Mar 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
if it's a redirection you'll see a 302 response. Easiset way to be sure is to curl -v the domain name, as that will just dump the first response, so if you are being redirected you'll see it there.
Thanks for the response, acid_kewpie.

I did what you said and it does connect to port 80. But when I pop the domain into the browser, it tries to connect to 8000. Any other suggestions?

Thanks again!
 
Old 03-25-2011, 01:26 PM   #4
JimmyTaylor
LQ Newbie
 
Registered: Mar 2009
Posts: 7

Original Poster
Rep: Reputation: 0
By Jove, it hit me right after I typed my post above.

I decided to blame Firefox for it, and tried IE and Safari. Guess what? It worked!

I need to find out why Firefox is messing up. Also, I need to start verifying things like this on multiple browsers. :P

Thanks again!
 
Old 03-25-2011, 01:39 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,217
Blog Entries: 1

Rep: Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070
Hi,

Comment out "UseCanonicalName Off" so apache uses the default (that is "On") and clear firefox cache.

Regards
 
Old 03-25-2011, 02:58 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by JimmyTaylor View Post
Thanks for the response, acid_kewpie.

I did what you said and it does connect to port 80. But when I pop the domain into the browser, it tries to connect to 8000. Any other suggestions?

Thanks again!
It will always connect to port 80, it's impossible not to without specifying otherwise. The issue is, what came back?
 
  


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
Squirrelmail and vhosts port question alepint Linux - Networking 3 06-02-2009 08:00 AM
Port redirection, iptables, apache questions? sarajevo Linux - Security 2 09-22-2006 07:02 AM
Help with Vhosts in apache please. GEEF Linux - Software 2 10-29-2004 08:18 PM
apache 2.0.44 vhosts sqn Slackware 4 06-19-2003 01:54 AM
Vhosts on RH 8.0 - Apache 2.0.40 Drogo Linux - Software 5 02-07-2003 12:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:14 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