Jump to content

mike2

Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by mike2

  1. I would like to modify my php script where my PDF search results would not only display the company name, the country, but also display a limit number link by pages so that not all of the results are shown. I also want the first word searched to go to the first occurrence of the word on the PDF document. What would be the best way to do this? Here is my code: <html> <head></head> <body> <?php if (!isset($_POST['q'])) { ?> <img src="/wvb-logo-slogen.png" border="0" /> <h2>Search</h2> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> <input type="text" name="q" size="30" /> </form> <?php } else { ?> <img src="/wvb-logo-slogen.png" border="0" /> <h2>Search Results</h2> <?php try { // create object // $swish = new Swish('/usr/local/apache/htdocs/swish/index.swish-e'); $swish = new Swish('/var/www/html/pdf2/index.swish-e'); // get and run query from command-line $queryStr = htmlentities($_POST['q']); $result = $swish->query($queryStr); ?> Found <?php echo $result->hits; ?> match(es) for '<?php echo $queryStr; ?>'. <?php // iterate over result set // print details for each match while($r = $result->nextResult()) { ?> <p> <?php echo $r->swishreccount; ?> <strong> <a href="<?php echo '/pdf2', ltrim($r->swishdocpath, '.') ; ?>"> <?php echo $r->swishdocpath; ?> </a> </strong> (score: <?php echo $r->swishrank; ?>) <br/> <?php echo $r->swishdocpath; ?> </p> <?php } } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } } ?> </body> </html> Any assistance would be greatly appreciated.
  2. I do know how the pieces fit together. I just need assistance. I just need to keep doing my research.
  3. I don't even know where to begin looking.
  4. I don't know anyone who would be able to help me. I e-mailed somebody to see if they knew somebody via skype and I still haven't heard back from them. Are there websites with actual professionals that would be able to assist me? Furthermore my alma mater, of all places, doesn't teach any classes that specialize in php coding.
  5. I am not making mess I am trying to get this done for my job. My employer assigned me this project. Did you not read my post. I have no idea what to do to be honest with you and I need help. I am just trying to grab and search files from a different directory.
  6. I don't know if you are still online right now but I think I may know what the issue is. The server contains a 1.5 TB drive which is partitioned by lvm. The partitions created on this server are all on the same physical drive but different logical volumes. For example the /home directory resides under the /vg_zeus-lv_home device name. The apache is installed at the device named /vg_zeus-lv_root. The issue is related to apache and /home/wvbadmin directories residing on seperate logical volumes. Would the following scenario work to give me the results I need for my pdfsearch2.php script to give the same results as pdfsearch.php script under the /var/www/html directory? Now keep in mind that I copied everything over from /var/www/html directory to /mnt/www/html directory. This is what is inside /mnt/www/html directory: total 48 -rw-r--r--. 1 root root 6678 May 8 14:33 favicon.ico -rw-r--r--. 1 root root 113 May 8 14:33 hello.php -rw-r--r--. 1 root root 19 May 8 14:33 info.php drwxr-xr-x. 2 root root 4096 May 8 14:35 pdf2 -rw-r--r--. 1 root root 1228 May 8 14:44 pdfsearch2.php -rw-r--r--. 1 root root 1204 May 8 14:33 pdfsearch3.php -rw-r--r--. 1 root root 1216 May 12 11:35 pdfsearch.php -rw-r--r--. 1 root root 1838 May 8 14:33 search.php -rw-r--r--. 1 root root 10077 May 8 15:24 wvb-logo-slogen.png Here is the following scenario: Scenario 1: Configure apache so that the htdocs root is located under the /home directory. We might create a user "www" to be the owner of htdocs. This would then place both htdocs and pdf directories under the same logical volume. How would I go about doing the above scenrio? Where in the apache config file is htdocs? Would that work?
  7. mike2

    Logo help

    To answer your question no it is not root. I think I just found it hold on. But I want to make /mnt/www/html the root for apache. Is it possible to change the configuration file because I have to do that next.
  8. mike2

    Logo help

    What do you mean is the html directory of my document root? Are you asking is it assigned under the root user? yes it is. Or are we talking about logical volumes here? -rw-r--r--. 1 root root 10077 May 8 15:24 wvb-logo-slogen.png How would I go about changing it to root? I tried putting that code like this and I am still not getting it to appear: <html> <head></head> <body> <?php if (!isset($_POST['q'])) { ?> <img src="/wvb-logo-slogen.png" border="0" /> <h2>Search</h2> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> <input type="text" name="q" size="30" /> </form>
  9. How would I get a logo to appear within my search page? I have this png file it is called the following: wvb-logo-slogen.png the png file is located under the /mnt/www/html directory. Here is the code that I am trying to use to get this logo to be displayed on my web page: <?php if (!isset($_POST['q'])) { ?> <!-- begin logo --> <div id="logo"> <a href="home"><img src="/mnt/www/html/wvb-logo-slogen.png" border="0" /></a> </div> <!-- end logo --> <h2>Search</h2> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> <input type="text" name="q" size="30" /> </form> <?php } else { ?> <h2>Search Results</h2> <?php try { // create object // $swish = new Swish('/usr/local/apache/htdocs/swish/index.swish-e'); $swish = new Swish('/var/www/html/pdf2/index.swish-e'); // get and run query from command-line $queryStr = htmlentities($_POST['q']); $result = $swish->query($queryStr); ?> Found <?php echo $result->hits; ?> match(es) for '<?php echo $queryStr; ?>' . <?php // iterate over result set // print details for each match while($r = $result->nextResult()) { ?> <p> <?php echo $r->swishreccount; ?> <strong> <a href="<?php echo '/pdf2', ltrim($r->swishdocpath, '.') ; ?>"> <?php echo $r->swishdocpath; ?> </a> </strong> (score: <?php echo $r->swishrank; ?>) <br/> <?php echo $r->swishdocpath; ?> </p> <?php } } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } } ?> </body> </html> My questions are the following: Why isn't my logo displaying? Is it the right format? Are there special html or php items that I need to put in order for my logo to be displayed right above the word "Search"? Any assistance would truly be appreciated because I have no experience using php.
  10. Forgive the lateness of my reply. But things have changed I will let you know what has happened.
  11. Here is output: [root@zeus conf]# ls -la /home/wvbadmin/pdf3/index.swish-e -rw-r--r--. 1 root root 4816366 May 5 23:32 /home/wvbadmin/pdf3/index.swish-e
  12. Furthermore since none of the permission changes seem to be working, may I change them back to their original permission settings?
  13. Can the Apache configuration file have multiple document roots?
  14. I did just that and I am still getting permission error. One more thing that I want to mention is that I have never even used php code before. This is my first time and I just to be able to get this phase of my project done before I move on the next phase. If I were to change the location of the DocumentRoot from /var/www/html to /home/wvbadmin would that be of assistance or does the Apache config file need to be pointed at /var/www/html?
  15. Here is also what is inside my /var/www/html directory if it's any help. [root@zeus html]# ls -l total 60 -rw-r--r--. 1 root root 6678 Apr 30 13:25 favicon.ico -rw-r--r--. 1 root root 17256 May 5 16:02 h1 -rw-r--r--. 1 root root 113 Apr 29 16:45 hello.php -rw-r--r--. 1 root root 19 Apr 24 23:53 info.php drwxr-xr-x. 2 root root 12288 May 5 21:51 pdf2 lrwxrwxrwx. 1 root root 20 May 5 15:46 pdf3 -> /home/wvbadmin/pdf3/ -rw-r--r--. 1 root root 1214 May 6 11:18 pdfsearch2.php -rw-r--r--. 1 root root 1216 May 6 09:56 pdfsearch.php -rw-r--r--. 1 root root 1838 Apr 30 13:10 search.php
  16. To answer your question about soft links and how they work. Don't they link up to a another directory? I also restarted Apache and I am still getting permission denied. I understand that is either an apache config problem or something with my code. It shouldn't be my code. My code should be doing what it is supposed to be doing.
  17. My apoligies here is the updated pdfsearch2.php script: <html> <head></head> <body> <?php if (!isset($_POST['q'])) { ?> <h2>Search</h2> <form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> <input type="text" name="q" size="30" /> </form> <?php } else { ?> <h2>Search Results</h2> <?php try { // create object // $swish = new Swish('/usr/local/apache/htdocs/swish/index.swish-e'); $swish = new Swish('/home/wvbadmin/pdf3/index.swish-e'); // get and run query from command-line $queryStr = htmlentities($_POST['q']); $result = $swish->query($queryStr); ?> Found <?php echo $result->hits; ?> match(es) for '<?php echo $queryStr; ?>' . <?php // iterate over result set // print details for each match while($r = $result->nextResult()) { ?> <p> <?php echo $r->swishreccount; ?> <strong> <a href="<?php echo '/pdf3', ltrim($r->swishdocpath, '.'); ?>"> <?php echo $r->swishdocpath; ?> </a> </strong> (score: <?php echo $r->swishrank; ?>) <br/> <?php echo $r->swishdocpath; ?> </p> <?php } } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } } ?> </body> </html>
  18. I did them both and I am still getting: Search ResultsERROR: Could not open the index file '/home/wvbadmin/pdf3/index.swish-e': Permission denied when I go to http://64.244.240.221:8080/pdfsearch2.php and enter in the word bank in the search engine and nothing shows up. Just the above message. I even tried going into the apache config file and changed UserDir to /pdf3 and it is still not working. I am starting to lose my patience. I just want to search from the /home/wvbadmin/pdf3 directory. I should be able to run this.
  19. I redid what you told me to do in your 2nd reply. I am still getting the same error. Permissions denied. Should I restart apache? I did the following: su -c 'chmod 755 /home/wvbadmin/ -R' Should I now do what you told me to do reply number 18?
  20. I will give those a try and let you know what the outcome is.
  21. Here is what I have in my Apache configuration file. # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks Should the above be changed to Options +FollowSymLinks? Is that what you are asking/do? Also Here is what I have in the Apache configuration file as far as htaccess # # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess Plus # # UserDir is disabled by default since it can confirm the presence # of a username on the system (depending on home directory # permissions). # UserDir disabled Should the above be changed to UserDir pdf3? Since that is where we are searching from? What do you mean by mod_php? This is the version I am running. [root@zeus conf]# rpm -q php php-5.3.3-27.el6_5.x86_64
  22. Are there any changes I can make to the Apache configuration file that would be get this problem resolved? I would like to resolve this issue as soon as possible.
  23. As you can see pdfsearch2.php is what I am trying to run but is giving me a permission error. phpsearch.php works correctly and does its function but what I am trying to do is get pdfsearch2.php to work the same way as pdfsearch.php but search files that are in the /home/wvbadmin/pdf3 directory.
  24. Did you mean files with the same name as index.swish-e?
  25. Okay, Let me try to answer that question as best I can: Under the /home/wvbadmin/pdf2 directory and /home/wvbadmin/pdf3 directory I have the index.swish-e file but under /home/wvbadmin/pdf3 directory index.swish-e is lit up as green indicating it is an executable. I don't know why. Under the /var/www/html directory I have this: -rw-r--r--. 1 root root 6678 Apr 30 13:25 favicon.ico -rw-r--r--. 1 root root 17256 May 5 16:02 h1 -rw-r--r--. 1 root root 113 Apr 29 16:45 hello.php -rw-r--r--. 1 root root 19 Apr 24 23:53 info.php drwxr-xr-x. 2 root root 12288 May 5 21:51 pdf2 lrwxrwxrwx. 1 root root 20 May 5 15:46 pdf3 -> /home/wvbadmin/pdf3/ -rw-r--r--. 1 root root 1214 May 6 11:18 pdfsearch2.php -rw-r--r--. 1 root root 1216 May 6 09:56 pdfsearch.php -rw-r--r--. 1 root root 1838 Apr 30 13:10 search.php Under the /var/www/html/pdf2 directory and /var/www/html/pdf3 directory I have the index.swish-e file but under /var/www/html/pdf3 directory index.swish-e is lit up as green indicating it is an executable. Again I don't know why. Also take into account that pdf3 is being soft linked to the /home/wvbadmin/pdf3 directory which is where I want to get and search my files from if you remember my original question.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.