How do I keep OS X from requiring admin password when I copy to or delete from its web server? - macos

I've started using the Apache web server that comes with OS X (10.9.4) for testing. When I copy files to its web root (/Library/WebServer/Documents) or delete from the same, I get prompted for the admin password. I have this password, so that's not a problem. It's just inefficient. I haven't had this issue when using other installs of Apache (generally via MAMP). So I'm sure it's just a config issue. Any help is appreciated.

This is done to protect the directory, you can add an ACL to allow your user account read/write access to that folder.
You can add the ACL as follows, Please be sure to change "yourshortname" to your username on the computer.
sudo chmod -R +a "yourshortname allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity" /Library/WebServer/Documents
Let me know if it works for you.

Related

ftpd can't change root directory when connecting as a non-root user

I have an embedded system running linux and I have busybox installed for running different services. One of the services is ftpd, which I start like this from the etc/init.d/rcS file:
tcpsvd 0.0.0.0 21 ftpd -w -v /mnt/flash&
I have two users in the system, root and a regular user. Root user can easily connect to the FTP server, but when I try to login with the regular user's credentials, I get this error:
ftpd[678]: can't change root directory to '/mnt/flash': Operation not permitted
Now, I thought that it must be a directory permission problem, and I started with changing permissions on the /mnt/flash directory first, but after this didn't work, I ended up having all my files in file-system including / to be owned by this regular user and have drwxrwxrwt permissions (just to find the cause of the problem). But I still get this error.
I have also tried to start ftpd with different root folders, including /.
I also couldn't find any config files for the ftpd in my file-system, maybe I need to create one manually? If so, which one and how to tell ftpd to allow user logins?
I'd really appreciate any help. Thanks.
Well, after trying some random things, I discovered that user login works fine if there is no directory changing involved at all:
tcpsvd 0.0.0.0 21 ftpd -w -v &
I suspect that chroot is called otherwise and the user does not have a right to do that.

Changing permissions on Windows for FTP via XAMPP

I am developing a rather basic CMS locally and can not ftp due to permissions problems. I have FileZilla FTP server running in XAMPP and can connect without problems but receive error "550 Permission Denied" when my code tries to upload via ftp.
I tried changing permissions via my FileZilla FTP client but without success (presumably because it is windows- error: "504 Command not implemented for that parameter"). I also tried going to the target folder's properties --> security --> permissions and checking "full" for the user XAMPP is running under.
So how do I setup the permissions to allow my CMS to use ftp in XAMPP?
Finally figured it out. For anyone else who has this problem, there is no need to set permissions in Windows. Instead, on the FileZilla FTP server admin interface select edit --> users --> shared folders and check 'write'.
For a fix of this make sure that the root folder is allowed to write and pass rights permission. had this same issue for a script to run on local web xampp server windows xp.. just change the root file attributes to 755 then try it if that don't work try 777. should work now... hope this works for you... as it did me.
If that does not work go to your htdocs folder in your xampp directory then right click it and check properties .. if read only is ticked .. untick it and apply to all sub folders and files
You're behind firewall? Try to allow FileZilla server program in Firewall.

What folder on Mac is writeable without admin access but readable by all users?

I'm looking for a place to save my app's license file. I want it in a location that's accessible by all users so if one user on the machine activates the app, the app is also activated for every other user. However, I don't want to require elevation to write to this location.
On Windows, I use C:\Users\Public. Is there an equivalent on OS X?
Thanks!
You can make any directory you own publicly accessible by allowing it with chmod. For instance:
mkdir ~/Public
chmod 755 ~/Public
will create and make world-readable the directory /Users/YourName/Public

How to enable my Joomla extension?

When logged in as Administrator and trying to install a Joomla extension it fails giving this error message
JFolder::create:
Unable to create destination
At another Joomla site it works, and one difference is where it works Joomla is setup with default English and where it fails setup is in Swedish. Can you recommend how to troubleshoot and proceed? I tried with 2 different extensions and both work on the English joomla and not the Swedish.
Probably you have to check the rwx (Read-Write-Execute) permissions (should be 644 or 755) for allowing the extension's folder to be created.
You have to change the owner of the folders/files to the user of the Apache server using the "chown" command.
If the Apache user is httpd, run this command in your Joomla folder
chown -R httpd *
I already get this problem and this solution worked for me.
Also check the path to the /tmp folder in your configuration.php file.

Correct owner/group/permissions for Apache 2 site files/folders under Mac OS X?

It's hard to find Mac-specific answers to this question on the web, so I'm hoping someone out there can put this one to rest for me? My permissions are screwed up on my sites and I'm not sure how to fix them without just slamming a recursive 777 on everything which is quite obviously incorrect.
Thanks!
This is the most restrictive and safest way I've found, as explained here for hypothetical ~/my/web/root/ directory for your web content:
For each parent directory leading to your web root (e.g. ~/my, ~/my/web, ~/my/web/root):
chmod go-rwx DIR (nobody other than owner can access content)
chmod go+x DIR (to allow "users" including _www to "enter" the dir)
sudo chgrp -R _www ~/my/web/root (all web content is now group _www)
chmod -R go-rwx ~/my/web/root (nobody other than owner can access web content)
chmod -R g+rx ~/my/web/root (all web content is now readable/executable/enterable by _www)
All other solutions leave files open to other local users (who are part of the "staff" group as well as obviously being in the "o"/others group). These users may then freely browse and access DB configurations, source code, or other sensitive details in your web config files and scripts if such are part of your content. If this is not an issue for you, then by all means go with one of the simpler solutions.
If you really don't like the Terminal here is the GUI way to do dkamins is telling you :
1) Go to your user home directory (ludo would be mine) and from the File menu choose Get Info cmdI in the inspector :
2) By alt/option clicking on the [+] sign add the _www group and set it's permission to read-only :
Thus consider (good practice) not storing personnal information at the root of your user home folder (& hard disk) !
You may skip this step if the **everyone** group has **read-only** permission but since AirDrop the **/Public/Drop Box** folder is mostly useless...
3) Show the Get Info inspector of your user Sites folder and reproduce step 2 then from the gear action sub-menu choose Apply to enclosed Items... :
VoilĂ  3 steps and the GUI only way...
I know this is an old post, but for anyone upgrading to Mountain Lion (10.8) and experiencing similar issues, adding FollowSymLinks to your {username}.conf file (in /etc/apache2/users/) did the trick for me. So the file looks like this:
<Directory "/Users/username/Sites/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
2 month old thread, but better late than never! On 10.6, I have my webserver documents folder set to:
owner:root
group:_www
permission:755
_www is the user that runs apache under Mac OS X. I then added an ACL to allow full permissions to the Administrators group. That way, I can still make any changes with my admin user without having to authenticate as root.
Also, when I want to allow the webserver to write to a folder, I can simply chmod to 775, leaving everyone other than root:_www with only read/execute permissions (excluding any ACLs that I have applied)
On my 10.6 system:
vhosts folder:
owner:root
group:wheel
permissions:755
vhost.conf files:
owner:root
group:wheel
permissions:644
The user owner for me is the admin user and the group is _www and works with permissions set to 775 for dir and for files 664
Catalina Update / Desktop Permissions
I come across this once a year on macOS. I usually use apache2 for hosting a
folder on my desktop.
If you are trying to give access to the desktop folder you need to follow this to allow httpd to have access to all folders: https://apple.stackexchange.com/a/373139/353465
Open up terminal first and then go to directory of web server
cd /Library/WebServer/Documents
and then type this and what you will do is you will give read and write permission
sudo chmod -R o+w /Library/WebServer/Documents
This will surely work!

Resources