You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amira Othman <a....@cairosource.com> on 2011/07/05 15:20:43 UTC

[users@httpd] subdomains

Hi All,

I am using httpd-2.2.3-43.3 on centos 5.6.I created subdomain ,it works fine
except when calling image I found in log file that it goes to wrong path
although I am writing the correct one in document root 

Mydomain.com/subdomain     works fine

Subdomain.mydomain.com        fine but images have wrong path

 

 


Amira Othman

Server Administrator

 <http://www.cairosource.com/> www.cairosource.com

 



6 EL Nil EL Abyad, Mohandiseen 

Cairo, Egypt

Direct:     +2 02 3303 7175
Mobile:   +2 012 220 4165

 

The information transmitted is intended solely for the individual or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of or
taking action in reliance upon this information by persons or entities other
than the intended recipient is prohibited. If you have received this email
in error please contact the sender and delete the material from any
computer.

 

 


RE: [users@httpd] subdomains

Posted by Amira Othman <a....@cairosource.com>.
Hello Jeroen

I tried to send you configuration file the virtual host part and logs but it
can't be send L so would you please send me w website that explains how to
have subdomain in apache

 

Hello Jeroen

Thanks for reply.I already created 2 virtual host one pointing to (its
document root) /mydomain and the other is pointing to /mydomain/admin


Don't do that.
VirtualHosts should never overlap, as unexpected things will happen and
access controls become... interesting.




the problem is I want admin.mydomain 


Not mentioned above; please understand that a virtualhost is defined by a
Servername and a Documentroot.

It is neither of those things by itself, and neither of those things is
directly related to the other, either.

The virtualhost is what relates them.





to work correctly while it does not because each time I type url it load the
correct index.php but after that everything goes wrong 


That's not very descriptive.
Include the relevant configuration and logs that show the issue.





and log file has error that file does not exist because it search for it in
wrong path. It always search for it under /mydomain/admin/ while files
actually exist under /mydomain. The files that located in /mydomain/admin
works fine .sorry but I am new to apache .that is how I understand the
problem but I don't know what to do.


You should take a long, hard look at the documentation for virtual hosting:

http://httpd.apache.org/docs/current/vhosts/

This explains several key concepts.

--
J.




 

 

From: Jeroen Geilman [mailto:jeroen@adaptr.nl] 
Sent: Tuesday, July 05, 2011 10:23 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] subdomains

 

On 2011-07-05 15:20, Amira Othman wrote: 

Hi All,

I am using httpd-2.2.3-43.3 


That's pretty old.





on centos 5.6.


Ah, that explains that.





I created subdomain 


A whut ? Apache doesn't know or care about "domains". 
A hostname is a hostname.





,it works fine except when calling image I found in log file that it goes to
wrong path


How so ? 
Do you have logs and configuration that show this ?





although I am writing the correct one in document root 

Mydomain.com/subdomain     works fine


That's not a documentroot; it points to a subdirectory of the documentroot.





Subdomain.mydomain.com        fine but images have wrong path


That's not a documentroot either, but a fully-qualified hostname, different
from the one above.
Typically, that indicates that this is a different vhost, ergo a separate
site.





 

 


Amira Othman

Server Administrator

 <http://www.cairosource.com/> www.cairosource.com

 



6 EL Nil EL Abyad, Mohandiseen 

Cairo, Egypt

Direct:     +2 02 3303 7175
Mobile:   +2 012 220 4165

 


Disappointing.





The information transmitted is intended solely for the individual or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of or
taking action in reliance upon this information by persons or entities other
than the intended recipient is prohibited. If you have received this email
in error please contact the sender and delete the material from any
computer.


You're posting to a publically archived mailing list.
Should I delete the message ? 

--
J.




 


Re: [users@httpd] subdomains

Posted by Jeroen Geilman <je...@adaptr.nl>.
On 2011-07-06 10:00, Amira Othman wrote:
>
> Hello Jeroen
>
> Thanks for reply.I already created 2 virtual host one pointing to (its 
> document root) /mydomain and the other is pointing to /mydomain/admin
>

Don't do that.
VirtualHosts should never overlap, as unexpected things will happen and 
access controls become... interesting.

> the problem is I want admin.mydomain
>

Not mentioned above; please understand that a virtualhost is defined by 
a Servername and a Documentroot.

It is neither of those things by itself, and neither of those things is 
directly related to the other, either.

The virtualhost is what relates them.


> to work correctly while it does not because each time I type url it 
> load the correct index.php but after that everything goes wrong
>

That's not very descriptive.
Include the relevant configuration and logs that show the issue.


> and log file has error that file does not exist because it search for 
> it in wrong path. It always search for it under /mydomain/admin/ while 
> files actually exist under /mydomain. The files that located in 
> /mydomain/admin works fine .sorry but I am new to apache .that is how 
> I understand the problem but I don't know what to do.
>

You should take a long, hard look at the documentation for virtual hosting:

http://httpd.apache.org/docs/current/vhosts/

This explains several key concepts.

--
J.

