مشكل در ايجاد فايل توسط Apachi و عدم اجازه به ويرايش آن توس
با سلام
مشكلي براي من ايجاد شده كه نتوانستم در انجمن مشابه آن را پيدا كنم ...
دسترسي بعضي از فايل ها بر روي هاست به نام Apachi ثبت شده . يعني owner آن را Apachi زده . حالا به هيچ صورت امكان ويرايش يا حذف اين فايل ها وجود ندارد .
دو نمونه از اينها را ديدم ... يكي مربوط مي شه به يكي كامپوننت كه آن را بعد از نصب مامبو نصب كردم و ديگري مربوط مي شود به بعضي از فايل هاي PDF كه در فولدر Stories , وجود دارد .
جالب اينكه فايل هاي درون فولدر Storeis از قسمت مديريت رسانه ها قابل ويرايش و حذف هستند اما از طريق كنترل پانل اجازه ويرايش ندارند ....
ممنون مي شوم علت اين امر را توضيح دهيد و البته راهكار حل اين مشكل و امكان ويرايش فايل ها
پاسخ : مشكل در ايجاد فايل توسط Apachi و عدم اجازه به ويرايش
ُسلام
برای حل این مشکل باید از پشتیبانی هاستینگ بخوایید که owner فایلها رو تغییر بده
راه حل :
کد:
< chown - change the owner of a file >
You can change the owner and group of a file or a directory with the chown command. Please, keep in mind you can do this only if you are the root user or the owner of the file.
Set the file's owner:
$ chown username somefile
After giving this command, the new owner of a file called somefile will be the user username. The file's group owner will not change. Instead of a user name, you can also give the user's numeric ID here if you want.
You can also set the file's group at the same time. If the user name is followed by a colon and a group name, the file's group will be changed as well.
$ chown username:usergroup somefile
After giving this command, somefile's new owner would be user username and the group usergroup.
You can set the owner of a directory exactly the same way you set the owner of a file:
$ chown username somedir
Note that after giving this command, only the owner of the directory will change. The owner of the files inside of the directory won't change.
In order to set the ownership of a directory and all the files in that directory, you'll need the -R option:
$ chown -R username somedir
Here, R stands for recursive because this command will recursively change the ownership of directories and their contents. After issuing this example command, the user username will be the owner of the directory somedir, as well as every file in that directory.
Tell what happens:
$ chown -v username somefile
changed ownership of 'somefile' to username
Here, v stands for verbose. If you use the -v option, chown will list what it did (or didn't do) to the file.
The verbose mode is especially useful if you change the ownership of several files at once. For example, this could happen when you do it recursively:
$ chown -Rv username somedir
changed ownership of 'somedir/' to username
changed ownership of 'somedir/boringfile' to username
changed ownership of 'somedir/somefile' to username
As you can see, chown nicely reports to you what it did to each file.
< chgrp - change the group ownership of a file >
In addition to chown, you can also use the chgrp command to change the group of a file or a directory. You must, again, be either the root user or the owner of the file in order to change the group ownership.
chgrp works pretty much the same way as chown does, except it changes the file's user group instead of the owner, of course.
$ chgrp usergroup somefile
After issuing this command, the file somefile will be owned by a user group usergroup. Although the file's group has changed to usergroup, the file's owner will still be the same.
The options of using chgrp are the same as using chown. So, for example, the -R and -v options will work with it just like they worked with chown:
$ chgrp -Rv usergroup somedir
changed group of 'somedir/' to usergroup
changed group of 'somedir/boringfile' to usergroup
changed group of 'somedir/somefile' to usergroup
chown nicely reports to you what it did to each file.
یا علی
پاسخ : مشكل در ايجاد فايل توسط Apachi و عدم اجازه به ويرايش
ممنون ولي امكانش هست كه علت اين اتفاق را توضيح دهيد ؟ آيا اشكال از طرف من بوده است ؟
پاسخ : مشكل در ايجاد فايل توسط Apachi و عدم اجازه به ويرايش
پاسخ : مشكل در ايجاد فايل توسط Apachi و عدم اجازه به ويرايش
سلام عليكم آقاي فيرزمندان
خير در جواب امكان توضيح هست يا در جواب اشكال از طرف من .... ؟!
پاسخ : مشكل در ايجاد فايل توسط Apachi و عدم اجازه به ويرايش
علتش اینکه که یه یوزر واسه اکانت شما روی سرور ساخته میشه مثلا به اسم USER1 با UID 501 و از طرفی httpd مثلا با یوزر آپاچی با 80 UID ران میشه.
خب مثلما وقتی شما از طریق پنل یا ftp یه فایلی رو بوجود میاری یا آپلود میکنی صاحب اون فایل USER1(501) میشه و وقتی با پی اچ پی یه فایل تولید میشه یا آپلود میشه صاحب اون فایل (80) APACHE میشه.
برای حذفش میتونید از کامپوننت های مدیریت فایل استفاده کنید. چون این کامپوننت ها هم از طریق مامبو (پی اچ پی) نصب میشه صاحبش آپاچیه و دسترسی به این فایلا داره! با چند خط کد هم میتونی این مشکل رو حل کنی که راه اولی ساده تره!
پاسخ : مشكل در ايجاد فايل توسط Apachi و عدم اجازه به ويرايش
بسيار ممنون
به قول يكي از دوستان :
[size=12pt]روشنم كردي [/size]
:D :D :D