Video.js source not in Apache folder - linux

I have an Apache Server running on linux
The directory used for the website is the default
/var/www
When Using Video.js, setting the video source is easy when the files are in the same directory.
e.g.
/var/www/index.html
/var/www/video/video1.mp4
<source src="video/video1.mp4" type='video/mp4' />
I can't seem to set this source if the files are not in the Apache folder however.
e.g.
/home/user/video/video2.mp4
<source src="/home/user/video/video2.mp4" type='video/mp4' />

If Apache is using /var/www as your root, I don't think it will allow access to anything outside of that directory. Have you tried accessing those files directly in a browser, outside of video.js?
Additionally, by setting the source URL to '/home/user/video/video2.mp4', you're telling the browser to look for the file at "www.mywebsite.com/home/user/video/video2.mp4', which apache will translate to "/var/www/home/user/video/video2.mp4".
I'm far from an expert on how Apache works, but I hope that helps.

Related

Creating Virtual Directory on IIS for Coldfusion Lucee

I am trying to Move my Website on a local directory from Adobe Coldfusion to Lucee.
I was able to Install Lucee with the Windows Installer.
IIS is working fine.
When i Create a Virtual Directory from IIS to Map a Physical Path (C:/Website) outside the inetpub root folder (FOR IIS) or outside the Tomcat/webapps/ROOT folder (for Lucee), IIS doesn't load that physical folder. Instead it loads the inetpub root folder and i can't access files from the Physical Path Directory.
I am using //localhost/{The Alias} to call the Website but saying file not not found.
Obviously because it's calling from Inetpub file Directory, not the Physical path.
Are there any special configurations i need to make?
I have searched online and no post could help.
Note that i am using different computers.
Kindly Assist.
mod_cfml (the adapter that is used with Lucee/IIS along with the BonCode Connector) does not currently support virtual directories. You will need to configure those manually in the Tomcat context config, like so:
<Host name="lucee.org" appBase="/home/lucee/public_html">
<Context path="/vdir/" docBase="/home/other_user/public_html/some_other_directory/" />
<Alias>www.lucee.org</Alias>
</Host>

apache2 on ubuntu webserver rejects permission to access any other file than the delivered index.html

I am trying to set up a webserver running on Ubuntu. I have installed Apache and changed the root directory to an other directory within /var/www/. When I copy the index.html provided by Apache to that directory, I can access that file via remote webbrowser. But if I want to use a different index.html file, even really basic ones, I get an error: "Forbidden You don't have permission to access this resource". I have also tried to download that html, alter just a few lines and put it back on to the server with the result that it also shows that error. If I rename the initially provided index.html to index2.html I can still access it. I do not understand how it is possible that only this exact file is working.
I have tried to grant more permissions with Directory and restarted Apache but it won't work. I am rather new to Linux and Apache, can only use the terminal on my webserver and I do not know what else to do. Please help.
Change the permissions on the file, too, not just the folder. Pretty sure this fix it.
For diagnostic correction, allow permission for all by typing:
sudo chmod -R 777 /path/to/index.html

How should I place files on apache2 HTTP server

I am on Kali linux which comes with the apache2 http installed. Under /var/www/ there is a index.html file which is the default index page that will show up on localhost. I have this folder containing all my .html .css .js and some pictures that I want to put on the Apache2 server. Should I just copy/paste the folder under /var/www ?
Thats the traditional way to do it.
if you have virtualhosts or something a bit more complex then you might consider something else but typically people just drop everything in under /var/www (or the equivalent for a given disto or OS )
Yes, though you may need to adjust the accsess rights, and if you want you can use the apache config, or mount --bind, or git clone/pull. Start with the simple option then look into the other options to see if they offer you any benefit.

Where to administer apache fallback directory

I have been put in charge of an Ubuntu 13 server installation. Apache is configured to use /var/www as the default directory which is correct. The issue is that it seems there is a fallback directory configured that points to /usr/share. So if I type into a browser (www.address.com) it will serve the documents out of /var/www, but if I know the name of a directory in /usr/share and type in (www.address.com/sharedir) then it will serve out of the /usr/share directory. I have looked in the apache config file and default site config file and do not see this association. I do not want this behavior and am concerned that this is the default behavior out of the box.
Can anyone guide me to another areas where this behavior may be controlled/managed.
Thanks for any assistance.
Open your
/etc/apache2/sites-available/default
file and replace
/var/www
to
/path/to/folder/you/wish
save and it will be better to restart apache by
service apache2 restart
Now put website contents to the new location /path/to/folder/you/wish.
Once you changed the Document root of the of the site as mentioned above, Then no files will be fetched from any other location. Hopes this will help you. :)
[SOLVED] After a bunch more digging around I discovered that the user that originally set up this server erroneously put .conf files in the 'conf.d' directory and 'mods-enabled' directory that were routing traffic to the other directories. Sorry to anyone that noodled on this one.

Tomcat Configure To Serve Static Files is not working

I have linux machine, on which I have deployed my project. I have some static content which I have placed at /var/grt_dynamic_images on physical harddisk on linux. I am using it as /EchlonSurvey/images/dynamic/images. It is working fine on windows but not on linux.
Here is the server.xml file snapshot, where I am doing this configuration.
<Context docBase="/var/grt_dynamic_images" path="/EchelonSurvey/images/dynamic_images" />
<Context docBase="/var/grt_dynamic_images/category_images" path="/EchelonSurvey/images/dynamic_images/cat_images" />
<Context docBase="/var/grt_dynamic_images/profile_images" path="/EchelonSurvey/images/dynamic_images/prof_images" />
In webpage, I get 404 error. The path is same but the image are not coming from docBase. I have checked, there are all image which I need.
http://.../EchelonSurvey/images/dynamic_images/cat_images/277152_9449%20sml.png
image not available
one suggestion. if you have a ROOT webapp, you can create a symbolic link within it and point to the folder you want to serve. so something like
/tomcat/webapps/ROOT: ln -s /var/grt_dynamic_images /EchelonSurvey/images/dynamic_images
when i do this, it 'works' but only if i am specifying an actual resource on the url, like a .png file. i still get 404's if i just stop the url at a folder level. i'm sure there's some Tomcat setting for displaying a folder listing but haven't looked into it.

Resources