Current time: 12-23-2024, 09:08 PM Hello There, Guest! (LoginRegister)


Post Reply 
Preview Website without DNS pointed
Author Message
ctct Offline
Newbie
*

Posts: 9
Joined: May 2009
Reputation: 0
Post: #1
Preview Website without DNS pointed
Hello guys
I love IspCP, thanks so much!

Is there a way to preview a site without the DNS pointed to it. So if you're migrating a website you can preview before pointing the DNS.

Something like:

customerdomain.tld.admin.hostsrvdomain.tld
or
admin.hostsrvdomain.tld/customerdomain.tld

Thanks for any suggestions or solutions.

Ciu
Ron
05-23-2009 01:16 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #2
RE: Preview Website without DNS pointed
1. Backup everything
2. Edit /etc/ispcp/apache/parts/dmn_entry.tpl, replacing the ServerAlias directive with:
Code:
ServerAlias     www.{DMN_NAME} {DMN_NAME} *.{DMN_NAME} {DMN_NAME}.users.admin.hostsrvdomain.tld
3. Regenerate all domain's configurations (there's a howto in the docs)
4. Manually add a wildcard entry such that *.users.admin.hostsrvdomain.tld resolves to your IP. To do this, you have to edit /var/cache/bind/admin.hostsrvdomain.tld.db and /etc/ispcp/bind/working/admin.hostsrvdomain.tld.db, adding one line like:
Code:
*.users       IN  A        IP.OF.YOUR.SERVER
4. Restart apache and bind

Once done, you should be able to access the domain's web through http://customerdomain.tld.users.admin.ho...omain.tld/ , just as you asked for Smile
(This post was last modified: 05-23-2009 05:12 AM by kilburn.)
05-23-2009 05:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
fhawk Offline
Junior Member
*

Posts: 29
Joined: Mar 2009
Reputation: 1
Post: #3
RE: Preview Website without DNS pointed
if your OS is windows,you can edit c:/windows/system32/drivers/etc/hosts,and add a line:
yourserverip domain
06-10-2009 12:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
sidha Offline
Junior Member
*

Posts: 13
Joined: Aug 2009
Reputation: 0
Post: #4
RE: Preview Website without DNS pointed
The simple method:
1. at one of your already working domain's htdocs dir (/var/www/virtual/alreadyworkingdomain.com/htdocs) make a dir with the name of your new domain:
Code:
mkdir newdomain

2. type:
Code:
mount --bind /var/www/virtual/newnotworkingdomain.com/htdocs/ /var/www/virtual/myalreadyworkingdomain.com/htdocs/newdomain/

3. point your browser to http://myalreadyworkingdomain.com/newdomain/

(To unmount later: umount /var/www/virtual/newnotworkingdomain.com/htdocs/)
(note: at step 2. there is one line with a space between the two paths)
(This post was last modified: 08-02-2009 02:19 AM by sidha.)
08-02-2009 02:02 AM
Find all posts by this user Quote this message in a reply
dabvhcs Offline
Junior Member
*

Posts: 26
Joined: Mar 2007
Reputation: 0
Post: #5
RE: Preview Website without DNS pointed
(05-23-2009 05:11 AM)kilburn Wrote:  1. Backup everything
2. Edit /etc/ispcp/apache/parts/dmn_entry.tpl, replacing the ServerAlias directive with:
Code:
ServerAlias     www.{DMN_NAME} {DMN_NAME} *.{DMN_NAME} {DMN_NAME}.users.admin.hostsrvdomain.tld
3. Regenerate all domain's configurations (there's a howto in the docs)
4. Manually add a wildcard entry such that *.users.admin.hostsrvdomain.tld resolves to your IP. To do this, you have to edit /var/cache/bind/admin.hostsrvdomain.tld.db and /etc/ispcp/bind/working/admin.hostsrvdomain.tld.db, adding one line like:
Code:
*.users       IN  A        IP.OF.YOUR.SERVER
4. Restart apache and bind

Once done, you should be able to access the domain's web through http://customerdomain.tld.users.admin.ho...omain.tld/ , just as you asked for Smile

Thank you kilburn ! This is a smart solution which can also be apply for alias preview (and maybe for subdomain preview using *.*.users IN A IP.OF.YOUR.SERVER)
08-02-2009 09:22 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #6
RE: Preview Website without DNS pointed
(08-02-2009 02:02 AM)sidha Wrote:  The simple method:
1. at one of your already working domain's htdocs dir (/var/www/virtual/alreadyworkingdomain.com/htdocs) make a dir with the name of your new domain:
Code:
mkdir newdomain

2. type:
Code:
mount --bind /var/www/virtual/newnotworkingdomain.com/htdocs/ /var/www/virtual/myalreadyworkingdomain.com/htdocs/newdomain/

3. point your browser to http://myalreadyworkingdomain.com/newdomain/

(To unmount later: umount /var/www/virtual/newnotworkingdomain.com/htdocs/)
(note: at step 2. there is one line with a space between the two paths)

This is a valid method for apache+mod_php but not for fastcgi/fcgid (ispcp default). The reason is that each domain belongs to a different user and, therefore, http://myalreadyworkingdomain.com/newdomain/ will throw you a 403 Forbidden error when trying to run php/cgi scripts...

Quote:Thank you kilburn ! This is a smart solution which can also be apply for alias preview (and maybe for subdomain preview using *.*.users IN A IP.OF.YOUR.SERVER)
You're welcome! Smile My own tests show that the record "*.users IN A" already resolves "*.*.users IN A" queries, so you should only need to edit the ServerAlias directives in the respective template files (something like subdmn_entry.tpl, als_entry.tpl) and it should automagically work for subdomains/aliases too Smile
08-02-2009 10:34 AM
Visit this user's website Find all posts by this user Quote this message in a reply
patrick.geschke Offline
Junior Member
*

Posts: 13
Joined: Nov 2009
Reputation: 0
Post: #7
RE: Preview Website without DNS pointed
Quote:1. Backup everything
2. Edit /etc/ispcp/apache/parts/dmn_entry.tpl, replacing the ServerAlias directive with:
Code:
ServerAlias www.{DMN_NAME} {DMN_NAME} *.{DMN_NAME} {DMN_NAME}.users.admin.hostsrvdomain.tld
3. Regenerate all domain's configurations (there's a howto in the docs)
4. Manually add a wildcard entry such that *.users.admin.hostsrvdomain.tld resolves to your IP. To do this, you have to edit /var/cache/bind/admin.hostsrvdomain.tld.db and /etc/ispcp/bind/working/admin.hostsrvdomain.tld.db, adding one line like:
Code:
*.users IN A IP.OF.YOUR.SERVER
4. Restart apache and bind

Once done, you should be able to access the domain's web through http://customerdomain.tld.users.admin.ho...omain.tld/ , just as you asked for Smile

Ive done just as said, except from the DNS Part cause that is configured with an external DNS Server.
Still when i try to access any user-domain.tld.my-preview-domain.tld i only get to the ISPCP Main login.
(my-preview-domain.tld in this case also is my ispcp Login Domain)
Why wont apache lead the request to the right Directory?
11-11-2009 10:13 AM
Find all posts by this user Quote this message in a reply
patrick.geschke Offline
Junior Member
*

Posts: 13
Joined: Nov 2009
Reputation: 0
Post: #8
RE: Preview Website without DNS pointed
No one?
12-07-2009 11:40 PM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #9
RE: Preview Website without DNS pointed
Not without any other info. Post your 00_master.conf and your ispcp.conf files and maybe we can see what's wrong in there. The method works as described when using the default ispcp settings...
12-08-2009 12:48 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)