Forum Moderators: phranque

Message Too Old, No Replies

Master Alias

How do I set a master Alias

         

Stuperfied

6:36 am on Mar 28, 2005 (gmt 0)

10+ Year Member



I have made a control panel and i want every domain to be able to access it simply by ammending "/menu" to the end of their domain name. ie: "http://www.mydomain.com/menu"
I tried putting in "Alias /*/menu", "/.*/menu", "//.*/menu", "/\.*/menu" and various other combinations but cant get it to work. Is it possible and if so, how do I do it?

Thankyou very much for your time.

dcrombie

9:44 am on Mar 28, 2005 (gmt 0)



This is the format I'd use in httpd.conf:

Alias /menu/ /path/to/control/panel/

There is usually an Alias already set up for /icons/. If you use that as an example you should be ok.

Stuperfied

10:12 am on Mar 28, 2005 (gmt 0)

10+ Year Member



Thanks for the suggestion but it wont work like that, I have "C:/web" as my document root which contains the control panel and all domains are sub directories as such:
"C:/web/FTO"
"C:/web/flatstik_couriers"
"C:/web/example"
"C:/web/neoclan"

All domain names point to "http://220.240.21.36/[domain]". So if a users domain name is "spun.com" they would point it at "http://220.240.21.36/spun".

I want to set an Alias as such "Alias /.*/menu "C:/web" (where ".*" means any amount of any charactors).

The effect I am trying to achieve is that no matter what the domain name, if it is followed by "/menu" as such "http://www.boat.com/menu" they will be sent to "C:/web".

The problem is that ".*" does not work. I can put "Alias /FTO/menu" "C:/web" but to do this for every domain is very laboursome.

Does anyone know a way to make this work?

dcrombie

10:23 am on Mar 28, 2005 (gmt 0)



Actually, that's exactly how it should work. Going to /menu/ in any of your domains should trigger the Alias.

I'd be surprised if it worked differently on Windows...

Stuperfied

11:02 pm on Mar 28, 2005 (gmt 0)

10+ Year Member



Oh, I think I know where your comming from. I remember seeing virtual host settings and how some people were setting up a virtual host for every domain. I havent got that far yet, im still using one for all. Will check that out now but dont know if it will work with only one IP. I have seen how some people have a dedicated IP assigned to every domain but I havent found out any information about that either. Is it some company that leases them or something?

Stuperfied

12:46 am on Mar 29, 2005 (gmt 0)

10+ Year Member



Unfortunately it looks like you have to have windows server to setup domains so all I have to work with on my windows xp is localhost:80 Or 220.***.21.36:80.

In other words unless anyone knows how to get around it, I can only have one host.

I tried getting [220.***.21.36...] to point to C:/web/example/example2/example3/example4/example5 using the following methods.

NameVirtualHost localhost:80

<VirtualHost localhost:80>
ServerAdmin whatever
DocumentRoot C:/web
ServerName localhost:80
</VirtualHost>

NameVirtualHost localhost:80 and localhost/example:80

<VirtualHost localhost:80 and localhost/example:80>
ServerAdmin whatever
DocumentRoot C:/web/example/example2/example3/example4/example5
ServerName localhost:80 and localhost/example:80
ServerAlias localhost and localhost/example
</VirtualHost>

but no success unfortunately since all domain names point to [220.***.21.36...] and windows calls them all localhost requests. This coupled with the fact that our ISP only gives us one IP makes it pretty hard to use virtual hosts.

So the problem remains, how to assign a global alias.

[edited by: jdMorgan at 6:29 am (utc) on Mar. 29, 2005]
[edit reason] Obscured IP addresss. [/edit]

jdMorgan

6:31 am on Mar 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check this thread [webmasterworld.com]. Windows XP SP2 has a problem with LocalHost handling that may affect what you're trying to do, and a patch is available.

Jim

Stuperfied

11:20 am on Mar 29, 2005 (gmt 0)

10+ Year Member



Thanks but I dont have SP2 installed. I have a question for you though.

My setup is this:
WinXP PRO PC with a direct connection to the internet.
Our internet IP is 220.***.21.36.
Has Apache, MySQL, ASP, PHP, phpMyAdmin, MyODBC and GuildFTPd.
Web Root is C:/web.

