A quick Q about wild card domains

Asked by chris neuman on 2011-06-19

Hello everyone, sorry to bother you again but i just have one Q about wild card domains.
After the enormous help you all gave me my hosting is working great at long last but i'm a little confused about wild card domains.
Just to make sure i've set everything up right, at my my domain name provider i have registered nameservers, ns1.yiphee.com and ns2.yiphee.com both with the same ip address of my server.
Those are the only records at the domain name providers.
In slicehosts manager, i have nothing set at all, and in ehcp i have created the domain name yiphee.com.
Everything works correctly, i can create add on domains and sub domains, happy at last!
Anyway the problem now is with wild card domains. I need yiphee.com to be a wild card domain, which it seems it is, i can enter anything.yiphee.com and i will get the default page.
But i don't get the default page of yiphee.com, instead i get the default page of my server ip.
(This is the index default page in var/www/new/)
How do i set things so that the wildcard domain goes to the index page of the domain name rather than the ip address of the server?
(I have added another domain name and that will also point to the ip if i use wild card domains)

As always, your help will be most appreciated.

Edit: Just noticed that cgi-bin doesn't work, how do i enable it?

Question information

Language:
English Edit question
Status:
Answered
For:
Easy Hosting Control Panel for Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2011-06-20
Last reply:
2011-06-20

Dear Mr.Chris

Happy to hear the progress :)

so, you had created a new A Record *.yiphee.com pointing to your ip, so, sny subdomain works now, good

you require this to be pointing the public_html of your main domain hosting account know,

you need to do this in virtualhost configuration, I hope, this can be comfortably achieved by editing the configuration files directly kind of...

I think, Mr.Bahattin to step in for a quick configuration example, or incase, if he had thought of this situation before (as it is not a rare requirement, but not too regular requirement too) and if he had previously included an option in admin panel in domain configuration to configure this feature kind of...

A Request: please come up with more clarity about other domain name, thank you

Do you mean to have the other domain name also configured with wild card domains having both domainname and it's wild card domain configurations point one public_html like you wish to configure in the case of your first domain name yiphee.com?

or I did not understand your requirements right? please explain, thank you

With Best Regards
Raghu Veer

chris neuman (chrisspectre) said : #2

Dear Raghu, thanks for your response, i'm beginning to get a bit embarrassed asking too many questions.
Everything seems to be working fine but i am having a problem with wild card domains. I've had this same problem with cpanel in the past but with cpanel i was never able to find a solution.
With ehcp, i'm nearly there but still need a little help.
I have several web scripts which require wild card domains enabled, this is so that once someone has signed up they are directed back to the home page.
This is working perfectly for yiphee.com and one script is ok.
But if i create a sub-domain then instead of directing back to the root of the sub, it directs back to the root of the main domain.
The same happens with add on domains. So where http://anything.yiphee.com goes to http://yiphee.com
(which is right) but so too does http://anything.newdomain.com go to http://yiphee.com instead of to it's own root.
So with yiphee.com i need http://anything.yiphee.com to go to http://yiphee.com and it does....no problem.
But i need http:/anything.newdomain.com to go to http://newdomain.com and not http://yiphee.com.
The same with sub domains.
While i'm still asking questions, could you also please advise me on two other issues:
.htaccess doesn't seem to work, and neither does cgi-bin.
Could you tell me how to configure it so they do?
Once again thanks for all your help, i appreciate it enormously. I think that these are the last little problems i have, then i will be up and running!!

Dear Mr.Chris

no worries, personally, I can try to do what is possible for me,

I am not full time sys admin or programmer, I am more of software architect, I put standards before, I do my analysis and practical confirmation of possibility of a feature by doing my research while verifying the authentic requirement of the feature as well.

