{"id":1438,"date":"2018-09-08T09:49:00","date_gmt":"2018-09-08T14:49:00","guid":{"rendered":""},"modified":"2018-10-16T09:57:41","modified_gmt":"2018-10-16T14:57:41","slug":"establecer-permisos-a-la-carpeta-htdocs-en-xampp-linux","status":"publish","type":"post","link":"https:\/\/linuxitos.com\/main\/establecer-permisos-a-la-carpeta-htdocs-en-xampp-linux\/","title":{"rendered":"Establecer permisos a la carpeta HTDOCS en XAMPP Linux"},"content":{"rendered":"<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2018\/09\/xampp_error.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" data-original-height=\"469\" data-original-width=\"1473\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2018\/09\/xampp_error.png\" \/><\/a><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Al instalar XAMPP en Fedora, viene con permisos preestablecidos, dichos permisos son para el correcto funcionamiento, y s\u00f3lo se asigna el permiso que corresponde, ya que los demonios lanzados para el servidor apache, requiere de acceso a algunas funciones del SO, por lo tanto no es recomendable asignarle permisos m\u00e1s de los que necesita.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">XAMPP:&nbsp;<a href=\"https:\/\/www.apachefriends.org\/index.html\">https:\/\/www.apachefriends.org\/index.html<\/a><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Sin embargo, si en el usuario en el que se est\u00e9 modificando un desarrollo web, no tiene los permisos correctos, no es posible guardar los cambios, crear directorios, etc., en pocas palabras, es necesario asignarle ciertos permisos al directorio <b>htdocs<\/b>.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">El directorio <b>htdocs<\/b> almacena los desarrollos que creados por uno mismo, y es en esta carpeta donde se deben colocar dichos archivos.<\/span><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">En mi caso particular, me gusta crear un enlace de la carpeta <b>htdocs<\/b>, que se instala en <b>\/opt\/lampp\/htdocs\/<\/b> y en mi carpeta personal con el nombre de <b>www<\/b>&nbsp;<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Con el siguiente comando se realiza lo siguiente:<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: #262626; font-family: &quot;courier 10 pitch&quot;, courier, monospace; font-size: 1.5rem; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; word-wrap: break-word;\"><span style=\"border: 0px; color: white; font-family: &quot;menlo&quot; , &quot;monaco&quot; , monospace; font-size: 15px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">sudo ln -s \/opt\/lampp\/htdocs \/home\/linuxitos\/www<\/span><\/pre>\n<div><span style=\"border: 0px; color: white; font-family: &quot;menlo&quot; , &quot;monaco&quot; , monospace; font-size: 15px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Listo, ahora ya se tiene un enlace al directorio htdocs, \u00e9sto facilita porque no es necesario ir \/opt\/lamp\/htdocs, para realizar alguna modificaci\u00f3n.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">1.- Es recomendable asignar los permisos requeridos por cada proyecto desarrollado, y no asignar los permisos directamente sobre todo el directorio de www (recordar que www es un enlace a htdocs).<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">2.- Los permisos deben asignarse por defecto al grupo y al usuario, para que sea posible crear directorios desde el desarrollo, en caso de ser necesario, o si se requiere subir archivos.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Por default, el grupo y usuario de xampp al instalarlo es daemon, por lo tanto, se asignar\u00eda de la siguiente manera:<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Entrar a www<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: #262626; font-family: &quot;courier 10 pitch&quot;, courier, monospace; font-size: 1.5rem; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; word-wrap: break-word;\"><span style=\"border: 0px; color: white; font-family: &quot;menlo&quot; , &quot;monaco&quot; , monospace; font-size: 15px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">cd ~\/www<\/span><\/pre>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Asignar el grupo y usuario que puedan modificar el directorio del proyecto.<\/span><\/div>\n<div><\/p>\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; word-wrap: break-word;\"><span style=\"border: 0px; font-size: 15px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\"><span style=\"color: white; font-family: &quot;menlo&quot; , &quot;monaco&quot; , monospace;\">sudo chown -R daemon:linuxitos developer_dir<\/span><\/span><\/pre>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Asignar los permisos al directorio del desarrollo:<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; word-wrap: break-word;\"><span style=\"color: white; font-family: &quot;menlo&quot; , &quot;monaco&quot; , monospace;\"><span style=\"font-size: 15px;\">sudo chmod -R 775 developer_dir<\/span><\/span><\/pre>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Con esos permisos se podr\u00e1 modificar los archivos, crear directorios, y sub directorios que sean necesarios.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">De \u00e9ste modo, es posible editar los archivos desde alg\u00fan editor de texto el contenido del desarrollo, sin ning\u00fan problema.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">En caso de que no se le asignen \u00e9stos permisos, u alg\u00fan otro permiso, al querer guardar los cambios realizados sobre alg\u00fan archivo del proyecto, siempre pedir\u00e1 la contrase\u00f1a del usuario para guardar los cambios (ver imagen de abajo):<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2018\/09\/Screenshot-2Bfrom-2B2018-09-07-2B11-40-30.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" data-original-height=\"900\" data-original-width=\"1600\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2018\/09\/Screenshot-2Bfrom-2B2018-09-07-2B11-40-30.png\" \/><\/a><\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<blockquote style=\"text-align: justify;\"><p><span style=\"font-size: large;\">Alguno podr\u00e1n decir que es m\u00e1s f\u00e1cil asignar permisos 777 y ya, pero las buenas pr\u00e1cticas siempre son bienvenidas.<\/span><\/p><\/blockquote>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Adem\u00e1s, no quiero imaginar lo que pasar\u00eda si al servidor en producci\u00f3n se suben archivos con permisos de ejecuci\u00f3n o cosas por el estilo.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Cualquier comentario o correcci\u00f3n son bienvenidos, como siempre he dicho, \u00aben gustos se rompen g\u00e9neros\u00bb.<\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\"><br \/><\/span><\/div>\n<div style=\"text-align: justify;\"><span style=\"font-size: large;\">Algunas fuentes revisadas:<\/span><\/div>\n<div style=\"text-align: justify;\"><a href=\"https:\/\/askubuntu.com\/questions\/64095\/change-xampps-htdocs-web-root-folder-to-another-one\">https:\/\/askubuntu.com\/questions\/64095\/change-xampps-htdocs-web-root-folder-to-another-one<\/a><\/div>\n<div style=\"text-align: justify;\"><a href=\"https:\/\/stackoverflow.com\/questions\/38593262\/default-password-for-apache-xampp-user-daemon\">https:\/\/stackoverflow.com\/questions\/38593262\/default-password-for-apache-xampp-user-daemon<\/a><\/div>\n<div style=\"text-align: justify;\"><a href=\"https:\/\/stackoverflow.com\/questions\/9349469\/changing-php-write-permissions-in-xampp-on-windows-7#9349612\">https:\/\/stackoverflow.com\/questions\/9349469\/changing-php-write-permissions-in-xampp-on-windows-7#9349612<\/a><\/div>\n<div style=\"text-align: justify;\"><a href=\"https:\/\/www.computerhope.com\/unix\/uchown.htm\">https:\/\/www.computerhope.com\/unix\/uchown.htm<\/a><\/div>\n<div style=\"text-align: justify;\"><a href=\"https:\/\/stackoverflow.com\/questions\/9349469\/changing-php-write-permissions-in-xampp-on-windows-7\">https:\/\/stackoverflow.com\/questions\/9349469\/changing-php-write-permissions-in-xampp-on-windows-7<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Al instalar XAMPP en Fedora, viene con permisos preestablecidos, dichos permisos son para el correcto funcionamiento, y s\u00f3lo se asigna el permiso que corresponde, ya que los demonios lanzados para el servidor apache, requiere de acceso a algunas funciones del SO, por lo tanto no es recomendable asignarle permisos m\u00e1s de los que necesita. XAMPP:&nbsp;https:\/\/www.apachefriends.org\/index.html [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":747,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7,5,4,8,9,10],"tags":[],"class_list":["post-1438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-crear-carpetas","category-fedora","category-htdocs","category-linux","category-permisos-para-modificar-y-editar-archivos","category-set-permission-xampp-htdocs","category-xampp"],"_links":{"self":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/comments?post=1438"}],"version-history":[{"count":1,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1438\/revisions"}],"predecessor-version":[{"id":1877,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1438\/revisions\/1877"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media\/747"}],"wp:attachment":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media?parent=1438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/categories?post=1438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/tags?post=1438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}