ispCP - Board - Support
Preview Website without DNS pointed - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: Preview Website without DNS pointed (/thread-6787.html)



Preview Website without DNS pointed - ctct - 05-23-2009 01:16 AM

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


RE: Preview Website without DNS pointed - kilburn - 05-23-2009 05:11 AM

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.hostsrvdomain.tld/ , just as you asked for Smile


RE: Preview Website without DNS pointed - fhawk - 06-10-2009 12:49 PM

if your OS is windows,you can edit c:/windows/system32/drivers/etc/hosts,and add a line:
yourserverip domain


RE: Preview Website without DNS pointed - sidha - 08-02-2009 02:02 AM

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)


RE: Preview Website without DNS pointed - dabvhcs - 08-02-2009 09:22 AM

(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.hostsrvdomain.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)


RE: Preview Website without DNS pointed - kilburn - 08-02-2009 10:34 AM

(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


RE: Preview Website without DNS pointed - patrick.geschke - 11-11-2009 10:13 AM

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?


RE: Preview Website without DNS pointed - patrick.geschke - 12-07-2009 11:40 PM

No one?


RE: Preview Website without DNS pointed - kilburn - 12-08-2009 12:48 AM

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...