Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: HANNES1985 on November 19, 2009, 05:12:50 pm

Title: How to upload webpage contend???
Post by: HANNES1985 on November 19, 2009, 05:12:50 pm
Hi this might sound like a stupid Q but I'm struggling for quite a wile now to upload a web page to Apache on my ebox server ( now ver 1.2) I used core ftp but looking to the documentation it seems that you would not be able to upload via ftp ,ssh, or any of the protocols core ftp provides could anyone point me in the right direction please I can access it and even via my dns IT WORKS comes up when entering my URL so all is fine just need to upload contend now ??? ???
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 19, 2009, 05:47:23 pm
You can upload the content to the home of the admin user by scp, and then you can move it to the proper directory by ssh.
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 20, 2009, 03:11:28 pm
Okay so what I understand is I enable file server on ebox administration page for me (the administrator) and upload everything in there (This part is already done )


Now login on to page via ssl and transfer from admin user to www data file? How do I go about doing this???
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 20, 2009, 04:49:52 pm
Uploading via file sharing (samba) as you have done is also valid, I told you to do it using "scp", but no problem, it's ok. Then you can use ssh, not any ssl web page. Using ssh you get a shell where you can execute any command like "mv" to move the files.
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 21, 2009, 11:09:41 pm
not any ssl web page. Using ssh you get a shell where you can execute any command like "mv" to move the files.

Any specific programs I can use in this case? Sorry but Im new to the uploading process In ebox!
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 21, 2009, 11:50:28 pm
ssh is a console program itself, if you want a windows client you have putty.

You can get a shell from any machine in the internal network with "ssh ebox-ip-address".
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 12:01:39 am
Can you explain this in a bit more detail for me please

Thanx for your help thus far!!
Title: Re: How to upload webpage contend???
Post by: isaac on November 22, 2009, 12:49:09 am
Download 'putty' from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) and use it to SSH into your ebox machine.

Once you have done that, you have a shell where you can write commands to move the files you have uploaded to the appropriate place. You can read about moving files here:
http://www.ee.surrey.ac.uk/Teaching/Unix/unix2.html (http://www.ee.surrey.ac.uk/Teaching/Unix/unix2.html)

The directory used by the webserver is /var/www, so you'll need to move the stuff there.

Cheers!
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 01:14:41 am
Thanx for you help just one Q though id like to know what do you type before the /var/WWW to get into this directory cos it tells me no such file or directory when I type this into putty after the login process
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 22, 2009, 01:43:32 am
The directory is /var/www, in lower case.
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 02:00:05 am
Thank you I got that part right but now it tells me I cant move it because access denied

I used mv home/hannes/CSIWISP.html -t  /var/www

mv: cannot move `/home/hannes/CSIWISP.html' to `/var/www/CSIWISP.html':
Permission denied

What can I do now Sorry to bug you like this but this is the only way I would be able to learn how to do it myself!!
Title: Re: How to upload webpage contend???
Post by: isaac on November 22, 2009, 02:05:06 am
Thank you I got that part right but now it tells me I cant move it because access denied

I used mv home/hannes/CSIWISP.html -t  /var/www

mv: cannot move `/home/hannes/CSIWISP.html' to `/var/www/CSIWISP.html':
Permission denied

What can I do now Sorry to bug you like this but this is the only way I would be able to learn how to do it myself!!

You have to run the command as administrator, for that, just write 'sudo' before the command.

You can move the file using:
Code: [Select]
sudo mv /home/hannes/CSIWISP.html /var/www
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 02:14:00 am
Thanx I got it eventually thank you all for your help I appreciate it !!! :)
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 02:18:57 am
Okay all is uploaded but still cannot see the contend on the web page I did restart the server service an ideas what could be wrong?

Sorry I guess I have to upload an .htm file to view it by just typing the www.domain.com in !!

will fix this later thank you guys for all your help Im done for now have to go sleep now!!
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 22, 2009, 02:28:55 am
What is the URL that you are trying to access?
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 02:55:18 am
I need to type in www.mydomain.com/CSIWISP.html to view my contend I ll go Change the contend to CSIWISP.htm and see if I can access the contend by just typing in the www.mydomain.com

Well That did not work either any ideas??

It just keeps poping it works when I go to www.mydomain.com
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 22, 2009, 04:13:18 am
Try to name the page as index.html instead of CSIWISP.html
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 08:29:57 am
Still does not work not index.html or index.htm any ideas??
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 22, 2009, 02:43:17 pm
So you are still getting the "It works" page after replacing the old index.html with a copy of your page or a link to it?

