LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2019, 02:08 PM   #1
olentulen
LQ Newbie
 
Registered: Jan 2019
Location: Norway
Distribution: Ubuntu 16.04
Posts: 6

Rep: Reputation: Disabled
Understanding Linux file system


Hi. Iím new into this, but usually I find all the information I need by a quick search on the net. But not with this one.

I have linked my domain to an Amazon Ubuntu instance. I have also installed MySQL, Apache2 and php (not yet sure if php was installed correctly).

So Apache says that index page is located at /var/www/html/index.html
And the start page through the ssh if /home/ubuntu. I suppose that I see the same page in ftp. And it is empty.

So I donít really understand how they are connected together. Is home folder located in the same directory with var?

I can navigate to /var/www/html in ssh, but it could be easier to see the all folders in ftp to understand file system better and to upload files to this folder.

How this file system I built up? Could anyone help?
 
Old 01-13-2019, 03:05 PM   #2
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 357

Rep: Reputation: 102Reputation: 102
Quote:
So I don’t really understand how they are connected together.
They aren't. They are on different parts of the file tree.

Quote:
Is home folder located in the same directory with var?
Not at all.

Quote:
And the start page through the ssh if /home/ubuntu. And it is empty.
There are usually hidden configuration files and directories. You need to enter ls -a to show hidden files.

Quote:
How this file system I built up? Could anyone help?
https://www.linuxtrainingacademy.com...tem-hierarchy/

Last edited by tofino_surfer; 01-13-2019 at 03:06 PM.
 
1 members found this post helpful.
Old 01-13-2019, 03:19 PM   #3
goodhombre
Member
 
Registered: Mar 2010
Location: Ungheni, Rep. Moldova
Distribution: Ubuntu
Posts: 89

Rep: Reputation: 22
Hi olentulen,

You can set up a new virtualhost in a Apache and set the Document Root to /home/ubuntu and in this way all files related to the new created virtualhost will be in /home/ubuntu. The correct way to do it is to use apache2-mpm-itk apache module and run each virtualhost in a different user context. This way you can set website document root to user's home directory and be able to modify files through ftp.

Try to read apache documentation regarding virtualhosts and mpm-itk module. Also take a look into linux file permissions documentation.
 
1 members found this post helpful.
Old 01-13-2019, 04:17 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,600

Rep: Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769
In addition to the standard location for the Apache Document Root that you now have, you can also configure Apache to use a user /home directory by enabling userdir in Apache as explained at the link below, for Ubuntu 18.04. Not sure if it varies for other Ubuntu distributions and you don't indicate which you are using. This would work as would the VirtualHost option but I don't know what will work in your "Amzaon Ubuntu instance" as that would depend upon what access control you have.

https://www.server-world.info/en/not...04&p=httpd&f=6

Last edited by yancek; 01-13-2019 at 04:27 PM.
 
1 members found this post helpful.
Old 01-13-2019, 07:21 PM   #5
olentulen
LQ Newbie
 
Registered: Jan 2019
Location: Norway
Distribution: Ubuntu 16.04
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by tofino_surfer View Post
They aren't. They are on different parts of the file tree.

https://www.linuxtrainingacademy.com...tem-hierarchy/
http://www.linuxtrainingacademy.com/...ctory-tree.jpg

Thank you for the link!

This is what I ment, both folders are located in the root directory.

Quote:
Originally Posted by yancek View Post
In addition to the standard location for the Apache Document Root that you now have, you can also configure Apache to use a user /home directory by enabling userdir in Apache
Thank you for this info.

I was trying to set up 18.04, but things got messed up already at installing mySQL. Then i have started over on 16.04.

I have followed this guide. What shall i do to redirect this to the front page?

Last edited by olentulen; 01-13-2019 at 10:58 PM.
 
Old 01-13-2019, 07:48 PM   #6
olentulen
LQ Newbie
 
Registered: Jan 2019
Location: Norway
Distribution: Ubuntu 16.04
Posts: 6

Original Poster
Rep: Reputation: Disabled
I see that in last guide they use home/user/public_html to place index.html at. Is it any guide that shows the best way to place different parts of the web site at home/user to do it property from the start.

Last edited by olentulen; 01-14-2019 at 02:34 PM.
 
Old 01-13-2019, 08:11 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,431
Blog Entries: 25

Rep: Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438Reputation: 4438
This is one of the better introductory tutorials I've seen: https://likegeeks.com/linux-file-system/

The very high-level summary is that, in *nix systems, files are put in directories according to their function, whereas in DOS/Windows, they are put in directories by program name. Of course, this is grossly over-simplified (think of the System32 and SysWOW64 directories, for example)
 
1 members found this post helpful.
Old 01-14-2019, 01:14 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,471
Blog Entries: 9

Rep: Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375
i really hope you're using sftp (which is part of the ssh package), and not ftp, which is old and insecure.

i also hope you realise the dangers of your server getting hacked; for ssh you should
  • disbale root login
  • enable login with keys
  • disable password login
for basic security.
the last two points come with the risk of locking yourself out of your server, therefore find a good tutorial and make sure you follow & understand all the steps.
certainly good if you're using ubuntu:
https://help.ubuntu.com/community/SSH/OpenSSH/Keys
digitalocean tutorials have helped me many times:
https://www.digitalocean.com/communi...on-ubuntu-1604
nothing beats arch wiki:
https://wiki.archlinux.org/index.php/SSH_keys

good luck with your server.
 
1 members found this post helpful.
Old 01-14-2019, 01:38 AM   #9
olentulen
LQ Newbie
 
Registered: Jan 2019
Location: Norway
Distribution: Ubuntu 16.04
Posts: 6

Original Poster
Rep: Reputation: Disabled
:-) Sorry for calling sftp for ftp, ondoho. And thanx for the info
 
Old 01-14-2019, 02:33 PM   #10
olentulen
LQ Newbie
 
Registered: Jan 2019
Location: Norway
Distribution: Ubuntu 16.04
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanx to all for the information!

I still don’t understand some basic things:

1. How can I show index page located at public_html (or any other place at /home/user/ ) at www.mysite.com.

2. How to add a subdomain and manage it from /home/user/ directory.
 
Old 01-15-2019, 01:11 AM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,471
Blog Entries: 9

Rep: Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375Reputation: 3375
Nr 1. is a very basic question; you are asking us how to set up a server.
please read some tutorials (apache and ubuntu, i'm sure digitalocean has something relevant to offer) and read documentation.

Chances are, by the time you understand more, you can also answer Nr. 2.
 
1 members found this post helpful.
Old 01-15-2019, 07:17 AM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,600

Rep: Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769Reputation: 1769
Quote:
How can I show index page located at public_html (or any other place at /home/user/ )
Do an online search for how to access apache public_html in ubuntu 16.04 and you should come up with a number of sites similar to the one below.

https://websiteforstudents.com/enabl...u-17-04-17-10/
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Help with understanding the 'with' keyword and understanding file reading and writing. vysero Programming 3 05-30-2018 02:37 PM
Understanding File System rupeshkp728 Linux - General 3 07-17-2012 09:48 PM
LXer: Understanding the File System and Structure in Linux LXer Syndicated Linux News 0 09-15-2011 09:40 AM
[SOLVED] Starting File System .. Starting File System .. Starting File System .. Starting File rmknox Linux - Newbie 3 08-15-2010 11:30 PM
LXer: Understanding UNIX/Linux file system LXer Syndicated Linux News 0 01-29-2006 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration