This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

DNS-Less preview
#1
DNS-Less preview
Basically this is the DNS-less preview. It allows your users to view their sites while they wait for their domain to propagate.

Windows:
Code:
</virtualhost>
# Add Alias for DNS-Less Previews
<VirtualHost *:80>
ServerName xxx.xxx.xxx.xxx
DocumentRoot c:/zpanel/panel/
AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) c:/zpanel/hostdata/$1/public_html/$2
<Directory c:/zpanel/hostdata>
Options FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from all
DirectoryIndex index.php
   <IfModule mod_php5.c>
       AddType application/x-httpd-php .php
       php_flag magic_quotes_gpc Off
       php_flag track_vars On
       php_flag register_globals Off
       php_admin_value upload_tmp_dir c:/zpanel/temp
   </IfModule>
</Directory>
Apache 2.2:
Code:
</virtualhost>

# Add Alias for DNS-Less Previews
<VirtualHost *:80>
   ServerName xxx.xxx.xxx.xxx
   DocumentRoot "/var/sentora/hostdata"
   php_admin_value open_basedir "/var/sentora/hostdata:/var/sentora/temp/"
   php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
   AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) /var/sentora/hostdata/$1/public_html/$2
   <Directory /var/sentora/hostdata>
       Options FollowSymLinks
       AllowOverride All
       Order Allow,Deny
       Allow from all
       DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
       <IfModule mod_php5.c>
           AddType application/x-httpd-php .php
           php_flag magic_quotes_gpc Off
           php_flag track_vars On
           php_flag register_globals Off
           php_admin_value upload_tmp_dir /var/sentora/temp
       </IfModule>
   </Directory>
Apache 2.4:
Code:
</virtualhost>

# Add Alias for DNS-Less Previews
<VirtualHost *:80>
   ServerName xxx.xxx.xxx.xxx
   DocumentRoot "/var/sentora/hostdata"
   php_admin_value open_basedir "/var/sentora/hostdata:/var/sentora/temp/"
   php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
   AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) /var/sentora/hostdata/$1/public_html/$2
   <Directory /var/sentora/hostdata>
       Options FollowSymLinks
       AllowOverride All
       Require all granted
       DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
       <IfModule mod_php5.c>
           AddType application/x-httpd-php .php
           php_flag magic_quotes_gpc Off
           php_flag track_vars On
           php_flag register_globals Off
           php_admin_value upload_tmp_dir /var/sentora/temp
       </IfModule>
   </Directory>

Need to replace xxx.xxx.xxx.xxx with your server's public IP.
You enter this as a Global ZPanel/Sentora Entry in Module Admin>Apache Admin
This could be customized to use your main panel domain instead of IP
Example usage: http://75.68.13.153/~sscms/supersimplecms_tk/
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: Ron-e , Cantalupo
#2
RE: [HOW-TO] DNS-Less preview
Adding entries to own host file & forcing it to bind IP to domain is faster trick & won't mess up your domain config.

https://kb.mediatemple.net/questions/61/...+DNS%3F#gs
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

10$ free to start your VPS
Reply
Thanks given by: Cantalupo
#3
RE: [HOW-TO] DNS-Less preview
My Linux version of TGates DNS-less preview with server IP instead of special (sub) domain. (tested on CentOS 6.6) 

In Sentora go to "Server Admin" > "Module Admin" > "Apache Config" and copy&paste the code below in "Global Sentora Entry".
Select "Force Update" at the bottom and save.
Run the daemon manually (php -q /etc/sentora/panel/bin/daemon.php) to speed things up.
And it should work, hopefully. Tongue


Code:
</virtualhost>

# Add Alias for DNS-Less Previews
<VirtualHost *:80>
   ServerName xxx.xxx.xxx.xxx
   DocumentRoot "/var/sentora/hostdata"
   php_admin_value open_basedir "/var/sentora/hostdata:/var/sentora/temp/"
   php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
   AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) /var/sentora/hostdata/$1/public_html/$2
   <Directory /var/sentora/hostdata>
       Options FollowSymLinks
       AllowOverride All
       Order Allow,Deny
       Allow from all
       DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
       <IfModule mod_php5.c>
           AddType application/x-httpd-php .php
           php_flag magic_quotes_gpc Off
           php_flag track_vars On
           php_flag register_globals Off
           php_admin_value upload_tmp_dir /var/sentora/temp
       </IfModule>
   </Directory>

Replace xxx.xxx.xxx.xxx with your server ip.

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by: TGates , Cantalupo
#4
RE: [HOW-TO] DNS-Less preview
If you don't like indexing when they go to your IP (which can be a security risk i think).

Like a list of all users:

[Image: egUXTuc.jpg]

You need to change the line:
Code:
Options FollowSymLinks Indexes

To:

Code:
Options FollowSymLinks

