algoprog / rivr-search

The world's first open source torrent search engine
GNU General Public License v3.0
63 stars 26 forks source link

I tried this on ubuntu 14+, but it says "currently unable to handle this request. HTTP ERROR 500" #2

Closed BlackBeardo closed 8 years ago

BlackBeardo commented 8 years ago

hello can you please provide me full config requiremets like php version and mysql version and sphinx version also. can you please provide me full installation guide for this script. I am trying from last one week but it's not working.

I don't know what's missing. sphinx giving results in command line input like "search captain america". when I try to load index.php or any other url from browser I am getting "currently unable to handle this request. HTTP ERROR 500" in chrome. rest of browsers remain blank.

Please help me.

tunap commented 8 years ago

I'm having exactly the same problem. Although, I'm quite sure that it is not the problem with installation. Even on a clean Ubuntu 14.04 LAMP server, the PHP pages show a white screen. I think something is wrong with the code. I sent him an email but he didn't reply yet. I was trying to make another project of the same kind work: 'dhtbay'. Did you try it?

BlackBeardo commented 8 years ago

Thanks, I'll try it also, but I am not node guy, I am little good at PHP. I want to make this project work. but I don't know whom to ask solution. @algoprog please help me.

algoprog commented 8 years ago

Have you enabled error reporting in php.ini?

BlackBeardo commented 8 years ago

I am using PHP 5.5.9, sphinx 2.2.11, innodb version (mysql)5.5.50. ubuntu 14.04 amazon ec2

I didn't enable err_reporting in php.ini. but I tried <?php error_reporting(E_ALL); ?> in index.php and other files also. but I didn't find any log for errors.

algoprog commented 8 years ago

White page means error during php code interpretation. It's probably issue with config.php. Sphinx database (realtime index) details may not be always the same. It may run on a different port. You should check it. If you don't see any reported errors I can't help you more.

algoprog commented 8 years ago

Also, when you fix the problem, the scrappers may need a small update to work (the structure and/or domain names of the websites may have changed). If they need to be fixed and you fix them, please make a pull request. I am really busy these months, that's why I didn't update the project. I have also created a realtime metasearch torrent search engine that works with a simple MySQL database but is really slow compared to this search engine.

tunap commented 8 years ago

@BlackBeardsolution I look forward to you fixing the problems.

@algoprog Would you mind sharing the meta search engine code too?

algoprog commented 8 years ago

Yes, possibly at the end of the month, to make sure it works and improve the UI.

BlackBeardo commented 8 years ago

@Tunap , I am working on it. I have to solve this one. anyhow. checking if anything wrong with listen port.? currently using : $sdb = db_connect('127.0.0.1:9306', 'root', 'xxxxxx', 'rtindex'); // Sphinx Real-time index

also I tried:

### ubuntu@ip-xxx-xx-xx-xx:~$ sudo netstat -taupen Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 8931 1049/sshd tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 106 9071 1105/mysqld tcp 0 0 172.31.29.17:22 1.39.14.111:29673 ESTABLISHED 0 15429 2437/sshd: ubuntu [ tcp 0 356 172.31.29.17:22 1.39.14.111:11287 ESTABLISHED 0 15837 2581/sshd: ubuntu [ tcp6 0 0 :::80 :::* LISTEN 0 9366 1320/apache2 tcp6 0 0 :::22 :::* LISTEN 0 8933 1049/sshd udp 0 0 0.0.0.0:55835 0.0.0.0:* 0 7851 619/dhclient udp 0 0 0.0.0.0:68 0.0.0.0:* 0 7949 619/dhclient udp6 0 0 :::9669 :::* 0 7852 619/dhclient

but don't know which one is listening :(

algoprog commented 8 years ago

You should start Sphinx search daemon (searchd). I don't see any searchd listening on port 9306...

algoprog commented 8 years ago

You need both MySQL and Sphinx.

BlackBeardo commented 8 years ago

I did this > searchd

it gives me:

