Sentora Support Forums

Full Version: DNS-Less preview
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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/
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
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.
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.
i've done this but get a 403 error no matter what
i changed the ip to my servers ip as well
(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.
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..
(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.
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.
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>