404 Not Found User Login

Started by ansyori28, August 02, 2018, 07:26:00 AM

Previous topic - Next topic

ansyori28

Hello,

This is the second time I get stuck with the same error. I did a fresh installation on Centos 7 and then added new 3 users from the admin panel. These users are fine, they are able to login to the user panel. Today I'm trying to add a new user and the domain is connected to my server. However when this last user trying to login to this address https://mydomain.com:2083/ instead of getting logged in to user panel, this user get this error message on screen:

404 Not Found
cwpsrv

And this user browser redirect to:

https://mydomain.com:2083/login/%3Chtml%3E%3Chead%3E%3Ctitle%3E404%20Not%20Found%3C/title%3E%3C/head%3E%3Cbody%20bgcolor=%22white%22%3E%3Ccenter%3E%3Ch1%3E404%20Not%20Found%3C/h1%3E%3C/center%3E%3Chr%3E%3Ccenter%3Ecwpsrv%3C/center%3E%3C/body%3E%3C/html%3E

I have no idea what is going on. This user website VHost configuration in my vhosts.conf file is exactly the same, no different with my other users vhost configuration.

User 2 vhost:

# vhost_start userfinedomain.com
<VirtualHost mydomainipaddress:80>
ServerName userfinedomain.com
ServerAlias www.userfinedomain.com
ServerAdmin webmaster@userfinedomain.com
DocumentRoot /home/user2/public_html
UseCanonicalName Off
ScriptAlias /cgi-bin/ /home/user2/public_html/cgi-bin/

# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/user2/userfinedomain.com/*.conf

<IfModule mod_userdir.c>
UserDir disabled
UserDir enabled user2
</IfModule>

<IfModule mod_suexec.c>
SuexecUserGroup user2 user2
</IfModule>

<IfModule mod_suphp.c>
suPHP_UserGroup user2 user2
suPHP_ConfigPath /home/user2
</IfModule>

<Directory "/home/user2/public_html">
AllowOverride All
</Directory>

</VirtualHost>
# vhost_end userfinedomain.com


User 4 vhost:

# vhost_start userunabetologin.com
<VirtualHost mydomainipaddress:80>
ServerName userunabetologin.com
ServerAlias www.userunabetologin.com
ServerAdmin webmaster@userunabetologin.com
DocumentRoot /home/userunabletologin/public_html
UseCanonicalName Off
ScriptAlias /cgi-bin/ /home/userunabletologin/public_html/cgi-bin/

# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/userunabletologin/userunabetologin.com/*.conf

<IfModule mod_userdir.c>
UserDir disabled
UserDir enabled userunabletologin
</IfModule>

<IfModule mod_suexec.c>
SuexecUserGroup userunabletologin userunabletologin
</IfModule>

<IfModule mod_suphp.c>
suPHP_UserGroup userunabletologin userunabletologin
suPHP_ConfigPath /home/userunabletologin
</IfModule>

<Directory "/home/userunabletologin/public_html">
AllowOverride All
</Directory>

</VirtualHost>
# vhost_end userunabetologin.com


I replaced real domain name and username with ctrl + shift + f in sublime text, so I believe there will be no mistakes in changing those names for the security reason.

Any help will be much appreciated.
Thank you.

josemnunez

try to execute this script and tell me how it went


sh /scripts/cwpsrv_rebuild_user_conf


josemnunez

this only happens with a particular user or with all

ansyori28

I executed this line on terminal:

sh /scripts/cwpsrv_rebuild_user_conf

and try to reboot the server with reboot command to see if it get fixed, but things getting more complicated. I am not able to access domain:2087 and mydomain:2083, the admin and users panel. However, All websites hosted to my server are normal and still running.

josemnunez


sh /scripts/restart_cwpsrv
sh /scripts/restart_httpd

ansyori28

Here's the full responses :


[root@server ~]# sh /scripts/restart_cwpsrv
Job for cwpsrv.service failed because the control process exited with error code. See "systemctl status cwpsrv.service" and "journalctl -xe" for details.
[root@server ~]# sh /scripts/restart_httpd
[root@server ~]# systemctl status cwpsrv.service
* cwpsrv.service - CentOS Web Panel service (daemon)
   Loaded: loaded (/usr/lib/systemd/system/cwpsrv.service; enabled; vendor preset: disabled)
   Active: activating (start-pre) since Thu 2018-08-02 10:20:00 UTC; 96ms ago
  Control: 2548 (cwpsrv)
   CGroup: /system.slice/cwpsrv.service
           > 2548 [cwpsrv]