Sphinx 2.0.4-id64-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
WARNING: compat_sphinxql_magics=1 is deprecated; please update your application and config
FATAL: failed to open log file '/var/log/sphinxsearch/searchd.log': Permission denied
algoprog commented 8 years ago

Did you use the .conf file from install folder? Also it seems that Sphinx doesn't start because access is denied to log file.

algoprog commented 8 years ago

Try: sudo searchd

tunap commented 8 years ago

The default sphinx package on Ubuntu 14.04 isn't compatible. Use this guide: http://sphinxsearch.com/docs/current/installing-debian.html

And I'm attaching the sphinx config modified for Ubuntu.

sphinx.txt

BlackBeardo commented 8 years ago

after using > sudo searchd

GOT:

ubuntu@ip-xxx-xx-xx-xx:~$ sudo searchd
Sphinx 2.0.4-id64-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
WARNING: compat_sphinxql_magics=1 is deprecated; please update your application and config
listening on all interfaces, port=9312
listening on all interfaces, port=9306
precaching index 'mysql_all'
precaching index 'mysql0'                                   
precaching index 'mysql1'                                   
precaching index 'mysql2'                                   
precaching index 'mysql3'                                   
precaching index 'rtindex'                                  
precaching index 'rtindex0'
precaching index 'rtindex1'
precaching index 'rtindex2'
precaching index 'rtindex3'
precached 10 indexes in 0.210 sec
algoprog commented 8 years ago

You don't need the MySQL indexes anymore. They are only needed to import the torrents.

BlackBeardo commented 8 years ago

ok thanks,

but when I tried command you mensioned in readme.md for "Access Sphinx indexes with MySQL client": sudo mysql -h 0 -P 9306

it said:

ERROR 2003 (HY000): Can't connect to MySQL server on '0' (111)

algoprog commented 8 years ago

Try 127.0.0.1 or localhost instead of 0.

algoprog commented 8 years ago

After attaching the MySQL indexes to realtime indexes, you can get rid of the MySQL indexes and remove them from Sphinx configuration file.

BlackBeardo commented 8 years ago

127.0.0.1 is not working but localhost is giving some other clue:

ubuntu@ip-xxx-xx-xx-xx:~$ sudo mysql -h localhost -P 9306 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

algoprog commented 8 years ago

http://stackoverflow.com/questions/12126948/connect-to-sphinxql-through-linux-command-line

BlackBeardo commented 8 years ago

I am Confuse.! I removed all files from /var/lib/sphinxsearch/data then step 1:

ubuntu@ip-xxx-xx-xx-xx:~$ sudo indexer --all
Sphinx 2.0.4-id64-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
indexing index 'mysql_all'...
collected 2250996 docs, 105.2 MB
sorted 18.0 Mhits, 100.0% done
total 2250996 docs, 105156553 bytes
total 11.961 sec, 8790884 bytes/sec, 188178.91 docs/sec
indexing index 'mysql0'...
collected 562826 docs, 26.3 MB
sorted 4.5 Mhits, 100.0% done
total 562826 docs, 26300949 bytes
total 3.695 sec, 7116421 bytes/sec, 152287.54 docs/sec
indexing index 'mysql1'...
collected 562559 docs, 26.3 MB
sorted 4.5 Mhits, 100.0% done
total 562559 docs, 26290309 bytes
total 3.397 sec, 7737682 bytes/sec, 165570.63 docs/sec
indexing index 'mysql2'...
collected 562703 docs, 26.3 MB
sorted 4.5 Mhits, 100.0% done
total 562703 docs, 26293807 bytes
total 3.310 sec, 7941828 bytes/sec, 169959.82 docs/sec
indexing index 'mysql3'...
collected 562908 docs, 26.3 MB
sorted 4.5 Mhits, 100.0% done
total 562908 docs, 26271488 bytes
total 3.295 sec, 7972919 bytes/sec, 170832.35 docs/sec
skipping non-plain index 'orig'...
skipping non-plain index 'rtindex'...
skipping non-plain index 'rtindex0'...
skipping non-plain index 'rtindex1'...
skipping non-plain index 'rtindex2'...
skipping non-plain index 'rtindex3'...
total 17 reads, 0.602 sec, 18730.7 kb/call avg, 35.4 msec/call avg
total 1128 writes, 0.547 sec, 751.1 kb/call avg, 0.4 msec/call avg

It creates 40 files in /var/lib/sphinxsearch/data like mysql0.spa, mysql0.spd, mysql0.sph, mysql0.spi, mysql0.spk, mysql0.spm, mysql0.spp, mysql0.sps and for other same like mysql1.spd.........etc Am I going Right way?

if yes then what's next?

algoprog commented 8 years ago

Now access Sphinx indexes with MySQL client on port 9306, and execute the attach commands. After that you can remove the mysql indexes definitions from sphinx.conf.

BlackBeardo commented 8 years ago

to access sphinx indexes i did like this:

ubuntu@ip-xxx-xx-xx-xx:~$ mysql -uroot -hlocalhost -p -P9306
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 68
Server version: 5.5.50-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ATTACH INDEX mysql0 TO RTINDEX rtindex0;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ATTACH INDEX mysql0 TO RTINDEX rtindex0' at line 1

it's showing error.

BlackBeardo commented 8 years ago

also rtindex.lock is showing 0 KB size. i think something is wrong with it. my filezilla sanpshot:

screen shot 2016-09-02 at 4 24 23 am

algoprog commented 8 years ago

Can you view any records from mysql0 table for example?

BlackBeardo commented 8 years ago

Everything is setup. rtindex result: mysql> select * from rtindex; show meta;

+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| total         | 1000    |
| total_found   | 8876468 |
| time          | 2.326   |
+---------------+---------+
3 rows in set (0.00 sec)

Here is the problem: Search results are not showing up... @algoprog

screenshot from 2016-09-03 16-41-58

algoprog commented 8 years ago

Try searching something else, enable error reporting and execute the query in search.php manually from the mysql client to see if you get results.

BlackBeardo commented 8 years ago

I found the part which is causing problem.

in search.php --->

$quality = Rivr::getQuality($data['title']);
$data['quality'] = $quality;
$hasQuality[$quality] = 1;

if I comment this three lines the search results are showing. here is screenshot(after comment those three line): results

algoprog commented 8 years ago

If you comment these lines, you won't be able to filter movies and TV shows by quality. But did it cause a problem? Can you see the errors or warnings? It works for me.

BlackBeardo commented 8 years ago

and also this is my queries table:

mysql> select * from queries; 
+----+--------------+------+-------+------------+----------------------+
| id | query           | type | count |     first_date |      last_date  |
+----+---------------+------+-------+------------+----------------------+
|  1 | transformer |    1 |    10     | 1472902687 | 1472902687 |
|  2 | god              |    4 |     5      |     123456     | 1472925701 |
|  3 | xxx               |    1 |     1      |     123456     |     123456     |
+---+----------------+-----+----------+-----------------+----------------+

NOTE: I added this 3 rows manually when i search for transformer--> result showsup. same for god, and xxx

when I search for any other keyword instead of these 3, no results. just like first image that I attached today.

another issue is auto suggestion is not working. no suggestions. @algoprog

BlackBeardo commented 8 years ago

I did error_reporting(E_ALL); in search.php but no error. only blank page with searchbar in header.

I tried echo $data['quality'] , but no values/errors.

algoprog commented 8 years ago

You need to enable error reporting. You may have compatibility issues, because for me everything works fine.

algoprog commented 8 years ago

Execute the search query manually.

BlackBeardo commented 8 years ago

error found, mbstring extention was not installed in my apache and also disabled by default. so I installed it and ON it in php.ini. @algoprog

BlackBeardo commented 8 years ago

Finally Done. 100% running with current sql dump. @algoprog @Tunap thanks alot.

Also I will test this on server and make small detailed wiki for this one.