working on lamp server in ubuntu

465 views Asked by At

i m working on ubuntu and just installed lamp.As i m new to linux i m not sure how to create a directory or file under /var/www of lamp server to start working on my website project

2

There are 2 answers

1
JoeSlav On

Under *nix you can create a directory using mkdir newdirname and you can create a new and empty file, using touch newfilename. Those are commands you need to execute from a shell/terminal. In order to get to /var/www, you will need to cd /var/www.

If you are new to Linux I suggest reading any guide on basic like this or this.

1
RDL On

Chances are you do not have sufficient privileges as your normal user to add files or create directories. You can either change the ownership of the /var/www directory (and everything within) or you can sudo each one you want to add.

From the prompt: chown [your_user_name].users -R /var/www

Then you can mkdir [directory name] to make a directory or touch [filename] to create a file.

If you do not change the permissions of the /var/www you may need to put sudo in front of each of the above commands (will be prompted for password)