I check programming manuals (php) to see how better we accomplish that feature from concepts to php functions/commands etc and work with actual php programmers (I write code snippets in php, when it is a must, but I tend to utilise services of php programmers based on practical lines I work in, as a preference.

My approach is similar in other sectors, too, I do sys administration, but rarely, when I do I use vi and all, I forget commands so I keep reference beside when I work again months or years later kind of..

coming to network and firewalls and malware removal, I used to feel more comfort and follow my ways of dealing them, anyhow all these until before few years. These days, I do my research and trying to cowork with people in that sector, to overall keep burden under control while pursuing complex challenges in the process as much possible.

========

back to your question, actual guidance, with configuration changes etc, can be given by Mr.Bahattin, while, I can try to shed some light on it with some information

a) your requirement to have wild card domains in dns (which is possible with custom dns template) and all wild card sub-domains pointing to same public_html of that domain is possible with custom virtual host configuration of apache http server.

Note: while dns level custom template is hopefully possible (automation), apache level virtual host configuration has to be hopefully done manually by editing configuration files, after addition of every new domain name in the control panel when creating a new hosting account kind of...

Note: Automation is hopefully possible in this case with some scripting kind of.

coming to .htaccess, again this is related to apache. Please tell me, if .htaccess is working correctly in single domain hosting account (without wild card setup)?

need to check, if perl is installed and enabled to see about cgi-bin

wish Mr.Bahattin, step in and answer questions with configuration guidance etc...

Question about these specific requirements: are you interested to offer services (sub-domain based to your site users, offering a sub-domain to each site user kind of)?

example: blog hosting etc...?

All the Best :)

=========================================

Hope, Mr.Bahattin will put his thoughts as much possible to fulfill your requirements.

We love inputs and requests from community. Thing is time which is critical and the more people join hands, the better support etc can be offered while caring development according to the proposed schedules approximately kind of.

Mr.Bahattin is caring many things (most and all) about EHCP (from support to development), despite his day time job (fulltime). I respect those programmer aspirants who input their time in improving EHCP as well, but what I meant to say is, currently major responsibility is with Mr.Bahattin.

I being a user of EHCP (not active actually), but, read support requests and try to help wherever possible in whichever way possible kind of)...

Feel free to ask more questions, likewise, if possible, try taking part in whichever way possible, thank you

some things need to be implemented in code as features while answers to some kind of repeated requests need to be added in knowledge base.

more things in future I hope, as team size increases (end of the day, we all are volunteers, with committed aspirations :)

All the Best :)

With Best Regards
Raghu Veer

chris neuman (chrisspectre) said : #4

Dear Raghu, that's an interesting profile you have, when my projects start earning money i now know where to look for my development team, i might be giving you a nudge sometime soon!
I haven't yet tried .htaccess on a single hosting domain but will do after work but let me just clarify the wildcard domain problem:
All domains are created in the var/www/vhosts folder and ehcp is located in the var/www/new folder, so the default page (that of my ip address) is the ehcp default page.
So wild card domains all point to that folder instead of to themselves.
So in order to have wildcard domains working for yiphee i had to create yiphee as dns domain only and put all the files in the var/www/new folder.
If i create yiphee.com as a normal domain using the normal add function then it is located in var/www/vhosts but as a wildcard domain it will point back to var/www/new instead of pointing back to var/www/vhosts/yiphee.com

