LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-11-2009, 07:40 PM   #1
nonexist
LQ Newbie
 
Registered: Sep 2007
Location: Live Music Captial of the World
Distribution: Linux Mint, Ubuntu 8.04 Server
Posts: 12

Rep: Reputation: 0
Issues with Apache, Domain on 80, subdomain on 8080


Well this works all fine.

If you go to mydomain.com:80 it is fine, and mydomain.com:8080 but what the subdomain on port 8080 is suppose to be paradiso.mydomain.com:8080.

My current setup is an Ubuntu 8.04 Apache 2 box with the conf being

/sites-enabled/main
Code:
<VirtualHost *:80>
	ServerAdmin admin@mydomain.com
	ServerName mydomain.com
	ServerAlias www.mydomain.com
	DocumentRoot /home/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

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

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On


</VirtualHost>
and the
subdomain
Code:
<VirtualHost *:6969>
	ServerAdmin admin@mydomain.com
	ServerName subdomain.mydomain.com
	ServerAlias www.subdomain.mydomain.com subdomain.mydomain.com
	DocumentRoot /home/www/subdomain/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/www/subdomain/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

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

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On

</VirtualHost>
I am wondering if I am missing something in the vhost

Any comments or help is always much appreciated

-nonexist

Last edited by nonexist; 03-12-2009 at 07:55 PM.
 
Old 03-12-2009, 12:18 AM   #2
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
Quote:
Originally Posted by nonexist View Post
If you go to mydomain.com:80 it is fine, and mydomain.com:8080 but what the subdomain on port 8080 is suppose to be paradiso.mydomain.com:8080.

and the subdomain
Code:
<VirtualHost *:6969>
	ServerAdmin admin@mydomain.com
	ServerName subdomain.mydomain.com
	ServerAlias www.subdomain.mydomain.com subdomain.x00n.com
I am wondering if I am missing something in the vhost

Any comments or help is always much appreciated

-nonexist
Uh, any reason you're VirtualHost config as given doesn't match at all what you described? Netier port 8080 nor the server name (or alias) "paradision.mydomain.com" appear in the vhost config you give...

- Arch
 
Old 03-12-2009, 07:57 PM   #3
nonexist
LQ Newbie
 
Registered: Sep 2007
Location: Live Music Captial of the World
Distribution: Linux Mint, Ubuntu 8.04 Server
Posts: 12

Original Poster
Rep: Reputation: 0
Sorry. Complete issue with my config. I was messing around with it as I was posting this to see if I could find a fix, and forgot to fix it.
But the two ports are 80 and 6969. I am trying to get the subdomain on the port 6969, so it would be like "paradiso.mydomain.com:6969" but it gives errors. The file I have in place for the subdomain works if you go to mydomain.com:6969.

Sorry for the confusing post :?
Code:
<VirtualHost *:80>
	ServerAdmin admin@mydomain.com
	ServerName mydomain.com
	ServerAlias www.mydomain.com
	DocumentRoot /home/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

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

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On


</VirtualHost>
and the
subdomain
Code:
<VirtualHost *:6969>
	ServerAdmin admin@mydomain.com
	ServerName subdomain.mydomain.com
	ServerAlias www.subdomain.mydomain.com subdomain.mydomain.com
	DocumentRoot /home/www/subdomain/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/www/subdomain/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

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

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On

</VirtualHost>
I am wondering if I am missing something in the vhost

Any comments or help is always much appreciated

-nonexist
 
Old 03-13-2009, 12:24 AM   #4
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
Okay, you may just need to add Listen *:6969, or whatever port you want, to your httpd.conf (or ports.conf under Debian/Ubuntu).

- Arch
 
Old 03-13-2009, 04:36 AM   #5
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
Why is it that you are trying "paradiso.mydomain.com:6969" when you have in your conf "subdomain.mydomain.com"?
Also make sure that your dns configs for the two are set properly.
 
Old 03-17-2009, 02:49 PM   #6
nonexist
LQ Newbie
 
Registered: Sep 2007
Location: Live Music Captial of the World
Distribution: Linux Mint, Ubuntu 8.04 Server
Posts: 12

