LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help to create folder in htdocs directory (https://www.linuxquestions.org/questions/linux-newbie-8/help-to-create-folder-in-htdocs-directory-4175665591/)

ozstar 12-07-2019 11:45 PM

Help to create folder in htdocs directory
 
Newby here :-)

See in GUI the htdocs directory and want to create folder there for my web files.

Tried to right click and option was grayed out. Went to Terminal and got # privilege but still can't create.

Saw somewhere that this command would do it, but alas. no.

Code:

sudo chmod 755 -R htdocs
Quote:

root@david-HP-Compaq-6000-Pro-MT-PC:~# cd /opt/lampp
root@david-HP-Compaq-6000-Pro-MT-PC:/opt/lampp# sudo chmod 755 -R htdocs
root@david-HP-Compaq-6000-Pro-MT-PC:/opt/lampp#
Any help please?

astrogeek 12-08-2019 12:30 AM

You will need to learn how basic Unix/Linux file ownership and permission work.

For others to be able to help you will need to tell us what the current ownership and permissions of the directory currently are, what owner and permissions you want to assign, and what user is making the change.

I see that you are working as root (root@david-HP-Compaq...) so it is not necessary for you to use sudo (I would also recommend that you learn what sudo is for and how it works on your distro).

You have also changed into the /opt/lampp directory, so we will assume that is where the htdocs directory of interest is located. So, from that location please post the output of ls -l (that is a "dash-ell" option). That will show us the current ownership and permissions of the htdocs directory, if it is actually there.

You show us the command, (sudo) chmod 755 -R htdocs, and it apparently produces no error, so it most likely worked. What were you expecting the result to be, and why do you say "alas, no"?

Turbocapitalist 12-08-2019 02:16 AM

Also, since you are digging around in /opt/ it looks like you might have accidentally installed XAMPP instead of normal packages. So I ask, which distro are you using? I ask because once you uninstall XAMPP, the right packages can be added instead from the official repositories by a click or two, then the system will keep them automatically updated for you and it'll be easier to work with the files and directories being in the right places.

yancek 12-08-2019 07:22 AM

If you run a chmod command and it goes back to the prompt, that generally means success so post the output of the ls -l command suggested. It's always a good idea to indicate which version of Linux you are using as there are well over 500 different one.

Quote:

Tried to right click and option was grayed out. Went to Terminal and got # privilege but still can't create.
I'm not sure if I'm reading this right but changing permissions as you did will not give you root privileges in a GUI.

ozstar 12-10-2019 03:25 PM

Thank you guys for the help and advice it is greatly appreciated.

I will read up and try and maintain what I read :-).

I was eventually able to get the permissions correct for creating in htdocs where I have my site files, so that is done however so much more to do.

No doubt will be back begging for help again.

John VV 12-10-2019 08:47 PM

Quote:

I was eventually able to get the permissions correct for creating in htdocs where I have my site files, so that is done however so much more to do.
How ?
i hope you DID NOT DO THIS " chmod 777 "
"htdocs " is owned by ( i am guessing ) Apache ( or XAMPP) and the user apache/XAMPP is in the root group

cd to the location and use " mkdir" as root to create a folder
THEN use "chown"( as root) on that folder to make your normal user are owner
then you can add your files

ozstar 12-11-2019 12:37 AM

Yes Xampp. No didn't do the 777. I understand the permissions as I am webmaster for many sites on a shared server, however, everything is done via WHM or Cpanel, so it is the actual Linux coding and the GUI setup that I have to get around.

Thanks again


All times are GMT -5. The time now is 02:09 AM.