desde php creo 3 carpetas
mkdir("/var/www/html/php/pruevas/imatgen/productos/$categoria_nombre",0755);
mkdir("/var/www/html/php/pruevas/imatgen/productos/$categoria_nombre/grande",0755);
mkdir("/var/www/html/php/pruevas/imatgen/productos/$categoria_nombre/pequeña",0755);
las 3 carpetas tanto el propietario como grupo son apache
si no pongo la carpeta productos en 777 me deja escribir pero es muy poco seguro
lo tengo en 755
tenia la carpeta en 777 cree dos capetas con sus subcarpetas canvie el permiso en 755 no puedo borrar
la carpeta que se crea cada vez que creo una categoria y grande y pequeño tampoco
el cortafuegos de linux el SELinux me sale el siguiente error
desactive el cortafuegos por completo y tampoco funcionaba es algo de apache
Código SELinux:
Ver originalSELinux is preventing /usr/sbin/httpd from write access on the directory /var/www/html/php/pruebas/imatgen/productos.
***** Plugin httpd_write_content (92.2 confidence) suggests ****************
If you want to allow httpd to have write access on the productes directory
Then you need to change the label on '/var/www/html/php/pruebas/imatgen/productos'
Do
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/php/pruebas/imatgen/productos'
# restorecon -v '/var/www/html/php/pruebas/imatgen/productos'
***** Plugin catchall_boolean (7.83 confidence) suggests *******************
If you want to unify HTTPD handling of all content files.
Then you must tell SELinux about this by enabling the 'httpd_unified' boolean.
Do
setsebool -P httpd_unified 1
***** Plugin catchall (1.41 confidence) suggests ***************************
If you believe that httpd should be allowed write access on the productes directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep httpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp
Additional Information:
Contexto Fuente system_u:system_r:httpd_t:s0
Contexto Destino system_u:object_r:httpd_sys_content_t:s0
Objetos Destino /var/www/html/php/pruebas/imatgen/productos [
dir ]
Fuente httpd
Dirección de Fuente /usr/sbin/httpd
Puerto <Desconocido>
Nombre de Equipo fedora14
Paquetes RPM Fuentes httpd-2.2.17-1.fc14
Paquetes RPM Destinos
RPM de Políticas selinux-policy-3.9.7-29.fc14
SELinux Activado True
Tipo de Política targeted
Modo Obediente Enforcing
Nombre de Equipo fedora14
Plataforma Linux fedora14 2.6.35.10-74.fc14.x86_64 #1 SMP Thu
Dec 23 16:04:50 UTC 2010 x86_64 x86_64
Cantidad de Alertas 9
Visto por Primera Vez jue 10 feb 2011 08:08:27 CET
Visto por Última Vez jue 10 feb 2011 08:12:49 CET
ID Local d630714a-5441-4163-9a8c-1ea3cc3af686
Mensajes de Auditoría Crudos
type=AVC msg=audit(1297321969.989:39892): avc: denied { write } for pid=2052 comm="httpd" name="productes" dev=dm-4 ino=3276913 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=SYSCALL msg=audit(1297321969.989:39892): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=7ff4d2cb4da8 a1=1ed a2=8 a3=1 items=0 ppid=2004 pid=2052 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm=httpd exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null)
Hash: httpd,httpd_t,httpd_sys_content_t,dir,write
audit2allow
#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_unified'
allow httpd_t httpd_sys_content_t:dir write;
audit2allow -R
#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_unified'
allow httpd_t httpd_sys_content_t:dir write;
he puesto todas estas variables en 1 tampoco me deja borrar la carpetas i subcarpetas
Código parametros de apache:
Ver originalgetsebool -a | grep httpd;
que politica de estas tengo que modificar setsebool -P parametro 1;
allow_httpd_anon_write --> on
allow_httpd_mod_auth_ntlm_winbind --> on
allow_httpd_mod_auth_pam --> on
allow_httpd_sys_script_anon_write --> on
httpd_builtin_scripting --> on
httpd_can_check_spam --> on
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> on
httpd_can_network_connect_db --> on
httpd_can_network_memcache --> on
httpd_can_network_relay --> on
httpd_can_sendmail --> on
httpd_dbus_avahi --> on
httpd_enable_cgi --> on
httpd_enable_ftp_server --> on
httpd_enable_homedirs --> on
httpd_execmem --> on
httpd_read_user_content --> on
httpd_setrlimit --> on
httpd_ssi_exec --> on
httpd_tmp_exec --> on
httpd_tty_comm --> on
httpd_unified --> on
httpd_use_cifs --> on
httpd_use_gpg --> on
httpd_use_nfs --> on