Original Poster
Rep: Reputation: 0
Ok. Lets try this again.
If I have the setup for the subdomain (cleaned) as
Code:
<VirtualHost *:6969>
	ServerAdmin email@mailserver.com
	ServerName paradiso.mydomain.com
	ServerAlias paradiso.mydomain.com
	DocumentRoot /home/nexea/mydomain.com/paradiso/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /home/nexea/mydomain.com/paradiso/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog /var/log/apache2/error.log

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

	CustomLog /var/log/apache2/access.log combined
	ServerSignature On

    Alias /phpMyAdmin "/home/nexea/mydomain.com/phpmyadmin"
    <Directory "/phpmyadmin/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 70.116.72.59/255.255.255.0 ::1/128
    </Directory>

</VirtualHost>
I still have this problem. I have the domain through GoDaddy, is there anything I need to fix through there.
 
Old 03-18-2009, 04:18 AM   #7
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
from archangel_617b
Quote:
Okay, you may just need to add Listen *:6969, or whatever port you want, to your httpd.conf (or ports.conf under Debian/Ubuntu).
Did you do this?
whats your output for # netstat -antp
 
Old 03-19-2009, 08:11 AM   #8
nonexist
LQ Newbie
 
Registered: Sep 2007
Location: Live Music Captial of the World
Distribution: Linux Mint, Ubuntu 8.04 Server
Posts: 12

Original Poster
Rep: Reputation: 0
Alright. Here is root netstat.
Code:
nexea@toast:~$ sudo netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      4208/mysqld
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      5682/apache2
tcp        0      0 192.168.1.180:53        0.0.0.0:*               LISTEN      4088/named
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      4088/named
tcp        0      0 0.0.0.0:6969            0.0.0.0:*               LISTEN      5682/apache2
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      4360/master
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      4088/named
tcp6       0      0 :::21                   :::*                    LISTEN      4466/proftpd: (acce
tcp6       0      0 :::53                   :::*                    LISTEN      4088/named
tcp6       0      0 :::22                   :::*                    LISTEN      4110/sshd
tcp6       0      0 :::25                   :::*                    LISTEN      4360/master
tcp6       0      0 ::1:953                 :::*                    LISTEN      4088/named
tcp6       0   1184 192.168.1.180:22        70.116.72.59:1071       ESTABLISHED 9058/sshd: nexea [p
tcp6       0     33 192.168.1.180:21        222.73.0.104:47942      ESTABLISHED 9238/proftpd: ::fff
tcp6       0      0 192.168.1.180:22        70.116.72.59:1070       ESTABLISHED 9053/sshd: nexea [p
nexea@toast:~$
It shows that it is listening for :6969, and I can get there. I type in mydomain.com:6969 and I get my little holder page saying hello. Now how can I get that to work with the subdomain on that port.
 
Old 03-19-2009, 09:35 AM   #9
bobmac010
LQ Newbie
 
Registered: Jun 2003
Distribution: Slackware
Posts: 29

Rep: Reputation: 15
Is paradiso.mydomain.com defined in your DNS server?
Apache will only send requests to virtualhosts if the request matches the v-host definition.
If there is no match, it uses the first virtualhost container.
Before making the changes in your DNS Server, add the name and IP to your hosts file and test it.
Don't forget to remove the hosts entry when you are done.
Bob
 
Old 03-19-2009, 10:21 AM   #10
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
Quote:
Also make sure that your dns configs for the two are set properly.
Im sure I had also asked nonexist about the dns already (he did not comment on that)
 
Old 03-20-2009, 12:40 AM   #11
nonexist
LQ Newbie
 
Registered: Sep 2007
Location: Live Music Captial of the World
Distribution: Linux Mint, Ubuntu 8.04 Server
Posts: 12

Original Poster
Rep: Reputation: 0
Alright.
Here is /etc/hosts
Code:
127.0.0.1	localhost
192.168.1.180	toast.mydomain.com	toast
192.168.1.180 paradiso.mydomain.com	paradiso

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
@chitambira sorry about that.
Im not really sure what I would change. I have most of the configuration through GoDaddy, so would I add CNAME like
Host: paradiso Points To: mydomain.com TTL: 1 hour

Or would I have it point to @ with the port like
Host: paradiso Points To: @:6969 TTL: 1 hour

-nonexist
 
  


Reply

Tags
apache, apache2, ports, vhosts


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
Access any sub domain urls gets map to one subdomain mohan.aturheart Programming 3 07-08-2008 12:42 PM
How to add two domain on DNS server (not subdomain) AK007HK Linux - Server 8 07-05-2008 12:29 AM
Yet another apache domain/subdomain problem xtra Linux - Newbie 2 08-18-2004 07:30 AM
Domain and subdomain macadam Linux - Newbie 2 09-18-2003 04:00 PM


All times are GMT -5. The time now is 08:32 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration