PDF through KOHA

اگر کوہا کے ذریعے پی ڈی ایف کی ایکسس دینی ہو تو تو کوہا میں اپ لوڈ کرنے سے کوہا کی رفتار سست ہو سکتی ہے۔ اس لئے کسی دوسرے کمپیوٹر پر تمام پی ڈی ایف رکھ کر اس کمپیوٹر کی مندرجہ ذیل طریقہ سے ایکسس دی جائے تو کوہا اوپیک سے ذریعے فائلز اوپن ہو جائیں گی۔  

For Ubuntu or Linux

 1. Install and Configure Apache on on specific computer 

1.      Install Apache:

sudo apt update
sudo apt install apache2

2.      Verify Apache Installation: Open a browser and visit:

http://#.#.#.#

3.      Create a Directory for PDFs:

sudo mkdir /var/www/html/PDFs
sudo chmod -R 755 /var/www/html/PDFs

4.      Copy Your PDF Files: Place your PDF files into the /var/www/html/PDFs directory. For example:

sudo cp /path/to/your/pdfs/*.pdf /var/www/html/PDFs

5.      Access the PDFs: Try accessing a PDF file in your browser:

http://#.#.#.#/PDFs/filename.pdf

 

For Windows:

1.      Install WAMP/XAMPP:

2.      Create a Directory for PDFs:

    • Place your PDF files in the Apache htdocs folder (usually located at C:\xampp\htdocs\ or C:\wamp64\www\).
    • Create a subfolder named PDFs, e.g., C:\xampp\htdocs\PDFs.

3.      Start Apache:

    • Open the WAMP/XAMPP control panel and start Apache.

 



4.      Access the PDFs:

    • Open a browser and test the link:
    • http://#.#.#.#/PDFs/filename.pdf

 

2. Update Koha OPAC Links to Point to #.#.#.#

To allow OPAC users to access the PDFs from the web server:

1.      Edit the 856 Field in Koha:

    • For each record in Koha where you want to link to a PDF, use the following format in the 856$u field:
http://#.#.#.#/PDFs/filename.pdf

2.      Verify OPAC Links:

    • Search for a record in OPAC.
    • Click on the link in the 856 field, and it should open the PDF hosted on #.#.#.#

  --------

Test Connectivity Between Koha and Web Server

1.      Ping the Web Server (#.#.#.#) from Koha (#.#.#.#):

    • From the Koha server, test if it can reach the web server:
ping #.#.#.#
    • Ensure the network connection is active.

2.      Check Firewall Rules:

    • Ensure that port 80 (HTTP) is open on the web server (#.#.#.#).
    • On Linux:
sudo ufw allow 80
    • On Windows:
      • Open "Windows Defender Firewall with Advanced Security."
      • Add an inbound rule for port 80.

 -------

Outcome

1.      Users on OPAC access PDFs using links like:

http://*.*.*.*/PDFs/filename.pdf

2.      The files are served directly from the web server (#.#.#.#).

 

XAMPP location is E:\XAMPP\htdocs but i want to create folder in H drive for pdf material

 

You can configure XAMPP to serve PDF files from a folder located on your H drive while keeping the XAMPP installation and web server in the E drive. Here’s how you can do it:

1. Create the Folder for PDFs on the H Drive

1.      Navigate to your H drive and create a folder for your PDFs, e.g., H:\PDFs.

2.      Copy your PDF files into this folder.

2. Create a Symbolic Link (Symlink)

A symbolic link will allow XAMPP’s web server to treat the folder on your H drive as if it were part of the E:\XAMPP\htdocs directory. This way, you can serve files from your H drive via Apache.

For Windows (Using Command Prompt)

1.      Open Command Prompt as Administrator. Right-click on the Start menu, select Command Prompt (Admin) or Windows PowerShell (Admin).

2.      Run the following command on cmd (as ADMIN) to create a symbolic link:

mklink /D "E:\XAMPP\htdocs\PDFs" "H:\PDFs"

This command creates a link in the htdocs folder (where XAMPP serves files) that points to the PDFs folder on the H drive. Now, Apache will treat the H:\PDFs folder as part of its web server document root.

Alternative (Without Symlink)

You can directly configure Apache to point to the folder on the H drive, but using a symlink is a simpler and more flexible solution.


3. Restart Apache Server

After creating the symlink, restart the Apache server to apply the changes:

  1. Open XAMPP Control Panel.
  2. Click Stop for the Apache server, then click Start again.

 



4. Accessing PDFs via Browser

Now you can access the PDFs from your H drive by using the following URL:

http://#.#.#.#/PDFs/filename.pdf

5. Update Koha 856 Field

Ensure that the 856$u field in Koha for each relevant record contains the correct URL:

arduino
Copy code
http://#.#.#.#/PDFs/filename.pdf

Summary

  • Your PDFs will be served from the H drive via Apache.
  • You can access them through the web using the http://#.#.#.#/PDFs/filename.pdf link.
  • The symbolic link allows Apache to treat the H drive folder as part of the web server’s root directory.

Let me know if you need further clarification or assistance with any of the steps!

 

No comments:

Post a Comment

Total Pageviews