Copy Files

I'm learning linux/Pi stuff and I'm having issues making someing to work. I installed apache2 to my device. It says that if I want to change the index.html file I can find it in the /var/www/html/ directory... it does exist and there is an index file there. I had some html files I had used in the past... moved them to my desktop in a temp folder... then I simply wanted to copy the temp folder to the /var/www/html/ folder... the OS gave me grief saying there were permission issues. I corrected that... and it still wouldn't move them...

The last time I tried I used this command sudo cp -r /home/Desktop/Temp/public/* /var/www/hetm/ I get a "no such file or directory" error

Sup with this ??

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE
Loading thread data ...

Re: Re: Copy Files By: IB JOE to Jan Panteltje on Sat Jul 14 2018 11:47 am

IJ> the index file was found in the /var/www/html/ directory. If you type IJ>

formatting link
you'll see the html file that came with apache telling me IJ> to look in that directory. I simply wanted to replace that with one I have IJ> used in the past.

I think you'll need to be root to put files in that directory.

That's quite an informative index page you have now.. you might want to save that somewhere for future reference and then put your own index.html and whatever else you need in there.

Ttyl :-), Al

... It doesn't work, but it looks pretty.

Reply to
Alan Ianson

Sorry about this ... I was copying mail servers around and lost your original message to me...

I did as you said to, when I first did it... the /var/www/html/ directory was exactly that... I just typed it wrong while sending the message ..

I also do understand that case counts in linux... the way I wrote it reflects the command I gave you.

I have a guy I can call localy ,.... I may just make the call soon.

:(

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

JP> >typo, try /var/www/html JP> JP> JP> Or just /var/www/ ??? JP> That is where the .html files are in my system. JP>

the index file was found in the /var/www/html/ directory. If you type

formatting link
you'll see the html file that came with apache telling me to look in that directory. I simply wanted to replace that with one I have used in the past.

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

On a sunny day (Sat, 14 Jul 2018 09:44:28 +1200) it happened snipped-for-privacy@f200.n42.z1.binkp.net (IB JOE) wrote in :

typo, try /var/www/html

Also in Unix / Linux upper and lower case counts, so Temp versus temp

Reply to
Jan Panteltje

Or just /var/www/ ??? That is where the .html files are in my system.

Reply to
Jan Panteltje

On a sunny day (Sat, 14 Jul 2018 11:47:29 +1200) it happened snipped-for-privacy@f200.n42.z1.binkp.net (IB JOE) wrote in :

Yes, that server works.

... sudo cp -r /home/Desktop/Temp/public/* /var/www/html/ ....

So destination directory is OK? sudo ls /var/www/html/

how about the source directory? sudo ls -rlt /home/Desktop/Temp/public/

It must be one of the 2 for that error message.

And why not just be root and forget sudo sudo su -

try: echo "Hello" > /var/www/html/test cat /var/www/html/test should show 'hello'

Just run some simple checks.

Reply to
Jan Panteltje

On 7/13/2018 5:44 PM, IB JOE wrote: [snip]

/home/Desktop/Temp/public/*

Maybe, if "Desktop" is a subdirectory of your home directory (rather than a subdirectory of "home"), it should be:

/home/[username]/Desktop/Temp/public/*

--
This email has been checked for viruses by Avast antivirus software. 
https://www.avast.com/antivirus
Reply to
neil

AI> IJ> the index file was found in the /var/www/html/ directory. If you type AI> IJ>

formatting link
you'll see the html file that came with apache tellin AI> IJ> to look in that directory. I simply wanted to replace that with one I AI> IJ> used in the past. AI> AI> I think you'll need to be root to put files in that directory. AI> AI> That's quite an informative index page you have now.. you might want to AI> save that somewhere for future reference and then put your own AI> index.html and whatever else you need in there. AI> AI> Ttyl :-),

Okay, I'm sorry I didn't make that more clear.... I am trying to replace that exact file with files of my own and it was giving me grief.

I'll look up this root thingy...

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

ls -la /var/www will reveal the permissions on that /var/www/html directory

To sort mine out I changed its ownership to my account

sudo chown -R /var/www myname

and so on.

Then cp -R will work

--
The New Left are the people they warned you about.
Reply to
The Natural Philosopher

JP> sudo cp -r /home/Desktop/Temp/public/* /var/www/html/ JP> .... JP> JP> JP> So destination directory is OK? JP> sudo ls /var/www/html/ typed this command and I get....

total 12

-rw-r--r-- 1 root root 10701 Jan 11 2018 index.html

JP> JP> how about the source directory? JP> sudo ls -rlt /home/Desktop/Temp/public/ ls:annot access /home/Desktop/Temp/public: No such file or directory This what I get when I type the command you gave me... I'm going to have to break this into 2 messages... Something is messed up with editor....

if I goto /home... do this by typing cd /home, my prompt changes pi@bbs:/home $

Then if I type dir it reports back pi.... if I type cd pi my prompt changes to pi@bbs:~$

Once I type cd pi, I then type cd Desktop/Temp/public ... my prompt changes to pi@bbs:~/Desktop/Temp/public $

if I then type dir I can see all the files I think I need to change part of my copy command from /home/Desktop/Temp/public to ~/Desktop/Temp/public/

There... I'll respond back to you on the second part of your message

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

JP> how about the source directory? JP> sudo ls -rlt /home/Desktop/Temp/public/ JP> I changed this sudo command from /home/Desk..... to ~/Desktop/... and I get a listing of the files

Ergo....

I'll try the command less the /home/.... and add the ~ and I might be good to go...

Thanx....

I'm still going to respond back to a 3rd message yet...

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

On 07/14/18, Jan Panteltje said the following... JP> And why not just be root and forget sudo JP> sudo su - JP> JP> try: JP> echo "Hello" > /var/www/html/test JP> cat /var/www/html/test JP> should show 'hello' JP> JP> Just run some simple checks. JP> Did this and it worked...

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

On 07/14/18, Jan Panteltje said the following... JP> JP> ... JP> sudo cp -r /home/Desktop/Temp/public/* /var/www/html/ JP> .... JP>

I tried this command in root and I tried it with /home/Desk... as well as ~/home/... and it doesn't copy files over.

JP> JP> So destination directory is OK? JP> sudo ls /var/www/html/ JP> JP> how about the source directory? JP> sudo ls -rlt /home/Desktop/Temp/public/ JP> JP> It must be one of the 2 for that error message. JP> JP> And why not just be root and forget sudo JP> sudo su - JP> JP> try: JP> echo "Hello" > /var/www/html/test JP> cat /var/www/html/test JP> should show 'hello' JP> JP> Just run some simple checks. JP>

And I did this and I was able to copy to test and other things as well....

cannot seem to copy the directory over to populate the html directory with the html files I want...

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

On 07/14/18, neil said the following... ne> ne> /home/Desktop/Temp/public/* ne> ne> Maybe, if "Desktop" is a subdirectory of your home directory (rather ne> than a subdirectory of "home"), it should be: ne> ne> /home/[username]/Desktop/Temp/public/* ne> ne> SOB, it worked...

I have learned something today....

Thank you....

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

TN> ls -la /var/www will reveal the permissions on that /var/www/html TN> directory TN> TN> To sort mine out I changed its ownership to my account TN> TN> sudo chown -R /var/www myname TN> TN> and so on.

I got it to work... based on y'alls responces...

Thanx ...Now I need to locate an html editor for pi...

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

On 07/15/18, Martin Gregorie said the following... MG> You just add something like this access control structure: MG> MG> MG> AllowOverride All MG> Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec MG> ExecCGI Order allow,deny MG> Allow from all MG> Require method GET POST OPTIONS MG>

I have a buddy locally that can help me do this.I ended up doing what I needed to do... but my god there were a lot of steps...

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

On 07/15/18, Martin Gregorie said the following... MG> On Sun, 15 Jul 2018 12:18:48 +1200, IB JOE wrote: MG> MG> > ... but my god there were a lot of steps... MG> > MG> If its any consolation, Apache is one of the most complex programs to MG> configure that you're likely to meet - not surprising when you see the MG> range of stuff it can handle. MG>

Most of my problem is because of my lack of understanding of linux. Anyway, I was able to patch together a solution...

:) Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

MG> Could I suggest that a copy of "Linux in a Nutshell" might be a good MG> investment? MG> MG> It assumes knowledge of at least one other OS and consequently is quite MG> terse and is intended as a reference book for people unfamiliar with MG> Linux/UNIX. I, at least, found it useful for initial guidance until I MG> discovered the three built-in information sources in Linux: MG>

I may go past Pi box some day. Back in the day my system use to just boot up to a dos prompt... I was forced over time to lean on windows. Once I get over a few of the big things with Linux I should be "okay"...

It took me some time, but I think I've settled, I'll run mystic BBS on some form of Linux.

Thanx

IB JOE AKA Joe Schweier SysOp of Joe's Computer & BBS Telnet: joesbbs.com

Reply to
IB JOE

If you've not set up Apache before, its well worth reading its tutorials, etc. and downloading a copy for instant reference if there isn't already a copy in /usr/share/httpd/manual of similar place - thats where installing the Fedora httpd* package set puts it.

For instance, you may want to leave little more than the single main index page in /var/www/html and setting that up to point at one or more user directories in /home, each containing a section of your web site: its very easy to tell Apache to access these user published HTML page structures. The configuration to do that works like this: each HTML page structure goes in /home/user/public_html where its safe from being clobbered by system upgrades, etc.

You just add something like this access control structure:

AllowOverride All Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI Order allow,deny Allow from all Require method GET POST OPTIONS

to /etc/httpd/conf/httpd.conf gives Apache access to these HTML page collections under all users that have them or, better, put the access control structure in /etc/httpd/conf.d/userdir.conf and tell the main configuration file to:

IncludeOptional cond.d/*.conf

You can overide this default setup with more restrictive ... structures if you also have more private sets of pages, e.g. I keep sensitive pages in an encrypted partition which has a more restricted set of Apache access conditions.

...and don't forget to keep copies of the Apache configuration files somewhere safe that gets backed up along with your other self-created stuff!

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.