Magento 2 on docker generated files' user and permissions Mgt Development Environment - docker

I'm trying out MGT Development Environment 7.0 and installed a fresh copy of Magento 2.
every time after php bin/magento setup:upgrade, and reload the page, generated files in var, pub, generated have different user and group clp:clp.
Instead of running chmod -R 777 . every time. Can anyone suggest a better solution?
Thank in advance.

After view phpinfo(), found out that php in running by user clp
Simply chown the webroot clp:clp and everytime run php command by sudo -u clp php yourCommand, which solve the problem.

Related

Is there an alternative link instead of the one in the docker book?

I am new to docker and was working through the docker book and just got to the building a Sinatra web application part. But the link provided to download the source code doesn't exist. I tried using the GitHub link for the code but that isn't working as well. I need to make a binary executable as the next step and I am unable to do so.
$ cd sinatra
$ wget --cut-dirs=3 -nH -r -e robots=off --reject="index.html","
Dockerfile" --no-parent http://dockerbook.com/code/5/sinatra/ webapp/
This is what I am supposed to do but if you copy paste the link into your browser, it doesn't work. I also tried making each folder I needed and physically making files but in the next step which is chmod +x webapp/bin/webapp, it says that the directory does not exist even though it does.

How to edit permissions on Heroku application?

My problem in simple terms is that I have an executable that can't be run on Heroku, because it doesn't have the right permissions.
In more details, I have a RoR application on Heroku and I want to use server pdftk. But after installing it I need to chmod the file to be able to use it. And if I run a console on Heroku dashboard, put the chmod command in and try running pdftk it works, but it works just for that temporary dyno and it doesn't work on production server.
I tried creating .profile and putting the command in and that didn't work.
I tried creating Procfile and put release: chmod u+x /app/vendor/pdftk/bin/pdftk and it didn't work.
I tried all different versions of release, web, worker...
I tried creating a .sh file and putting the command in there and then running the file and it doesn't work either.
command for setting permission: chmod u+x /app/vendor/pdftk/bin/pdftk
If you need more info, please tell me.
Any help would be appreciated.
Okay, I figured out what the problem was.
I have a pipeline from gitlab and the permissions just needed to be set through git, so that they were correct when they came to the production enviroment.
I needed to run this code:git update-index --add --chmod=+x pdftk

Could not login with bash shell by default

I want to run a Ruby on Rails application. When I tried to run it, it shows me this,
The program 'rails' is currently not installed. You can install it by typing:
sudo apt install ruby-railties
So, I figured out the problem and I found that the problem is due to not login into bash shell. My terminal could not execute 'ruby' or 'ruby on rails' scripts. I checked .bashrc and .bash_profile files if PATH variable is set to point to rvm file.
When I did,
/bash/bin -l
it shows me ruby or rails are installed on system and I could start Rails server successfully. But if I opened another Terminal window, same problem occurs. Basically, I want to log into bash shell by default. Please correct and help me to sort out this. Thanks!
If you are sure the location of your bash shell is /bin/bash you could use this command (replacing "username" with your username):
chsh -s /bin/bash username
That will change your default shell in most unix like operating systems.
Afterwards you can verify it checking /etc/passwd where you will see the default shell at the end of the line of your username.
Warning: Try it first with a new user, in order to avoid losing your shell access if the path to bash is different :-)

Allowing Permissions for Rails on Bitnami Google Compute Engine

I am attempting to test the sample app provided by Bitnami in the Ruby Stack, I have placed the files in the htdocs folder:
and access the url http://(IP)/sample. The result is that the url is active but I do not have permission to access anything present as:
How can I alter the permissions for this sample app so I can access?
Bitnami developer here. If you want to deploy your application using Passenger, you can follow the next guide.
https://wiki.bitnami.com/Infrastructure_Stacks/BitNami_Ruby_Stack?highlight=ruby+stack#How_can_I_deploy_my_Rails_application.3f
Apart from that, if you want to deploy a new page using Apache, you have to give read privileges to Apache. You can run the following commands:
$ sudo chown -R bitnami:daemon /opt/bitnami/apache2/htdocs
$ sudo chmod -R g+r /opt/bitnami/apache2/htdocs
I hope this helps.

Reloading nginx config from within a rails app

I have a multi-app system running on a centOS box, that consists of our main app and a deployer app. when a client wants a new instance of our app, they use our deployer, fill in some info and the new install is created on our server. the issue i am having is that i can't get nginx to reload it's config file automatically. so after the deploy when visiting the new app we receive a 404 until i reload manually.
I've tried a few different ways including chmod /opt/nginx/sbin/nginx to 777, chmod the install script and deployer app to 777,
the script goes like this:
#create install directory -- works correctly
#copy files over -- works correctly
#run install script
##-- and then at this point i've tried multiple lines, including:
system("nginx -s reload") ## this works manually
system("/etc/init.d/nginx reload") ## this works manually
i've followed directions here: Restart nginx without sudo? to create a script to run without a sudo password and then tried this:
system("sudo /var/www/vhosts/deployer/lib/nginx_reload")
nothing seems to work, i'm assuming this is a permissions error, but maybe i'm wrong, if anyone could point me in any direction, that would be very helpful since i've been trying to figure this out for a few days too long and i'm fresh out of new ideas
sudo /etc/init.d/nginx reload

Resources