Apache2 in docker container gives 403 on statically served files - apache

I'm having a weird issue and am looking for ideas.
I'm running an apache2 debian image that serves some static files, and has a few redirect rules.
Running a container works fine, but results in 403 (permission denied) errors on any request (curl as well as browser).
When I then exec into the container and perform an ls in a static file folder (such as css), those files are being served correctly on the next request.
My current workaround is a startup script with a find /var/www/html/ -name '*'. This makes the container work as expected, with all the served files being accessible.
All the files have the correct owner (www-data) and permissions.
Docker version 1.7.1, but issue appeared also on 1.7.0
I'm running an Ubuntu VM, but my colleague reproduced this on a mac with docker machine.
Whatever could be a reason for this behaviour?

Related

Installing a saas on a micro-EC2 centos

I want to install the following SAAS in a EC2: https://github.com/thedevdojo/wave
I installed php8.0, composer and nginx. Then I followed the steps given at the github. Everything worked without an error.
Now I want to link nginx (or httpd) to the folder where the clone of github is. I modified /etc/nginx/nginx.conf and changed the route to the route where my clone is (specifically, until public folder of this git). Then I added at the top of the file user ec2-user ec2-user; beacuse this is the user I used to clone.
However, now I'm having errors from the php-fpm upstream:
connect() to unix:/run/php-fpm/www.sock failed (13: Permission denied) while connecting to upstream
And now I don't know what to do else. I also tried to stop nginx, run httpd, and put all files from the clone (sudo cp routeoftheclone /var/www/html), being the files of the public folder inside html, and the rest out of html (See github project; public is where the index.php is). However if I load the page I get a blank website, and I'm not sure how to log the errors.
I just want to use the saas, I don't care to use apache, nginx or others. What else do I need to do?

Running apache in an ubuntu Docker container on a RedHat machine

I am new to Docker and have been trying to configure a standard default install of Apache2 running on the ubuntu:14.04 image.
This seems to work just fine when the Docker host machine is running Ubuntu, but when I try to run this same config on a machine running RHEL 6, I get apache config errors having to do with file permissions. Specifically, the default apache page returns a 403 forbidden page.
I thought the point of Docker was that I could create a container on one environment and it should behave exactly the same on any other environment.. am I way off?
Not 100% sure, but it may be that you need RHEL 7. From here you can:
docker pull rhscl/httpd-24-rhel7
See https://access.redhat.com/solutions/1378023

Tomcat interfering with other website in public_html

I am trying to install Islandora on an server running both drupal and Fedora. Fedora runs on Tomcat, which seems to take of the public_html directory.
I believe it is related to this link:
http://www.coderanch.com/t/530321/Tomcat/SOLVED-Tomcat-subdirectory-mapping-WWW
Fedora is running fine, but when I try to run Drupal I get a error:
HTTP Status 404 - /drupal
type Status report
message /drupal
description The requested resource is not available.
Apache Tomcat/7.0.56
Guidance would be great. Thanks for the help.

How to run my html file with apache2

Maybe it is not a right channel to ask this question but I donot know where to ask.
I want to know how to run html file with apache on my ubuntu. I have written program with javascript and a html file and I want to run it via apache. I could not find htdocs folder in to copy my files there beside that I do not have permission to do that in ubuntu. My apache is installed in /usr/share/apache2.
When I write http://localhost it says:
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
but I do not know where to add the contents.
any help.
The default folder that it serves the HTML files from is /var/www.
For example, /var/www/test.html would be http://localhost/test.html.
In my case where I have installed and running the Apache 2 and if I type localhost/ into the browser it opens the Apache 2 Ubuntu default Page.
Now what I did was:
Suppose your HTML webpage Demo.html is located in the Website directory then copy the HTML page using one of the commands:
:~$ cp ~/Website/Demo.html /var/www/html
If this command does not work then try with the following command:
:~$ sudo cp ~/Website/Demo.html /var/www/html
And then open your browser and type this the browser search bar:
localhost/Demo.html
It will open the copied Demo.html.
Also if you want to access this hosted webpage from the outside of the machine where Apache 2 is running then use it's external IP address instead of localhost as follows:
ExternalIP/Demo.html

how to configure apache to run pages with a different group id than files

I have a vps with godaddy with the following:
centos 6
latest apache
whm/cpanel
I am running with suphp enabled.
files and folders are all 755,644
i have a program located at:
/home/programname/public_html
this program edits files located on the same server in different user accounts. in order for this to happen i have to:
chown programname:programname /home/username/public_html
this allows the files to be edited by the program running at /home/programname/public_html
when i try to view the files at
/home/username/public_html
at its domain name
username.com
I get an "The server encountered an internal error or misconfiguration and was unable to complete your request."
in order to fix this i have to
chown username:username /home/username/public_html
how do i fix this so i can view the website files without having to chown the files?
You can use ACLs:
Enable ACLs on a filesystem:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-acls.html
Set ACLs on a filesystem:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/acls-setting.html
There is also an apache module that I haven't had much luck with:
apache2-mpm-itk - http://www.webtatic.com/packages/httpd-itk/
It has some issues because it doesn't support prefork properly.