Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 not found #26

Closed
Rajaskank opened this issue Oct 26, 2015 · 9 comments
Closed

404 not found #26

Rajaskank opened this issue Oct 26, 2015 · 9 comments

Comments

@Rajaskank
Copy link

Hi,

I have a 404 not found error when I go to https://hb.my.domaine/register/?client=hubic&password=mypassword

My Apache vhost:

<VirtualHost *:1443>
  ServerName hb.my.domaine
  DocumentRoot /var/www/hubic2swiftgate/

  SSLEngine on
  SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
  SSLCertificateFile /etc/ssl/hubic/server.crt
  SSLCertificateKeyFile /etc/ssl/hubic/server.key

  CustomLog /var/log/apache2/hsgate_ssl_access.log combined
  ErrorLog /var/log/apache2/hsgate_ssl_error.log

  <Directory "/var/www/hubic2swiftgate/">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

  php_admin_flag engine on

</VirtualHost>

php5-curl and curl installed
mod_rewrite and mod_ssl activeted

permission ok:

root@ks:/var/www# ls -alh hubic2swiftgate/
total 44K
drwxrwxr-x 5 www-data www-data 4,0K oct.  26 17:08 .
drwxr-xr-x 9 www-data root     4,0K oct.  26 15:07 ..
drwxrwxr-x 2 www-data www-data 4,0K oct.  26 15:07 cache
-rwxrwxr-x 1 www-data www-data  220 oct.  26 17:08 config.php
-rwxrwxr-x 1 www-data www-data  172 oct.  26 15:07 config.php.sample
drwxrwxr-x 8 www-data www-data 4,0K oct.  26 15:07 .git
-rwxrwxr-x 1 www-data www-data   39 oct.  26 15:07 .gitignore
-rwxrwxr-x 1 www-data www-data  12K oct.  26 15:07 README.md
drwxrwxr-x 2 www-data www-data 4,0K oct.  26 15:45 www

In hubiC account:

Name: swiftraja
URL: https://hb.my.domaine/callback/

idea ?

Thx,
Rajaskank42

@oderwat
Copy link
Owner

oderwat commented Oct 26, 2015

If you get 404 I would check if the vhost really works. You could check if that specific log file receives the access (which should be listed as 404 in the combined log).

Then you need to check if the .htaccess file is being used at all.

I also wonder why you have Port 1443 in the vhost while you have https:// in the hubic account.

@Rajaskank
Copy link
Author

I use SSLH for SSH and Apache on the same port

I haven't .htaccess in /var/www/hubic2swiftgate

log:

root@ks:/var/www# cat /var/log/apache2/hsgate_ssl_error.log
[Mon Oct 26 15:50:25.717699 2015] [ssl:warn] [pid 6342] AH01909: hb.my.domaine:443:0 server certificate does NOT include an ID which matches the server name

and nothing in /var/log/apache2/hsgate_ssl_access.log

@oderwat
Copy link
Owner

oderwat commented Oct 26, 2015

OK. But the 404 should not appear in the error but in the access (combined) log.

Without an .htaccess file there are no rewrite rules which would explain the 404 error too as the url you access is not available without those.

@Rajaskank
Copy link
Author

root@ks:/var/www# cat /var/log/apache2/hsgate_ssl_access.log
127.0.0.1 - - [26/Oct/2015:18:28:54 +0100] "GET /register/?client=hubic&password=password HTTP/1.1" 404 2265 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0"

What I put in the .htaccess ?

@oderwat
Copy link
Owner

oderwat commented Oct 26, 2015

It is part of the repository: https://github.com/oderwat/hubic2swiftgate/blob/master/www/.htaccess

@Rajaskank
Copy link
Author

I copied the .htaccess and simple.php in /var/www/hubi2swiftgate and I have this error:

/var/www/hubic2swiftgate/../cache doesn't exists

the hubic2swiftgate folder:

root@ks:/var/www# ls -alh hubic2swiftgate/
total 48K
drwxrwxr-x 5 www-data www-data 4,0K oct.  26 18:40 .
drwxr-xr-x 9 www-data root     4,0K oct.  26 15:07 ..
drwxrwxr-x 2 www-data www-data 4,0K oct.  26 15:07 cache
-rwxrwxr-x 1 www-data www-data  220 oct.  26 18:28 config.php
-rwxrwxr-x 1 www-data www-data  172 oct.  26 15:07 config.php.sample
drwxrwxr-x 8 www-data www-data 4,0K oct.  26 15:07 .git
-rwxrwxr-x 1 www-data www-data   39 oct.  26 15:07 .gitignore
-rwxr-xr-x 1 www-data www-data  147 oct.  26 18:37 .htaccess
-rwxrwxr-x 1 www-data www-data  12K oct.  26 15:07 README.md
-rwxr-xr-x 1 www-data www-data  11K oct.  26 18:43 simple.php
drwxrwxr-x 2 www-data www-data 4,0K oct.  26 18:37 www

@oderwat
Copy link
Owner

oderwat commented Oct 26, 2015

Oh. I see the problem. Your virtual host needs to point into the www directory not in the root of the checked our directory. Then there will be the .htaccess from repository automatically.

I probably should change the readme to make this more clear.

@Rajaskank
Copy link
Author

Ok, works !!!

Thx a lot :)

@oderwat
Copy link
Owner

oderwat commented Oct 26, 2015

I updated the readme to save others from that problem! TY too for being so patient with it!

@oderwat oderwat closed this as completed Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants