Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Domains from command line
Old 11-12-2008, 03:11 PM Domains from command line
dsk
Junior Talker

Posts: 3
Trades: 0
Hello guys,

I'm looking for some script that will let me add domains to my host from command line

I basically wanted to do something like this,
1. user "mike" register to my page (say www.website.com)
2. subdomain "mike.website.com" is created
3. Then user register his own domain (say www.mike.com), change dns to ns1.website.com and adds his domain at my page by some form
4. domain www.mike.com is parked on my server, and all requests from www.mike.com are redirected to mike.website.com

I hope you understand what I mean;
I need a way to create a subdomain from command line, then add domain from command line, and in the end, redirect traffic from domain to subdomain - also from command line

It's going to be similar service as ning.com
Do you have any solutions for something like that ?
The programming part I can do by myself, I just need some help from "hosting view"

edit: or if it's possible, to redirect from users domains like:
some enters www.mike.com, he is redirected to www.website.com/?page=mike.com
www.other_users_domain.com -> www.website.com/?page=other_users_domain.com

Thank you very much !

Last edited by dsk; 11-12-2008 at 03:14 PM..
dsk is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-13-2008, 05:28 AM Re: Domains from command line
Mark_anderson's Avatar
Skilled Talker

Posts: 58
Trades: 0
How do i set up two separate domains on my hosting plan so that they each have their own index page?

Please follow the link below:

http://www.apluskb.com/scripts/How_d...nswer1185.html
Mark_anderson is offline
Reply With Quote
View Public Profile
 
Old 11-13-2008, 08:20 AM Re: Domains from command line
dsk
Junior Talker

Posts: 3
Trades: 0
thanks for reply, but thats not what I need

I need an ability to add domains from command line, or using some API
any ideas ?
dsk is offline
Reply With Quote
View Public Profile
 
Old 11-14-2008, 02:52 AM Re: Domains from command line
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
It will depend on what webserver you are using. With apache on dedicated server you may setup your webserver in such way that it will respond with same document root to any domain requested and further you will have to perform different actions with the script. It would be something like this:
Code:
$domain = $_SERVER['HTTP_HOST'];
if (is_listed($domain)) {
   perform_action($domain);
}
else {
   perform_default();
}
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 11-14-2008, 08:15 AM Re: Domains from command line
dsk
Junior Talker

Posts: 3
Trades: 0
Perfect !

Could you tell me how can I set apache like that ?

Thank you very much, this is great solution !

Quote:
Originally Posted by mtishetsky View Post
It will depend on what webserver you are using. With apache on dedicated server you may setup your webserver in such way that it will respond with same document root to any domain requested and further you will have to perform different actions with the script. It would be something like this:
Code:
$domain = $_SERVER['HTTP_HOST'];
if (is_listed($domain)) {
   perform_action($domain);
}
else {
   perform_default();
}
dsk is offline
Reply With Quote
View Public Profile
 
Old 11-16-2008, 06:31 AM Re: Domains from command line
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
I don't remember exactly how it could be done, but it seems like you should have your main server to listen to IP instead of domain name and also you may have several vhosts listening fo domain name for certain purposes (like your website where users can register and whatever).
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Domains from command line
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17296 seconds with 12 queries