snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

problem with snipe-it login redirect to auth/signin

Open ghosteng opened this issue 12 years ago • 24 comments

i hardly install the system but i have a problem with login when i go to http://172.17.4.199/asset it's redirect me to http://172.17.4.199/asset/auth/signin and the page contains below Not Found

The requested URL /asset/auth/signin was not found on this server.

kindly help me to get it work

ghosteng avatar Oct 22 '14 12:10 ghosteng

Do you have mod_rewrite enabled on your server?

bullfrog3459 avatar Oct 22 '14 14:10 bullfrog3459

yes root@AKH-Nagios:/var/www/snipe-it# a2enmod rewrite Module rewrite already enabled

ghosteng avatar Oct 22 '14 14:10 ghosteng

The only way I have got the software to work is to have the server.php to be at 755 or 777. I know the security implications of this but i haven't debugged it more yet. After i did that, it cleared up all of the issues with the redirects, etc.

bullfrog3459 avatar Oct 22 '14 16:10 bullfrog3459

@bullfrog3459 That's really weird, and shouldn't have been required.

@ghosteng if you manually add garbage into the .htaccess in public, does it blow up? (It should.) If it doesn't, odds are that mod_rewrite is running, but your virtual host may not be set up to allow overwrites.

http://askubuntu.com/questions/423514/how-to-enable-mod-rewrite-for-virtual-host

snipe avatar Oct 23 '14 17:10 snipe

thanks @bullfrog3459 i tried to give the file fur permession as you mentioned but it's still the same

ghosteng avatar Oct 25 '14 05:10 ghosteng

@snipe i don't have this htaccess in public folder, how can i get it also please tell me where to but that virtual host exactly and it's needed to put the snipe-it directory inside \var\www\html ?

ghosteng avatar Oct 25 '14 05:10 ghosteng

@ghosteng the .htaccess is in the source code for Snipe-IT. If you grabbed the source from here, there should definitely be an .htaccess in public. https://github.com/snipe/snipe-it/blob/develop/public/.htaccess

Are you sure it's not there and you're just not able to see it (ls -al to show hidden files).

snipe avatar Oct 29 '14 18:10 snipe

@ghosteng also, it would go in /var/www/html/public, not /var/www/html, as it is in the source.

snipe avatar Oct 29 '14 18:10 snipe

@snipe thanks for your help, i found the .htaccess but i don't know how is this file will help me also i want you to help me with virtual host in details where to put the file and the root folder for snipe-it currently i put it in /var/www/snipe-it

ghosteng avatar Nov 02 '14 06:11 ghosteng

finaly it's working but when i typed http://172.17.4.199/snipe-it i got the server content files and folders and when i click on public folder the login page is coming up and the complete path will be http://172.17.4.199/snipe-it/public so how i can point it directly to open with http://172.17.4.199/snipe-it ?

ghosteng avatar Nov 02 '14 09:11 ghosteng

below screen shots will make it clear screenshot from 2014-11-02 11 14 30 screenshot from 2014-11-02 11 15 47

ghosteng avatar Nov 02 '14 09:11 ghosteng

You need to point your document root to the public folder in your virtual host setup. If you check the docs, it explains what that should look like.

snipe avatar Nov 02 '14 15:11 snipe

@snipe below is my virtual host. note that my snipe-it directory is on /var/www/html

<VirtualHost *:80> <Directory /var/www/html/snipe-it> AllowOverride All DocumentRoot /var/www/html/snipe-it/public ServerName akh-nagios # Other directives here

ghosteng avatar Nov 03 '14 06:11 ghosteng

Did you restart the web server when you set that? That DocumentRoot looks correct.

snipe avatar Nov 03 '14 06:11 snipe

yes

ghosteng avatar Nov 03 '14 06:11 ghosteng

You have to be editing the wrong conf file or something. If you have to add public to the url, the DocumentRoot can't be set correctly. If you change the document root to something nonsensical and restart the webserver, does it break? (It should.)

snipe avatar Nov 03 '14 06:11 snipe

i create a link by below command ln -s /var/www/snipe-it/public /var/www/html/asset now every thing is working even without Virtual host is that going to make a problem, if no what is the benefits from Virtual host file ?

ghosteng avatar Nov 03 '14 13:11 ghosteng

Well, I mean your web server is clearly not configured correctly, and I don't know how that could impact you, since I don't know how else it is misconfigured. You should definitely not have had to symlink anything to get this to work. What file did you edit for your virtual host stuff? Can you paste the rest of your config?

snipe avatar Nov 04 '14 20:11 snipe

Is this the only site on the server? If so, you may not have virtualhosts even set up properly. Search through the httpd.conf file for DocumentRoot. That variable is in the virtual hosts section, but it's also higher up in the config (around line 119 in my version of Apache), and it typically defaults to /var/www/html, which would explain why you're seeing what you're seeing if you didn't change that one.

snipe avatar Nov 04 '14 21:11 snipe

@snipe i have many sites on this server ( four) and all is working fine with Apache2 i don\t have any of them configured with virtual host, they are working normally with config files inside conf.d folder in apache directory with Alias that's it Thanks @snipe again for your kind help, i'll take a backup and try again with Virtual host configuration

ghosteng avatar Nov 05 '14 14:11 ghosteng