Code Monkey home page Code Monkey logo

mediagallery's Introduction

MediaGallery

web based media gallery

Accessing media on server

On Linux, if Apache2 webserver is used (and potentially other webservers), any folder that will have media provided throught the webserver needs to have executable access in it [1]. This allows access through the web browser not to be blocked. Possibly these access settings need to be applied to a few levels of parent directories of the folder of interest, based on the author's personal experience of testing the settings.

A way to create that is:

$ sudo chmod +x <target_folder>

where <target_folder> is the folder of interest.

Possibly read-write access to all users in the <target-folder> is recommended too.

For example:

$ sudo chmod 777 <target_folder>

If the <target_folder> is outside of the webserver directory, a softlink should be made to it in the webserver directory. This site can then set $origdir = '<target_folder>' to access the external folders.

In practice, it has been found that some parent directories to the <target_folder> need to be made executable and have read and write access given to them for the web server to allow permission to access the <target_folder> through a web browser. This may not be needed on some systems.

Enabling semi-automated icon generation

At least with the Apache2 webserver on Linux, for php to create an icon, based on first-hand experience it was found that a folder must be in the "www-data" group owned by the "www-data" user reference. This allows the webserver access to create a icon folder. Also it was found the the permissions set as 777 in both the target directory and its 1st or 2cnd level parent directories enabled the created directory to be at an access level that allowed php to copy the image into the icon directory. Perhaps less access then 777 could be used, but 777 was found to work.

Example of changing the user and group:

chown -R www-data:www-data /path/to/webserver/www

This advice about permissions and ownership is based on what worked with first-hand trial-and-error testing. It is unlear why specific ownership is needed given permissions set to 777 but it was found to work. Other settings may work as well.

Password security

On your local system rename dbaccess_example.php to dbaccess.php and enter your username and password for database access used to access the mediagallery database. Note: dbaccess.php is in the gitignore file to avoid password credentials being uploaded to the source control website.

Individual folders can be password protected using the method described here. In breif:

apache2.conf (which may be located in /etc/apache2/apache2.conf)

<Directory [target_folder]>

AuthUserFile [/path/to/.htpasswd]

AuthName "Restricted Access"

AuthType Basic

require user [username]

</Directory>

create password file:

Navigate to folder where file should be located.

htpasswd -c .htpasswd [username]

This will create a file named .htpasswd that stores the password.

Then run sudo service apache2 restart to apply the changes.

Setting up database

This creates a password for using the mediagallery site stored in mysql for security.

run the mysql script db.sql to create the mediagallery database in mysql. Then edit create_pass.sql to add the password you want. Run create_pass.sql to enter the password into the database.

mediagallery's People

Contributors

nmsutton avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.