LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Issues with Apache, Domain on 80, subdomain on 8080 (http://www.linuxquestions.org/questions/linux-server-73/issues-with-apache-domain-on-80-subdomain-on-8080-a-710893/)

nonexist 03-11-2009 08:40 PM

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

archangel_617b 03-12-2009 01:18 AM

Quote:

Originally Posted by nonexist (Post 3472541)
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

nonexist 03-12-2009 08:57 PM

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

archangel_617b 03-13-2009 01:24 AM

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

chitambira 03-13-2009 05:36 AM

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.

nonexist 03-17-2009 03:49 PM

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.

chitambira 03-18-2009 05:18 AM

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

nonexist 03-19-2009 09:11 AM

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.

bobmac010 03-19-2009 10:35 AM

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

chitambira 03-19-2009 11:21 AM

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)

nonexist 03-20-2009 01:40 AM

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


All times are GMT -5. The time now is 03:17 PM.