Aug 02 10:20:00 server systemd[1]: Starting CentOS Web Panel service (daemon)...
Aug 02 10:20:00 server cwpsrv[2548]: cwpsrv: [emerg] SL_CTX_use_PrivateKey_file("/etc/pki/tls/private/hostname.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
Aug 02 10:20:00 server cwpsrv[2548]: cwpsrv:configuration file /usr/local/cwpsrv/conf/cwpsrv.conf test failed
Aug 02 10:20:00 server systemd[1]: cwpsrv.service: control process exited, code=exited status=1
Aug 02 10:20:00 server systemd[1]: Failed to start CentOS Web Panel service (daemon).
Aug 02 10:20:00 server systemd[1]: Unit cwpsrv.service entered failed state.
Aug 02 10:20:00 server systemd[1]: cwpsrv.service failed.
[root@server ~]#

josemnunez

Hmmm apparently you have a problem with the hostname ssl, you could try this


sh /scripts/generate_hostname_ssl

ansyori28

I'm getting another error below  :-\


[root@mydomain ~]# sh /scripts/generate_hostname_ssl
Generating RSA private key, 2048 bit long modulus
.....................................................................+++
......+++
e is 65537 (0x10001)
writing RSA key
Signature ok
subject=/C=HR/ST=Zagreb/O=CentOS Web Panel/L=HR/CN=mydomain.xyz/OU=CentOS Web Panel/emailAddress=info@centos-webpanel.com
Getting Private key
ln: failed to create symbolic link '/etc/pki/tls/private/mydomain.xyz.key': File exists
ln: failed to create symbolic link '/etc/pki/tls/certs/mydomain.xyz.crt': File exists
ln: failed to create symbolic link '/etc/pki/tls/certs/server-cwp.crt': File exists
ln: failed to create symbolic link '/etc/pki/tls/certs/server-dovecot.crt': File exists
ln: failed to create symbolic link '/etc/pki/tls/certs/server-http.crt': File exists
ln: failed to create symbolic link '/etc/pki/tls/certs/server-postfix.crt': File exists
ln: failed to create symbolic link '/etc/pki/tls/private/server-cwp.key': File exists
ln: failed to create symbolic link '/etc/pki/tls/private/server-dovecot.key': File exists
ln: failed to create symbolic link '/etc/pki/tls/private/server-http.key': File exists
ln: failed to create symbolic link '/etc/pki/tls/private/server-postfix.key': File exists
[root@mydomain ~]#


mydomain.xyz is not my real domain anyway, the responses has been edited. Any ideas?

ansyori28

Well, surprisingly my server:2087 and my server:2083 are working now. Everything is working now. The user panel also working for all of my clients.

Thank you so much.

studio4host

this issue is because you had an issue with hostname key/cert mismatch.
You can check the hostname ssl or generate a new with autossl by saving the same username again.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

ansyori28

Oh, I see so the problem was with SSL. I wonder if this problem is rarely happening, right?


sh /scripts/generate_hostname_ssl


And I think this command saves my day, noted. Thank you.

vidda

Hey there !

Facing exactely the same issue on a fresh install, event with just 1 single user account.
Did you managed to fix this...?

Another thread is dealing with the problem and talking about redirection being made, but couldn't figure out where's the point !

Best regards

ansyori28

#13
Hello,

Yes I managed to fix the problem. In my case I have the SSL problem. This command does fix the problem:
sh /scripts/generate_hostname_ssl

What do you mean by with just 1 single user? Are you talking about root user? As far as I know, you need to have at least 1 username registered from root user to make the php file to be running by accessing http://ip-address/~username/

OpenNGO

I am encountering the same problem, but without it redirecting to a strange address.
Following the instructions in this thread did not help, but also, none of the commands generated any errors.

The log shows:
2018/10/11 15:10:07 [error] 9573#0: *7 open() "/usr/local/cwpsrv/var/services/users/login/index.html" failed (2: No such file or directory), client: *******, server: localhost, request: "GET /index.html?username=cloudope&password=******* HTTP/1.1", host: "*******:2083", referrer: "https://*******4:2083/"

2018/10/11 15:11:14 [error] 9573#0: *22 open() "/usr/local/cwpsrv/var/services/users/login/index.html" failed (2: No such file or directory), client: *******, server: localhost, request: "GET /index.html?username=cloudope&password=******* HTTP/1.1", host: "h03.*******.com:2083"