Mamp PRO No Owner / Permission trouble on Windows (Running Wordpress) - wordpress

I have setup multiple hosts and everything was running fine until I wanted to deploy my website. All files uploaded via wordpress failed to transfer. I found out they had no Owner. So even me as a user/admin couldnt open them. I have to use powershell command "icacls * /reset /t /c /q" to fix the permissions and finally uploaded them but it doesnt sort this problem in a long term. Could anyone help me find out how to change the Owner with which Mamp saves files? Or is there any work around ? I havent been able to find anything in documentation not the interent.

Related

Permission Denied when deploying with Jenkins to Apache-owned directory

Background
At work we recently started using Jenkins CI for our Java code. We liked it so much, we wanted to use it for some PHP projects and some WordPress themes that we maintain as well.
The problem
I have set up Jenkins to run a gulp task to build the theme, which works fine. Then I have a deploy job that removes the old theme and moves the new code in place. This is where the problem lies. I have a bash script that runs in the deploy job like so:
whoami
mv /var/www/html/wordpress/wp-content/themes/my-theme /var/www/html/wordpress/wp-content/backups/theme/$(date '+%F')_$BUILD_NUMBER-backup_my-theme
mv $JENKINS_HOME/workspace/Build_MyTheme/build/my-theme /var/www/html/wordpress/wp-content/themes
When this runs, I get into the permission issues. Lots of "Permission Denied" errors. The whoami command prints off tomcat. Then the commands after that, like I mentioned, throw permission denied errors for the moving of the folder (whose parent folder, and self, are owned by apache). As far as I know, in order for WordPress themes to have handy features like updating itself, and plugins to be able to update and delete; the themes and plugins need to be owned by the apache user.
I am new at Jenkins CI, in fact another Developer set it up in Java. So I could be doing something wrong, but I think the main problem is the permission issues. How would you overcome permission errors where tomcat has to manipulate files owned by apache?
What I've tried
I have tried adding both apache and tomcat to a group called webusers, but I still got permission denied errors when trying to manipulate the files with Jenkins.
I have tried changing the owner of the files to tomcat:
This is the wp-content directory. As you can see, or maybe not because its so pixelated, that the plugins and themes folders are owned by tomcat and in the webusers directory. This works but with a major downside:
This is a major drawback, as it creates a bad user experience.
I have also tried making apache the owner, and using the group (previously created), then WordPress works, but Jenkins fails to deploy:
I'm just at a loss here, I have googled many times on the topics of "WordPress and Jenkins," "deplying WordPress with Jenkins," etc. As many varieties as I can think of. I have even gone to the Jenkins Documentation for help, but it refrences Drupal tutorials.
I read somewhere that you can deploy an Apache version of Jenkins, which may work for our PHP projects, but is it really best practice to have an instance of Jenkins per language?
Any help would be fantastic. Thank you ahead of time.

Password protect wordpress on Bitnami

I'm new to Bitnami and currently using a Google Cloud Platform for my VMs.
I'm trying to password protect a wordpress installation for 1 of my VMs. It's a dev site so only going to be using the IP address to access the site.
However following the instructions I found here, I am unable to write in the opt/bitnami/apache2/ folder. Everytime I try to run the commands in the above linked instruction, I get the following error
/opt/bitnami/apache2/bin/htpasswd.bin: cannot create file opt/bitnami/apache2/wordpress_users
I've tried to manually change the permissions on the folder and it doesn't work. I can't seem to run any commands with SU because there is no password provided for shell access (using only a ssh cert file)
Can anyone can offer help as to what I'm doing wrong or what I'm missing?
Thanks
Bitnami developer here,
It is not necessary to modify permission for the apache2 folder nor the htpasswd.bin file. The bitnami user does not have a password by default but is allowed to run commands with higher privileges using sudo. Could you please try to revert the permission changes and run the command with sudo?
cd /opt/bitnami
sudo apache2/bin/htpasswd -cb apache2/wordpress_users your_desired_username your_desired_password
Let me know if you have any other issue or if it worked for you.
Best regards,
Gonzalo
Bitnami developer here,
Sorry I didn't mentioned that you need to change to the /opt/bitnami directory first as I thought you already did it. Also, you have to run command with sudo because root is the owner of the apache2 folder.
Apart from that, I'm glad you could fix your issue!
Best regards,
Gonzalo
Thanks for the idea but it didn't work, I tried with sudo having my apache2/ folder set to 755 and ownership back to it's original setting.
On the other hand.... I manage to solve my problem. Seems that in the original on how to call your command there is a part missing! Well it's missing for me cause by adding the fullpath to the original file I was able to successfully get a password in place and things are now working perfectly
$ opt/bitnami/apache2/bin/htpasswd -cb apache2/wordpress_users username password
Took me too long to get that working... Thanks for the help, without you I wouldn't have made a typo that made me rethink the error! Thanks again

