How do I create a file in the shell under root/var?

Asked by JD

I'm trying to activate apache2 and one of the steps on e-how is to "sudo mv basic.html /var/www/basic.html". The response I receive is that basic. html is not found. How do I create this in the var/www file?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu kdebase Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Greg (rylar22) said :
#1

You don't have to create the file because apache includes a default file that says "It works!"

But if you wanted to create a test file, you can do it like this: touch /var/www/basic.html

If you wanted something in that file: nano /var/www/basic.html
(control x , then y when done to save)

Revision history for this message
JD (jd98softex) said :
#2

Greg,
Thank you for your answer. My problem is I am relatively new to linux and when I tried to enter what the instructions said I received an answer that was "No such file". I am taking this from memory so I probably have forgotten some of the wording but it was referring to the Basic.html reference. I don't know what I did wrong. I was using directions from ehow. If there is a better site or one that spells it out for someone who is not well versed in linux please let me know.
Thank you,
JD

Revision history for this message
hadi (modarres-zadeh-gmail) said :
#3

sudo mv basic.html /var/www/

Revision history for this message
JD (jd98softex) said :
#4

Hadi,
I typed in what your answer said and it gave me the same response as Greg's answer.
Thanks anyway
JD

Revision history for this message
Qoquaq (qoquaq) said :
#5

jd,

1) verify apache is running
System > Administration > Services
also type http://localhost/ in the usr of your browser. It should return "It Works!"

2) make sure that when you try to access the file, you are aware of case sensitivity
http://localhost/basic.html

3) make sure the file is readable
sudo chmod 755 basic.html

4) make sure the file is in the correct directory. it should be in the same directory as a file called index.html

Once you get an understanding for starting and stopping apache and placing files in /var/www you will be well on your way.

Can you help with this problem?

Provide an answer of your own, or ask JD for more information if necessary.

To post a message you must log in.