My question is this, my fiancee has setup a dot.tk domain name. Its URL is [example.tk...] and she has pointed it to [220.***.21.36...] How does the server differenciate between that and my other domain name [.another.example.com.au...] which points to [220.***.21.36...] Does it derive the host from the address bar of the clients browser (ie: [whatever.com)...] or the absolute address that the domain name was refered to (ie: 220.***.21.36)?

If you or anyone else can answer that question, I would then ask what should my virtual hosts be and what hosts should I set in the hosts file?

And what does Kalos mean by "Unless 127.0.0.5 is bound to your NIC then it won't matter what you set in your HOSTS file for that IP address as it will try to find an address off your local machine, and network."? That post is in "http://www.webmasterworld.com/forum92/2695-2-10.htm"

[edited by: jdMorgan at 8:36 pm (utc) on Mar. 29, 2005]
[edit reason] No URLs or complete IPs. Please see TOS. [/edit]

jdMorgan

8:55 pm on Mar 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An HTTP/1.1 request with name-based shared hosting explained:

  • User types http://www.example.com/index.html in browser address bar.
  • Browser sends www.example.com to DNS system.
  • DNS system returns IP address.
  • Browser sends a request, including a header containing the URL-path and Hostname (domain name) to that IP address. *
  • Server receives request.
  • Server examines Host header and checks NameVirtualHost directives to figure out which "account" to fetch response from.
  • Response is fetched and sent back to browser.

    For an HTTP/1.0 transaction, the Hostname header is not sent. Therefore, name-based virtual servers don't work with HTTP/1.0 clients.

    127.0.0.1 is a "fake" IP address. It means, "connect to whatever machine this request originates from". So a server of your computer will respond to your requests for 127.0.0.1, while your friend Joe in the next office has a computer that thinks its address is 127.0.0.1 also, if his machine is set up with a server, too. 127.0.0.1 is a non-routable address for the local host, i.e. every computer in the world using TCP/IP thinks its address is 127.0.0.1, although it can have other addresses as well.

    * Here's what a simple HTTP/1.1 request header looks like. You can connect to your server by IP address and type this in using Telnet or HyperTerminal if you like:

    GET /index.html HTTP/1.1<nl>
    Host: www.example.com<nl>
    User-agent: Mozilla/5.0 WebmasterWorld-browser<nl><nl>

    <nl> is a New Line, such as "Enter".

    Jim

  • Stuperfied

    11:20 am on Mar 31, 2005 (gmt 0)

    10+ Year Member



    thankyou very much, that was extremely informative and exactly what I was looking for. I know that internal ip's are relavent only to the individuals machine and a bit about ip ranges, subnet masks and such but my understanding of it is still very limited as far as domains and such. Its interesting to find out how these things work. So on a small note, what is the work around for 1.0?

    On a larger note, I still have not been able to get external requests mapped to the correct domain. I think it would be best if we get back to the basics and start a little trouble shooting. I will leave my servers configuration as is and only make the changes you specify for trouble shooting purposes. Hopefully we can sort out what the problem is. That is if your up for it.

    At present I have eraced all virtual hosts so we have a clean slate. The hosts file is as standard 127.0.0.1 localhost. I believe you have our IP by now.
    Conf File.
    Listen 80.
    ServerName localhost:80.
    DocumentRoot "C:/web".
    Directory "C:/web".
    UserDir "My Documents/My Website". <- What should that be?
    DirectoryIndex html, html.var, php, htm, asp, home.asp.
    No Virtual hosts setup.

    Directory structure.
    C:/web/index.asp <- server control panel (under construction).
    C:/web/FTO/index.html (where [fortheorphans.tk...] points).
    C:/web/flatstik_couriers/index.asp.
    C:/web/ISSSG/index.html.

    Everything else is pretty much as standard except for what the php installation instructions and MySQL ones told me to do.

    I dont know if .tk domain names are http 1.0 or 1.1 and have no idea how to find out but [fortheorphans.tk...] is what we have been using to test it all remotely. Any ideas?