If you execute ln -sf CSIWISP.html index.html in /var/www it should work.
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 05:59:33 pm
The www file was empty seems that there is anouther file or conf I need to change in order to view my webpage by just typing in www.mydomain.com!!

I am looking for any conf that has to do with redirections if /var/www is empty !!

Quote
So you are still getting the "It works" page after replacing the old index.html with a copy of your page or a link to it?

If you execute ln -sf CSIWISP.html index.html in /var/www it should work.

Could you give me a bit more detail on how to do this Im new to the putty thing and Ive checked could not find any directory with -sf

Please I`d really like to get this right coz then Ive configured all the packages I need in ebox!!

next then is getting a 4tb external hard drive and redirect www-data to it so I can change the contend of the website without using putty coz its a looooong process!!

One Q though is it possible to change the page you get from the server when you have a timeout ??
Title: Re: How to upload webpage contend???
Post by: J. A. Calvo on November 22, 2009, 06:47:51 pm
-sf are arguments of the ln command that it's used to make links to files. You have to execute that command inside the /var/www directory (use cd command for that).
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 22, 2009, 07:06:13 pm
Thank you just so I dont bugger anything up the location of my website is /var/www/index.htm

how do you prepose I go about linking the file to www.mydomain.com??
Title: Re: How to upload webpage contend???
Post by: isaac on November 23, 2009, 12:47:36 am
Run:
Code: [Select]
cd /var/www
sudo ln -sf CSIWISP.html index.html

Cheers!
Title: Re: How to upload webpage contend???
Post by: dragonslayr on November 23, 2009, 06:33:50 am
Note: There is another way to put the files where you want them, though some do not like to give ssh root access..  It's called winscp

If you do wish to do it with winscp,
Make a password for root
passwd root
Note: Make it a strong password.

Then download winscp and just copy the files with a gui right to where you want them..
You can also disable password logon and use a key for authorization. See here. http://winscp.net/eng/docs/faq_su

Course, I do it with a rsync nightly upload so I don't even have to mess with it. Just edit the files and they will be uploaded later automagically.. (one of the benefits to running Linux on the desktop as well)  But there is rsync for windows..   :)
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on November 23, 2009, 07:28:53 pm
Quote
cd /var/www
sudo ln -sf CSIWISP.html index.html

This code worked perfectly Thank you very much !!!
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on December 12, 2009, 02:43:01 pm
Hi to all!

after a update to my website via website maker the new upload`s links does not work .
It keeps on referring to the old version of the website how would I go about fixing this problem?
Title: Re: [Solved]How to upload webpage contend???
Post by: HANNES1985 on January 04, 2010, 04:01:38 pm
I just needed to upload everything again and run the little code posted by isaac
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on March 29, 2010, 10:39:37 pm
All is running well can any one tell me if its possible to link all the samba user directories to separate files in the /var/www directory?

Ive added a user USER at users and groups and gave it 100mb disk space via samba
then ticked the enable per user public html and created a virtual host USER at webserver what I want to do now is being able to just paste everything into the network drive created via the samba account and It should then show when I access www.mydomain/USER
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on June 01, 2010, 08:33:11 pm
Okay all is running well

One question!

Is there a way I can keep the website contends in my samba directory root/home/admin,
and add a script file to my /var/www directory wich then redirect the clients to root/home/admin/index.html for web browsing

This way I can setup a network drive in windows and use my web page editing program to change my site as I want to without having to use putty or winCSP?

I can then use the same method to give my clients the same service via they're samba directory
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on June 01, 2010, 08:40:10 pm
Quote
cd /var/www
sudo ln -sf CSIWISP.html index.html

Maybe I can use the ln -sf function like
dir:/var/www
sudo ln -sf CSIWISP.html /home/admin/CSIWISP.html

and for user (joe)
dir:/var/www/joe
sudo ln -sf index.html /home/joe/index.html

Don't bite my head off if this is wrong im still learning here!! ;D
Title: Re: How to upload webpage contend???
Post by: HANNES1985 on June 02, 2010, 06:15:04 pm
Quote
Maybe I can use the ln -sf function like
dir:/var/www
sudo ln -sf CSIWISP.html /home/admin/CSIWISP.html

and for user (joe)
dir:/var/www/joe
sudo ln -sf index.html /home/joe/index.html

Okay I've tried this and it doesn't work any help on this matter??