DirectAdmin sunucularında root yetkisiyle yapılan kopyalama veya açma işlemleri sonrasında, kullanıcının dosyalarına web sunucusu süreçleri ulaşamadığında klasik 403, 500 ve File Manager hataları görülür. Bunun sebebi neredeyse her zaman aynıdır: dosya/dizin sahipliği root:root kalmış ve kullanıcı kendi ana dizinindeki içeriği okuyamıyordur. DirectAdmin tarafında bu durumu düzeltmek hem güvenlik hem de tutarlılık açısından kritiktir.
Doğru kullanıcı ve grup adı
DirectAdmin'de bir hesap için kullanıcı adı ile grup adı aynıdır. Yani aiortest kullanıcısının dosya sahipliği aiortest:aiortest olmalıdır. Eğer site PHP-FPM ile çalışıyorsa havuz, kullanıcı adına çalışır; Apache mod_php veya suPHP altında da kullanıcı sahipliği temel beklentidir.
1) Hızlı düzeltme: tek komut
Çoğu durumda kullanıcının evindeki tüm içerik için yapılacak iş şudur:
Code:
chown -R aiortest:aiortest /home/aiortest
2) Sadece public_html altına uygulamak
Yalnız belirli bir alan için düzeltme yapılacaksa:
Code:
chown -R aiortest:aiortest /home/aiortest/domains/aiorornek.com/public_html
3) İzinleri de standardize edin
Sahiplik düzeltildikten sonra çoğu zaman izinler de tutarsız kalır. DirectAdmin'in beklediği güvenli temel:
Code:
find /home/aiortest/domains/aiorornek.com/public_html -type d -exec chmod 755 {} \;
find /home/aiortest/domains/aiorornek.com/public_html -type f -exec chmod 644 {} \;
4) Suspicious bayrak ve immutable nitelikleri
Bazı durumlarda chattr +i ile değiştirilmez işaretli dosyalar görülür. lsattr ile kontrol edin, gerekirse chattr -i ile kaldırın. ImunifyAV/Imunify360 karantinası ile karıştırmayın; karantinaya alınmış bir dosya panelinden geri yüklenmelidir.
5) Açık dosyaları olan dizinler
Mail veya FTP süreçleri açıkken sahiplik değiştirmek genellikle güvenlidir; ancak rsync devam ediyorsa beklenmedik sonuçlar doğurabilir. Önce ps aux | grep aiortest ile aktif süreçleri kontrol edin.
6) Doğrulama
Code:
stat /home/aiortest/domains/aiorornek.com/public_html/index.php
namei -l /home/aiortest/domains/aiorornek.com/public_html
7) Önleyici yaklaşım
root altında tarball açtığınızda öncelikle su - aiortest ile kullanıcı oturumuna geçin veya tar --no-same-owner kullanın. Yedek geri yüklemelerinde DirectAdmin'in admin restore aracını tercih edin; bu araç sahiplikleri kullanıcıya göre kurar.
Bu kurallarla web sitesi 403 veya beyaz ekran hatası vermez; mail sunucusu Maildir dizinlerine erişebilir ve FTP/SFTP kullanıcıları kendi dosyalarını düzgün biçimde değiştirebilir.
When file operations on a DirectAdmin server are done as root — extracting a tarball, restoring a backup, copying files into a user's home — the resulting permissions often leave content owned by root:root. The user, the web server worker and PHP-FPM can no longer read the files, producing the classic 403, 500 and "empty" File Manager symptoms. Fixing it is straightforward but easy to get subtly wrong, so this is the reference workflow.
Correct user and group naming
On DirectAdmin the user and group share the same name. A user called aiortest should own files as aiortest:aiortest. If the site is served by PHP-FPM, the pool runs as that user; under suPHP or mod_ruid2 the same expectation holds. The ownership has to match for the web stack to function.
1) The quick fix
In most cases the right command is exactly:
Code:
chown -R aiortest:aiortest /home/aiortest
2) Scoping to a single document root
If you only want to touch one domain:
Code:
chown -R aiortest:aiortest /home/aiortest/domains/example.com/public_html
3) Normalise permissions too
Ownership alone is rarely enough — permissions are usually scrambled as well. DirectAdmin's expected baseline is:
Code:
find /home/aiortest/domains/example.com/public_html -type d -exec chmod 755 {} \;
find /home/aiortest/domains/example.com/public_html -type f -exec chmod 644 {} \;
4) Immutable flags
Occasionally files are flagged immutable with chattr +i. Check with lsattr and clear with chattr -i where appropriate. Do not confuse that with ImunifyAV/Imunify360 quarantine; quarantined files have to be restored from the security panel, not chowned back.
5) Files with active handles
Changing ownership while mail or FTP processes are running is normally safe, but interrupting an rsync mid-flight is not. Run ps aux | grep aiortest before sweeping the home directory and avoid touching a path that an ongoing job depends on.
6) Verification
Code:
stat /home/aiortest/domains/example.com/public_html/index.php
namei -l /home/aiortest/domains/example.com/public_html
7) Preventing the problem next time
When you need to extract content into a user's home as root, switch to the account first with su - aiortest or pass tar --no-same-owner. For backup restores, prefer DirectAdmin's admin restore tool — it sets ownership from the user record automatically. Following these rules removes the entire class of "site returns 403 but the file is right there" bugs.