LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Access any sub domain urls gets map to one subdomain (https://www.linuxquestions.org/questions/programming-9/access-any-sub-domain-urls-gets-map-to-one-subdomain-646964/)

mohan.aturheart 06-04-2008 09:03 AM

Access any sub domain urls gets map to one subdomain
 
For the security reason i am not able to given my domain name. So i am explain the problems with other examples. I have a domain in the name of https://mohan.com. I am created website for the sub domain https://abc.mohan.com. I am also created other websites in the name of https://mno.mohan.com, https://xyz.mohan.com when i am accessing the https://mno.mohan.com i can get the website pages other than if i am browse without the ssl value http://mno.mohan.com (or) http://xyz.mohan.com I am get to the website http://abc.mohan.com. So i am not able to find the solution. Any one please help me?

Wim Sturkenboom 06-06-2008 07:56 AM

You probably don't (all) have virtual hosts defined for the http sites and only for the https sites. With a server configured as below, requests for e.g. site3.btd-techweb02 will show the page for btd-techweb02 (the first virtual host).
Code:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

# catch-all
<VirtualHost *:80>
    ServerAdmin a@b.c
    DocumentRoot /srv/httpd/htdocs
    ServerName btd-techweb02
</VirtualHost>

# site 1
<VirtualHost *:80>
    ServerAdmin a@b.c
    DocumentRoot /home/wim/www/site1/web
    ServerName site1.btd-techweb02
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common

#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site1/web">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

# site2
<VirtualHost *:80>
    ServerAdmin a@b.c
    DocumentRoot /home/wim/www/site2/web
    ServerName site2.btd-techweb02
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common

#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site2/web">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

PS How is this a programming question ?

mohan.aturheart 07-01-2008 07:19 AM

still i am facing the same problem
 
Quote:

Originally Posted by Wim Sturkenboom (Post 3176627)
You probably don't (all) have virtual hosts defined for the http sites and only for the https sites. With a server configured as below, requests for e.g. site3.btd-techweb02 will show the page for btd-techweb02 (the first virtual host).
Code:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

# catch-all
<VirtualHost *:80>
    ServerAdmin a@b.c
    DocumentRoot /srv/httpd/htdocs
    ServerName btd-techweb02
</VirtualHost>

# site 1
<VirtualHost *:80>
    ServerAdmin a@b.c
    DocumentRoot /home/wim/www/site1/web
    ServerName site1.btd-techweb02
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common

#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site1/web">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

# site2
<VirtualHost *:80>
    ServerAdmin a@b.c
    DocumentRoot /home/wim/www/site2/web
    ServerName site2.btd-techweb02
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common

#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site2/web">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

PS How is this a programming question ?

Thanks for your reply && sorry for the late reply

Wim Sturkenboom 07-08-2008 12:42 PM

Time to post the relevant parts of your apache configuration


All times are GMT -5. The time now is 12:00 AM.