Solved

Centos 5.5 Web Server

Posted on 2011-02-14
4
543 Views
Last Modified: 2012-05-11
I just installed Apache, MySQL and PHP in my Centos server. I want to host web sites for several clients. I want them to be able to access their files through ftp.
What would be the correct way to do this? Should I create a user account for each client? Where would their html files be stored? Do all html files from all clients are supposed to be stored in the same html folder?
Thanks
0
Comment
Question by:pcelements
4 Comments
 
LVL 3

Expert Comment

by:GerryMtz
ID: 34891715
Check this out, this will guide you to the whole Web hosting server setup.

http://www.howtoforge.com/perfect-server-centos-5.2

0
 
LVL 77

Expert Comment

by:arnold
ID: 34891720
You would need to install an FTP server wsftp/proftp.
It all depends on how you are managing the addition of the virtual sites to the apache configuration.
YOu can add ftp users with the user's home directory in a location where their web root is. Or they have a special path they have to use once logged in to get into their web root location.

No they do not you can define the document root for each website to a specific directory, the issue would be if you are using SELinux on making sure that those directories are properly referenced as web accessible.

Are you using webmin (www.webmin.com)?
0
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 34893662
In your file httpd.conf, when you create Virtual Hosts, you can set each virtual host to a different location which is set up by Document Root tag.

If you don't have too many users, you can enable ftp by creating a separate account for each user.  This way they will have a separate home and control over their own documents.
0
 
LVL 1

Expert Comment

by:haroldpga
ID: 34899589
Do each of your users have a different, registered domain name.  If that is the case, then set up each user with a virtual server with it's own directory in the /var/www directory tree...  

Something like this in your /etc/httpd/conf/httpd.conf file:

<VirtualHost _default_:80>
      ServerName www.xyzzy.com
      DocumentRoot /var/www/xyzzy
      ServerAlias *.xyzzy.com
      ServerAlias xyzzy.com
</VirtualHost>


Create a userid for each user, with the home directory being the root directory of their virtual server.  Make sure that each directory has the proper SELinux configuration.  On my server this is:

system_u:object_r:httpd_sys_content_t:s0

The home directory should be owned by and belong to the group of the userid associated with it.  the privileges should be drwxrwxr-x for it and all sub directories and the files should all be -rw-rw-r--

As to FTP, I would prefer to see you use ssh and scp instead of ftp.  More secure.  In fact, move it to a port other than 22 and tell your users to use that port.

Hope this helps
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now