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.

Jump to the post that solved this thread.
Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
#1
[Solved] Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
5050 Wrote:The patch proposed by modpluz (thank you !) in this subject : Non existence sub-domains displaying zpanel login page (APACHE) works very well, so I though it is important enough to make it more easy to find.

To block the zpanel login page for all undefined subdomain or for direct IP access, add this:

Code:
#Default entry for any undefined domain or direct IP access
<VirtualHost *:80>
        Redirect 404 /
</VirtualHost>
at the end of the zpanel/configs/apache/httpd.conf file, but BEFORE the two last lines that contains:

Code:
# Now we include the generic VHOST configuration file that holds all the ZPanel user hosted vhost data
Include /etc/zpanel/configs/apache/httpd-vhosts.conf

For Ubuntu:

Code:
sudo vi /etc/zpanel/configs/apache/httpd.conf

then insert the lines, and then restart apache to apply the changes:

Code:
sudo service apache2 restart

5050
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by: mohamedh
#2
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
I have actually reinstalled my OS and changed from ZPanelCP to Sentora.
It all worked with Sentora and my CP is now only visible under http://panel.mydomain.com.

Thanks a lot for your help TGates!
Reply
Thanks given by:
#3
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP acce
same as http://forums.sentora.org/showthread.php?tid=1064 Tongue
●●●●●●●
My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons
●●●●●●●


Reply
Thanks given by:
#4
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
easied with .htaccess and send 403 if domain don't match. or panel.* don't match.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Freelance AWS Certified Architect & SysOps// DevOps

10$ free to start your VPS

Reply
Thanks given by:
#5
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
What would be the easiest way to redirect the 404 / 403 to your hosting company website?
Reply
Thanks given by:
#6
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
(03-13-2015, 07:36 AM)chipyzs Wrote: What would be the easiest way to redirect the 404 / 403 to your hosting company website?

.htaccess rule again
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Freelance AWS Certified Architect & SysOps// DevOps

10$ free to start your VPS

Reply
Thanks given by:
#7
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
I have added this code in httpd.conf but still it does not block any undefined domain or direct access.
Reply
Thanks given by:
#8
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
(12-26-2015, 04:58 AM)ashok Wrote: I have added this code in httpd.conf but still it does not block any undefined domain or direct access.

Are you sure?
Because i get an 404 when i watch at the ip of your website: http://88.198.95.25/
●●●●●●●
My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons
●●●●●●●


Reply
Thanks given by:
#9
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
(12-26-2015, 05:24 AM)Ron-e Wrote:
(12-26-2015, 04:58 AM)ashok Wrote: I have added this code in httpd.conf but still it does not block any undefined domain or direct access.

Are you sure?
Because i get an 404 when i watch at the ip of your website: http://88.198.95.25/

Check this ip- http://45.32.74.131
Reply
Thanks given by:
#10
[Solved] RE: Block the Sentora/zPanel login page for all undefined subdomain or direct IP access
have restarted apache?
Without any more info it just guessing..
●●●●●●●
My Sentora DemoMy GithubAuxio Github
Zentora themeS-Type themeCstyleX theme
flat-color-iconssmall-n-flat-icons
●●●●●●●


Reply
Thanks given by: ashok
Jump to the post that solved this thread.


Possibly Related Threads...
Thread Author Replies Views Last Post
Lost complete access to ZpAnel & backend of website Sal123 0 237 09-05-2019, 10:33 PM
Last Post: Sal123
Main login page showing 500 error sudinm 5 2,619 03-27-2018, 05:07 AM
Last Post: TGates
how to forward subdomain to IP kewldude12 2 1,994 01-27-2018, 01:00 AM
Last Post: kewldude12

Forum Jump:


Users browsing this thread: 1 Guest(s)