Silverstripe install admin js errors

For some reason my admin screen just hangs with some javascript errors. I have it installed on xampp on windows 7 ultimate 64bit. What could be causing this? Ill post a screenshot of the errors any help would be nice! p.s. This is my first time installing silverstripe ever so be nice. :)
This sort of things usually occurs when combined asset files cannot be created. Make sure the web server user has write access to the assets/ and assets/_combinedfiles folders, then go to your-site.com/admin/pages?flush=1.
Alternatively, since this is a local install, run in dev mode. There are instructions in the documentation on how to set this.
As indicated by #simon_w, this issue occurs due to the folder permissions:
In your local environment, in addition to the way via yml config, you can just put the following in _config.php inside mysite folder.
Director::set_environment_type("dev");
In dev mode, the installation doesnt need to write to assets/_combinedfiles. However, you had better have write permission for assets folder anyway.
So, just increase permissions for assets and directories under it. Uploaded files are also stored there, if not sufficient permission, you can't upload files from the admin panel. Other functionalists may also be affected.

Media won't upload on Wordpress via EC2 instance

I have install Wordpress have it all working on an EC2 instance and RDS.
One small problem I am having is uploading images through the media/image uploader on the wp-admin it keeps saying the following:
'“FC1.jpeg” has failed to upload due to an error
The uploaded file could not be moved to /var/www/html/wp-content/uploads/2012/06.'
I think it's most likely the permissions of the folder, because I used it yesterday and it worked, but after i sort of messed around with the chmod command on ssh.
I know the wp-content folder should be 775 and I have tried that but it doesn't work.
Any help?
Thanks
The permissions you used gave full privileges to the owner so they should work. Check to see who the owner and group are (ls -l on a *nix system).
You will need to know the webserver user and group. Check with your sysadmin (or in /etc/passwd). On *nix systems it is often ww-data or apache.
The owner and group should be set to the webserver. If they are not, run sudo chown webserverUser:webserverGroup.

Error: Forbidden Access Message (Drupal-6.x)

I'm new to Drupal and I'm trying to create multiple sites inside Drupal. I'm trying to create a symlink via the command line. I tried going to my browser to run the new installation for the new website, but I receive a message that says Forbidden Access.
To create the symlink in the terminal:
ln -s ~/Sites/drupal-6.20/sites/sitename2.com
My Drupal-6.20 folder is the root directory of my localhost.
In the browser to start the installation I tried:
http://localhost:80/sitename2.com
Short answer: the web root should be pointing to the index.php in the Drupal root for all of the sites you're hosting on that codebase.
In your case, you are getting an error because there's nothing in the /sites/yoursite.com directory that your webserver can run on it's own.
Longer answer: Configuring Drupal for multiple domains takes a little bit more reading and learning that can be summarized in an SO response.
The guide at http://drupal.org/getting-started/6/install/multi-site is a great place to start, and includes links to videos and additional tutorials in case you need additional help.
I don't know drupal that much, but i know other cms. And i think you should check for "permisions tab".
I worked with joomla, which i think is quite simmilar. And the first time you just have to go to http://localhost/. Installation started. And when it finnished, i had to delete installation folder out of localhost root.
But this is for joomla.

Resources