Don't forget to select "Force Update" at the bottom and to run the daemon manually (php -q /etc/sentora/panel/bin/daemon.php) to speed things up.

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by: TGates , Cantalupo
#5
RE: [HOW-TO] DNS-Less preview
i've done this but get a 403 error no matter what
i changed the ip to my servers ip as well
Reply
Thanks given by:
#6
RE: [HOW-TO] DNS-Less preview
(06-24-2015, 06:17 PM)txt3rob Wrote: i've done this but get a 403 error no matter what
i changed the ip to my servers ip as well

If you go only to the IP of your server you get indeed a 403, but if you go to the url like in the exemple from TGates you will see the website.

(01-29-2015, 09:06 AM)TGates Wrote: Example usage: http://75.68.13.153/~zadmin/mach-hosting_com/

Change "zadmin" to the user from the domain you like to see, and change "mach-hosting_com" to the domain(directory) you like to see.

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by:
#7
RE: [HOW-TO] DNS-Less preview
If you like to see a website when you enter your server IP you can change the following line:

Code:
DocumentRoot "/var/sentora/hostdata"

with the directory from the website you like to see when someone enters only your IP like so:

Code:
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/forward_auxio_eu"
(in my case it's just a forwarding page to my main domain so it also automatically changes the IP to the domain in the address bar)

The DNS-less urls will still work like normal..

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by:
#8
RE: [HOW-TO] DNS-Less preview
(04-01-2015, 04:37 AM)Ron-e Wrote: My Linux version of TGates DNS-less preview with server IP instead of special (sub) domain. (tested on CentOS 6.6) 

In Sentora go to "Server Admin" > "Module Admin" > "Apache Config" and copy&paste the code below in "Global Sentora Entry".
Select "Force Update" at the bottom and save.
Run the daemon manually (php -q /etc/sentora/panel/bin/daemon.php) to speed things up.
And it should work, hopefully. Tongue


Code:
</virtualhost>

# Add Alias for DNS-Less Previews
<VirtualHost *:80>
   ServerName xxx.xxx.xxx.xxx
   DocumentRoot "/var/sentora/hostdata"
   php_admin_value open_basedir "/var/sentora/hostdata:/var/sentora/temp/"
   php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
   AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) /var/sentora/hostdata/$1/public_html/$2
   <Directory /var/sentora/hostdata>
       Options FollowSymLinks
       AllowOverride All
       Order Allow,Deny
       Allow from all
       DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
       <IfModule mod_php5.c>
           AddType application/x-httpd-php .php
           php_flag magic_quotes_gpc Off
           php_flag track_vars On
           php_flag register_globals Off
           php_admin_value upload_tmp_dir /var/sentora/temp
       </IfModule>
   </Directory>

Replace xxx.xxx.xxx.xxx with your server ip.

I have tried it on my server. Unfortunately apache fails to restart:
AH00526: Syntax error on line 31 of /etc/sentora/configs/apache/httpd-vhosts.conf:
Invalid command '\xc2\xa0', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
Syntax error on line 31 is related to Server Name.

Looking forward for any feedback on this problem.
Reply
Thanks given by:
#9
RE: [HOW-TO] DNS-Less preview
Just guessing in the blank..

Have you started with the "</virtualhost>" tag and ended with the "</Directory>" tag?

Or maybe post your httpd-vhosts.conf file here so we can try to find the problem.

My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons

Sentora's development takes way too long, so i'm transitioning to HestiaCP.
Reply
Thanks given by:
#10
RE: [HOW-TO] DNS-Less preview
I have succeeded to get DNS preview. For review please check this one https://199.180.116.69/~nitipinf/nitip_info/

Using global sentora entry will not work. I configure the httpd config file as informed in https://github.com/sentora/sentora-core/...t-71953710

After you add the code given, you will get error 403 which forbid you to access the web page. So, add new codes below the code given like this:

Quote:ServerName localhost (IP address seems not working on my server so I use localhost)
AliasMatch ^/~([a-zA-Z0-9]+)/?(.*) /var/sentora/hostdata/$1/public_html/$2 Add the code below, just like what TGates use with a little modification on the permission (depends on the Apache version that you use)
<Directory /var/sentora/hostdata>
     
#Options
FollowSymLinks
   Options Indexes FollowSymLinks Includes ExecCGI
   AllowOverride All
   Require all granted (Little modification on the permission because of different Apache version)
      DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
      <IfModule mod_php5.c>
          AddType application/x-httpd-php .php
          php_flag magic_quotes_gpc Off
          php_flag track_vars On
          php_flag register_globals Off
          php_admin_value upload_tmp_dir /var/sentora/temp
      </IfModule>
  </Directory>
Reply
Thanks given by: TGates , Cantalupo


Forum Jump:


Users browsing this thread: 2 Guest(s)