> *From:*Jeroen Geilman [mailto:jeroen@adaptr.nl]
> *Sent:* Tuesday, July 05, 2011 10:23 PM
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] subdomains
>
> On 2011-07-05 15:20, Amira Othman wrote:
>
> Hi All,
>
> I am using httpd-2.2.3-43.3
>
>
> That's pretty old.
>
>
> on centos 5.6.
>
>
> Ah, that explains that.
>
>
> I created subdomain
>
>
> A whut ? Apache doesn't know or care about "domains".
> A hostname is a hostname.
>
>
> ,it works fine except when calling image I found in log file that it 
> goes to wrong path
>
>
> How so ?
> Do you have logs and configuration that show this ?
>
>
> although I am writing the correct one in document root
>
> Mydomain.com/subdomain     works fine
>
>
> That's not a documentroot; it points to a subdirectory of the 
> documentroot.
>
>
> Subdomain.mydomain.com        fine but images have wrong path
>
>
> That's not a documentroot either, but a fully-qualified hostname, 
> different from the one above.
> Typically, that indicates that this is a different vhost, ergo a 
> separate site.
>
>
> *Amira Othman*
>
> *Server Administrator*
>
> *www.cairosource.com* <http://www.cairosource.com/>
>
> 	
>
> **
>
> 	
>
> 6 EL Nil EL Abyad, Mohandiseen
>
> Cairo, Egypt
>
> *Direct: *  +2 02 3303 7175
> *Mobile: *  +2 012 220 4165
>
>
> Disappointing.
>
>
> The information transmitted is intended solely for the individual or 
> entity to which it is addressed and may contain confidential and/or 
> privileged material. Any review, retransmission, dissemination or 
> other use of or taking action in reliance upon this information by 
> persons or entities other than the intended recipient is prohibited. 
> If you have received this email in error please contact the sender and 
> delete the material from any computer.
>
>
> You're posting to a publically archived mailing list.
> Should I delete the message ?
>
> --
> J.
>


RE: [users@httpd] subdomains

Posted by Amira Othman <a....@cairosource.com>.
Hello Jeroen

Thanks for reply.I already created 2 virtual host one pointing to (its
document root) /mydomain and the other is pointing to /mydomain/admin the
problem is I want admin.mydomain to work correctly while it does not because
each time I type url it load the correct index.php but after that everything
goes wrong and log file has error that file does not exist because it search
for it in wrong path. It always search for it under /mydomain/admin/ while
files actually exist under /mydomain. The files that located in
/mydomain/admin works fine .sorry but I am new to apache .that is how I
understand the problem but I don't know what to do.

 

 

From: Jeroen Geilman [mailto:jeroen@adaptr.nl] 
Sent: Tuesday, July 05, 2011 10:23 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] subdomains

 

On 2011-07-05 15:20, Amira Othman wrote: 

Hi All,

I am using httpd-2.2.3-43.3 


That's pretty old.




on centos 5.6.


Ah, that explains that.




I created subdomain 


A whut ? Apache doesn't know or care about "domains". 
A hostname is a hostname.




,it works fine except when calling image I found in log file that it goes to
wrong path


How so ? 
Do you have logs and configuration that show this ?




although I am writing the correct one in document root 

Mydomain.com/subdomain     works fine


That's not a documentroot; it points to a subdirectory of the documentroot.




Subdomain.mydomain.com        fine but images have wrong path


That's not a documentroot either, but a fully-qualified hostname, different
from the one above.
Typically, that indicates that this is a different vhost, ergo a separate
site.




 

 


Amira Othman

Server Administrator

 <http://www.cairosource.com/> www.cairosource.com

 



6 EL Nil EL Abyad, Mohandiseen 

Cairo, Egypt

Direct:     +2 02 3303 7175
Mobile:   +2 012 220 4165

 


Disappointing.




The information transmitted is intended solely for the individual or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of or
taking action in reliance upon this information by persons or entities other
than the intended recipient is prohibited. If you have received this email
in error please contact the sender and delete the material from any
computer.


You're posting to a publically archived mailing list.
Should I delete the message ? 

--
J.




Re: [users@httpd] subdomains

Posted by Jeroen Geilman <je...@adaptr.nl>.
On 2011-07-05 15:20, Amira Othman wrote:
>
> Hi All,
>
> I am using httpd-2.2.3-43.3
>

That's pretty old.

> on centos 5.6.
>

Ah, that explains that.

> I created subdomain
>

A whut ? Apache doesn't know or care about "domains".
A hostname is a hostname.

> ,it works fine except when calling image I found in log file that it 
> goes to wrong path
>

How so ?
Do you have logs and configuration that show this ?

> although I am writing the correct one in document root
>
> Mydomain.com/subdomain     works fine
>

That's not a documentroot; it points to a subdirectory of the documentroot.

> Subdomain.mydomain.com        fine but images have wrong path
>

That's not a documentroot either, but a fully-qualified hostname, 
different from the one above.
Typically, that indicates that this is a different vhost, ergo a 
separate site.

> *Amira Othman***
>
> *Server Administrator*
>
> *www.cairosource.com* <http://www.cairosource.com/>**
>
> 	
>
> **
>
> 	
>
> 6 EL Nil EL Abyad, Mohandiseen
>
> Cairo, Egypt
>
> *Direct: *  +2 02 3303 7175
> *Mobile: *  +2 012 220 4165
>

Disappointing.

> The information transmitted is intended solely for the individual or 
> entity to which it is addressed and may contain confidential and/or 
> privileged material. Any review, retransmission, dissemination or 
> other use of or taking action in reliance upon this information by 
> persons or entities other than the intended recipient is prohibited. 
> If you have received this email in error please contact the sender and 
> delete the material from any computer.
>

You're posting to a publically archived mailing list.
Should I delete the message ?

--
J.