I finally figured out how to get jpegoptim properly installed on my Centos 6 system and ran the command on a larger folder of images like this
jpegoptim *.jpg --strip-all
Now none of the images appear on my website! They are still in the folder and considerably compressed, but they don't appear to be accessible. I am assuming this must be a permissions issue? Has anybody experienced this?
Okay, I figured this out. For some reason, jpegoptim changes the permissions on the file when you run it. After changing the permissions to 755 (-rwxr-xr-x) using the command chmod -R 755 [containing_folder] the images are now visible again.
Related
Am working in Django and was trying to serve media files and was encountering an error with accessing the system folder serving media files. Being (much) less familiar with terminal-related commands, I searched SO for a solution. I ended up executing the "good" code in this SO answer. This part, specifically:
sudo groupadd varwwwusers
sudo adduser www-data varwwwusers
sudo chgrp -R varwwwusers /var/www/
sudo chmod -R 770 /var/www/
This somehow messed up my whole system. I can't even start gunicorn now, I'm getting OSError: [Errno 13] Permission denied: '/apps/djangoProjectFolder' in my terminal output when I try to do so.
I'm basically clueless at this point. Would like to learn what I did wrong, and how I can undo this situation.
Thanks for the comment. I ended up doing a clean reinstall of Unbuntu. All fixed now! Just that it was really laborious to manually transfer all my existing files since wholesale copy+pasting didn't work (seemed like the erroneous permissions got copied over too).
Can anyone help me fix the below error message I'm getting? I've finally got Symfony installed on a VM and it seems to be working ok except for the fact that I'm getting occasional messages for things like this:
[1/2] ContextErrorException: Warning: SessionHandler::read(): open(/var/lib/php5/sess_d8qgvn11jdu8rfuo1f0njokc67, O_RDWR) failed: Permission denied (13)
From what I've picked up from reading around, I'm thinking it's because I have a mismatch between the owner/permissions between linux and the webserver but I don't know how this would happen (I'm just taking this as fact and I don't really understand how/why to prevent making the same mistakes in the future).
Each time I've been getting one of these errors I'm submitting a mix of the below commands to try and fix the problem but I'm guessing it's not the right way to go about it (text in brackets is my understanding/guessing of what they do):
sudo chmod a+x <path>
Modifies the permissions of the directory
sudo chmod -R 775 <path>
Similar to previous except that it SETS the permissions -R applies it recursively
sudo chown -R <usr>:www-data <path>
Changes the owner/group of the directory/file
You can take a look at http://symfony.com/doc/current/book/installation.html on "Setting up Permissions" section. It talks about app/logs and app/cache, but you can do the same on any other folder you need
In Symfony3, I had this error after installing symfony in a new fresh VPS, I resolved it using the already noted : chmod -R 775 for the LOG and CACHE but now for the SESSIONS folder.
chmod -R 775 var/sessions
Similar symfony permissions issue this worked for me:
sudo chown <yourcliusername> /var/lib/php5
Source: https://stackoverflow.com/a/33991320/1438029
Duplicated answer from https://stackoverflow.com/a/39346877/4276533
You can set path for sessions manually. See Symfony doc on sessions directory.
# app/config/config.yml
framework:
session:
handler_id: session.handler.native_file
save_path: '%kernel.root_dir%/sessions'
I am on Fedora 17 trying to use svn version 1.7.6
I have created a repository at /home/el/svnworkspace and I checked out a working copy in /workspace
I am getting this error when I use the command:
[root#defiant workspace]# svn remove TestProject --force
Gives the Error:
svn: E155035: '/workspace/TestProject'
is the root of a working copy and cannot be deleted
The error message is partially right, TestProject was a root before. But I deleted it and now /workspace the root. So somehow it is confused. I no longer want TestProject to be a root, and I want workspace to be the root. svn is confused, and I want to unconfuse it, maybe one of you know the proper wizard incantation to remove /workspace/TestProject as a root of a working copy? I just want it to be a normal folder again.
Perhaps the only way for me to fix it is to blow everything away and re-add everything. Maybe a resident wizard knows a better way.
SVN does get confused about directories sometimes.
Unless you have a lot of changes you need to check in, I suggest removing the hierarchy in question from your filesystem (rm -rf), and checking out again starting from wherever looks appropriate. This always seems to handle SVN directory confusion for me.
I was able to fix the problem with these steps:
Make sure nothing has a lock on the files in question, for me: Eclipse IDE. So close any IDE's or Editors that might have a lock on the file.
Make sure you have write permissions on the working copy as well as the repository.
chmod -R 775 /workspace
chown -R your_user_name.your_user_name 775 /workspace
chmod -R 775 /home/el/svnworkspace
chown -R your_user_name.your_user_name 775 /home/el/svnworkspace
If you are using a program with a GUI like rapidsvn to add/remove/commit files, turn that off and use only the command line svn command. The GUI might have been have been conflicting with what I was trying to do on the command line.
finally, I think this part is what fixed my problem:
Go into the directory that I want to add, but won't add. Manually rm -rf all the .svn files in it. Then try to svn remove it then svn add it. It successfully adds and then I could commit it and all is well.
I can't properly install kohana on my mint distro, because the cache and logs aren't writable. I've tried chmod 777 cache and same for logs, but it just won't change. chmod a+w didn't help either.
Any solutions?
It might be possible that you already had some logs which permissions did not change with chmod. I would recommend that you try a recursive chmod with chmod -R 777 cache. Also, though I am certain that you already checked those things, make sure that these directories truly exist and that they were not misplaced.
First off, I'm running Mono to run ASP.NET on Linux, but that's not the question.
It appears that, every time I clear out my application directory and upload, I have to go back in and fix the permissions. What I'm doing is
chmod -R -c 755 /var/www/*
...and there are two questions.
What's the deal with having to do this every time I FTP? Feels flaky.
Is there a better permissions set than 755? Do I want different permissions for the /bin directory? Or can I fix this all with one fell swoop of chown?
It could depend on your FTP server and configuration. I always used this and it worked:
chmod 777 /path/...