Also, ALL domains point back to var/www/new as wildcard domains instead of to themselves, so for example
I need yiphee.com as a wildcard domain so that http://anything.yiphee.com will go to var/www/vhosts/yiphee.com. At the moment i have accomplished this by moving yiphee.com to the var/www/new folder.
But it still presents a problem with my other domains.
Example: http://cashclimbers.com is located in var/www/vhosts/cashclimbers.com
But wildcards (http://anything.cashclimbers.com) will go to var/www/new.
So all wildcard domains point to yiphee.com instead of to themselves.

Just to make it clearer:
I need:
http://yiphee.com as a wildcard domain so that http://anything.yiphee.com will point back to http://yiphee.com
And i need: http://anything.cashclimbers.com to point back to http://cashclimbers.com
But what i have instead is http://anything.anydomain.com all point to var/www/new.

To see clearly what i mean go to http://yiphee.com and check the home page. That is located in var/www/new because it's the only way i can get it to function.
Then go to http://cashclimbers.com and you'll see i haven't uploaded anything yet.
But then add a wildcard. Go to http://anything.cashclimbers.com and you'll see that it redirects to the yiphee.com home page instead of to the cashclimbers.com home page!

As always your help and that of Mr Bahattin is really most appreciated, thanks once again.

ehcpdeveloper (ehcpdeveloper) said : #5

Hi,
I am "trying" to follow your conversations, and thanks to all people
who are interested in ehcp, and who are trying to help anybody. thanks
to Raghu one more time.

about wildcard subdomains:
lets say you have a homepage in yiphee.com or www.yiphee.com

you want to display same homepage whan somebody enters
blahblah.yiphee.com or anything.yiphee.com

if you want to do this for "some of your domains", then, do this way:
in ehcp, click on yiphee.com
click on "edit apache template"

look at section:
<VirtualHost *>
    ServerName {domainname}
    ServerAlias www.{domainname}
 # buraya aliaslar yazilacak..
 {aliases}

replace with like:

<VirtualHost *>
    ServerName {domainname}
    ServerAlias *.{domainname}
 # buraya aliaslar yazilacak..
 {aliases}

you can do many things like this.
if you write:

<VirtualHost *>
    ServerName {domainname}
    ServerAlias www.{domainname}
 # buraya aliaslar yazilacak..
 {aliases}
...
Documentroot /var/www/new/

then, you will see ehcp homepage if you go to your domain.
you dont need to replace {domainname} with yiphee.com, ehcp already does that.

---
if you want to do same for "ALL DOMAINS", then, do this way:

do same change in apachetemplate file in ehcp dir,
then, ehcp->options-> sync domains , only once

You can do many apache related things this way, including ssl,
certificate settings.

see you.

Dear Mr.Chris

thank you for extra detail:)

=========

Dear Mr.Bahattin

I am really amused to see configuration right from admin panel? great :)

I think these kind of configurations and flexibility are not there in commercial alternatives (direct editing of conf files are required manually or even that is not possible? need to verify this anyhow

How it will be, if this kind of situations are automated as features and possible configurations when configuring domain names and domain templates even with out editing (and by selecting radio buttons and select menus kind of...)

hope you understand what I mean know (there will not be possibility of typing errors in configuration files, when we automate with clicks and kind of... while leaving the current possibility of editing files right from admin panel as well (like you had guided Mr.Chris in the above procedure).

Overall, need to open command line is minimised :)

=====================================

May be I ask one thing?

can we do automate, all these kinds of things we do in apache in nginx configuration file as well?

I wish to ensure and see, every configuration including phpmyadmin works right immediately based on nginx, when chosen http server is changed from "apache" to "nginx" in "server options" or other configuration page in EHCP admin panel.

Note: I wish, you care web based editor for nginx rewrite rules as well soon (as discussed long back), thank you

=============================================

hopefully, adding your responses to Mr.Chris questions, if we add to a knowledgebase, we can highlight the possible configurations that are easily workable in EHCP, which shows the advantage of EHCP naturally to many more prospects, hope you got my point know, thank you

likewise, even in future, for all informative questions/answers, if we arrange them in knowledgebase, it will become a great resource to all users of EHCP overall.

In case, if, there exists a knowledgebase, then, excuse me, for not wandering around the website, but if not, let's put one forward, thank you

With Best Regards
Raghu Veer

Dear Mr.Bahattin

a reminder, please help him to fix .htaccess file and cgi-bin also, thank you

With Best Regards
Raghu Veer

Can you help with this problem?

Provide an answer of your own, or ask chris neuman for more information if necessary.

To post a message you must log in.