Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: n8v8r on February 07, 2018, 02:41:42 PM

Title: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 02:41:42 PM
After having gone through a change of the server name via the CWP panel the CWP HTTP Test Page is being displayed as opposed to the domain's public home page. Latter is located in /home/USERNAME/public_html and there is only one index.php and nothing else.

There are also no index.html in the nginx or apache public html paths.

How to release the grip of the CWP HTTP Test Page  ???
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 04:04:31 PM
Looked now everywhere, redirects "index.html", and do not understand how this hijack is happening or how to get rid of it ???
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 04:25:53 PM
pointing manually to the public_html/index.php gets a
Quote
Not Found
The requested URL /index.php was not found on this server.
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: bullten on February 07, 2018, 04:45:35 PM
Did you try rebuilding apache vhost file?
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 04:53:04 PM
Just had the idea a few minutes ago and did but no remedy  :'( I am using Nginx as proxy and thus the apache vhost would likely not make an impact.

it is asif CWP is pointing to the wrong home directory
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 05:07:19 PM
CWP HTTP Test Page is stating
Quote
To prevent this page from ever being used, delete index.html in /public_html.
But there is no such file in /home/USERNAME/public_html, only the index.php of the domain's home page.

I am pulling hair and biting nails  ::)
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 05:26:49 PM
the nginx vhosts where rebuilt along with the apache vhosts but the hijack is still in place though. There is no index.html in apache's /var/www/. There is one niginx's /usr/share/nginx/html/ but that would display information about nginx and not the CWP HTTP Test Page
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: bullten on February 07, 2018, 05:40:06 PM
what if you remove nginx and use only apache?
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 05:49:03 PM
renamed public_html/index.php topublic_html/index.html and pointed the browser directly to my.domain/index.html and the CWP HTTP Test Page shows.

Reversing to public_html/index.php and pointing the browser directly to my.domain/index.php shows the same old Not Found
Removing the index page entirely and pointing to my.domain shows the CWP test page. Pointing directly to my.domain/index.html is showing the CWP Test page too.

So how and where is CWP loading/injecting its test page into the public domain ???
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: bullten on February 07, 2018, 05:52:29 PM
I think its reading page from /usr/local/apache/htdocs/index.html
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 05:59:52 PM
Yes it does indeed. Removing it however does not remove the hijack. Instead of showing the public_html/index.php it is still pointing to /usr/local/apache/htdocs/ and now showing
Quote
Index of /
webftp_simple/
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: bullten on February 07, 2018, 06:05:04 PM
:)

Did you accidentally installed additional apache?

yum list installed | grep httpd

What you see there?
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 06:09:28 PM
Neither consciously or subconsciously, if at all it happened by CWP script for renaming the server..
anyways, the output reads
Quote
cwp-httpd.x86_64                        2.4.29-1                       @cwp
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: bullten on February 07, 2018, 06:10:33 PM
Can you goto select webserver and then select only apache and rebuild the server again to see if it solves the problem?
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 06:23:29 PM
Just did, for sake of good measure also rebooted the entire OS and still no remedy. The output still reads
Quote
cwp-httpd.x86_64                        2.4.29-1                       @cwp

If I am to understand this output correctly then CWP is now acting as httpd instead of apache  ??? What a fine mess  >:(
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: bullten on February 07, 2018, 06:39:44 PM
nano /usr/local/apache/conf/sharedip.conf

change first line to <VirtualHost *:80>

save and restart apache
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 06:51:27 PM
thanks, did but there is no change, status quo. I am about to throw in the towel
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: studio4host on February 07, 2018, 07:40:20 PM
sound very simple
http://wiki.centos-webpanel.com/default-page-displayed-for-all-domains
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 07, 2018, 07:45:35 PM
All been tried, see the thread, and none unfortunately rectifying it
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: n8v8r on February 08, 2018, 02:20:37 AM
well, serves me right to be more cautious  :P with editing hostname/domainname. @bullten figured that it perhaps was detrimental of having both the same syntax
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: ezewebpro on May 14, 2021, 02:47:37 AM
pointing manually to the public_html/index.php gets a
Quote
Not Found
The requested URL /index.php was not found on this server.

This was also happening to me from one particular client, but not other machines, and I soon identified the issue with the client having a proxy setup on the client machines (http=127.0.0.1:8082;https=127.0.0.1:8082 for something else) which, when attempting to login to the CWP panel https://example.com:2031 or :2087, caused the "hijack".

Summary: be sure there are not proxies on the client machine (with the browser) connecting to the CWP /Centos server
Title: Re: CWP HTTP Test Page hijack public_html homepage
Post by: Alessandro on May 18, 2021, 10:05:31 PM
sound very simple
http://wiki.centos-webpanel.com/default-page-displayed-for-all-domains

enable NAT-ed solved my problem