LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-13-2019, 03:28 PM   #1
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Rep: Reputation: 22
How to setup my own private web hosting server, for myself only.


Data: CentOS7, Apache, Mariadb, php, H/W-mem: max 20G


I don't think I can find the correct words to find what I'm looking for so I'll ask you guys.

I want to setup a web hosting server but for myself only.
It should be as close to as any real one, like the added account fixes a database/access, generate passwords, create ftp/fpts etc with it's own password etc.

This is just for me to test things and to easily add a new website with a new domain name with ease so preferably at no cost except H/W and such.

-If no one knows anything, what words should I use to get info of this?
-Is there an addon for webmin, or multiple addons? if not, where do I read up on all this.
-Is there a bash script for this? and hopefully to do it all after a few questions, creating DB, ftp-user, homedir, access etc but if no problem if they are separated.
-If totally manual for each step, what's the best setup, create the web files in the user home dir, sure no worries there but if so what about the database, it has no virtualhost, like different dir's, does it?
 
Old 11-13-2019, 06:04 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
It is true that your goal is unclear. You can search the internet for centos set up LAMP, and you will get generous results. Digital Ocean tends to have good cookbooks.

Most probably, creating a LAMP server is the easy step. Filling it with content is the real problem: You will have to think of a data model that you will turn into a DB schema, then templates that implement the looks of your web site, and how to tie everything together. Websites normally use the MVC architectural pattern, Model-View-Controller.

Also look up frameworks, which allow you to map your data model to the database, implement authentication etc.

You may want to start with a server for static web pages without DB and PHP.
Code:
yum install httpd
and create the pages under /var/www/html. Don't forget that the Centos firewall blocks practically all traffic; to allow web traffic, use firewall-cmd.
 
1 members found this post helpful.
Old 11-13-2019, 07:16 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
I believe the op is asking about web hosting control panels. I have not played with any of the open source versions.

https://en.m.wikipedia.org/wiki/Comp...control_panels
 
1 members found this post helpful.
Old 11-13-2019, 07:54 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
If you want to do this on a home computer with no public facing, you might want to look at XAMMP. It includes phpMyAdmin.
 
1 members found this post helpful.
Old 11-14-2019, 03:23 AM   #5
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 321

Rep: Reputation: 33
Chek https://www.ispconfig.org/

It has all the features you want. And it is free.
 
1 members found this post helpful.
Old 11-14-2019, 03:45 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,308
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by frankbell View Post
If you want to do this on a home computer with no public facing, you might want to look at XAMMP. It includes phpMyAdmin.
XAMPP can be considered adequate for those stuck running Windows but gets in the way of modern systems in several ways. Regular LAMP should be pursued if it is an option and CentOS 7 will certainly be able to support standard Apache, Mariadb, and various scripting languages such as PHP/Python/Perl.

Unless FTPS is a hard-coded requirement, I'd stongly advise against wasting effort on it and instead use regular SFTP. SFTP is far easier to set up and get through the firewall and is more secure.

However, in general, it'd be good to hear about what kind of hosting the OP wants. It may very well be that the hosting requirements are better met with a static site generator like Hugo, Pelican, or Jekyll instead of a heavy CMS like WordPress. The static site generators combine the best of both worlds for quite a few use-cases. For smaller sites, XHTML+CSS+SSI would have even fewer moving parts.
 
1 members found this post helpful.
Old 11-14-2019, 07:31 AM   #7
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
To be more informative as it seems I didn't seem to get my thoughts out.

I have done a lot of LAMP installations although not using this bundle, installing everything

Now I want to be able to let the main users/webadmins who I set all these sites up for to log in and manage it, change things etc before it's time for upload to a real web hosting service and use the real domain name.
With my normal setup I use the same MariaDB daemon but different databases but this will not work as each user do not have their own instance thus see all databases, or?

When you think of any(?) web hosting, you get FTP access to the files with one login and another for the database and in this you only see our own db and it's this type of setup I want. I wonder know how a web hosting service can do this one instance of MariaDB? is it possible?

I tried to let FTP access the web files in each subdir under /var/www... with SELinux context as httpd and it seems it won't work or I'm doing something wrong. The web files can be put in the users home dir, set the appropriate SELinux context and this is not a problem anymore with Apache but now... how about FTP? my problem is the database.

I hope this is a better description of my needs
 
Old 11-14-2019, 08:22 AM   #8
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 321

Rep: Reputation: 33
Did you check ISP config - this is not something on the Internet, you can install it on your server and you have almost the same user experience as with C-Panel.
 
1 members found this post helpful.
Old 11-14-2019, 12:31 PM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Webmin can be configured to limit what users can see and do.
Quote:
With my normal setup I use the same MariaDB daemon but different databases but this will not work as each user do not have their own instance thus see all databases, or?
MySql/MariaDB can be configured the same way, so that a user can only see and manage their one database(s) within a single instance. Read up on privileges. Each user should not see all databases.
 
1 members found this post helpful.
Old 11-14-2019, 12:56 PM   #10
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
OK, I'll have a look at ISP config, I'll check with them about Hugo, Pelican, Jekyll and OK about the user access in MariaDB, I'll look more into that.

What about the web files? To get an FTP setup so the user can do anything with them, where should I place them?
I usually use /var/www/... but some times I move away from that directory to a separate drive with better speeds and RAID:ed but I'm more and more thinking that instead of moving that standard directory, I will mount the separate disk under it instead, a lot less hassle with SELinux

I can't find any example how to setup eg. wuftp, proftp, vsftp to be able to access the web files if they are in /var/www/html/userx/filesxxx... so I'm thinking of moving them, per user, into their own home dir, but that also adds some SELinux context changing, but that's OK but then I don't know if the daemon can access them since the context changed...

As you see I'm not natively English speaking so I got some problem to create the right question with the right words for the search engines

The thing with the ftp to access the files is when using Wordpress, this application can't use ssh, only ftp/ftps and this kinda sux, this is why I need this ftp-thingy.
 
Old 11-14-2019, 01:02 PM   #11
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
A user has a home directory. If that user's home directory is /var/www/html/user1 then (s)ftp will upload to that directory, which is where the web content is served from when the domain is configured to use that directory as the DocumentRoot.

I will typically give a customer one login/username for (s)ftp and a separate username for email, as the user's email shouldn't be in the web space.

A customer with several domains will have several spaces in the web space:
Code:
/var/www/html/user1/domain1
/var/www/html/user1/domain2
/var/www/html/user1/domain3
etc.
All accessible via (s)ftp using the user1 login. I have one customer with 13 such.

Last edited by scasey; 11-14-2019 at 01:14 PM.
 
1 members found this post helpful.
Old 11-14-2019, 02:19 PM   #12
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
OK, I'll test that again, I have to have made something wrong cos I set the home dir to point to that dir but nothing shows up.
I'm on it again, thx
 
Old 11-15-2019, 03:08 PM   #13
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
I think I got that the answers that helped me out so I'll close this thread, I might be opening it up again, but I doubt it as I got lots of things to search and test, thx

- I will absolutely try out ISPConfig cos that sure looks interesting (saw a UT-vid about it but daaang, installed like every PHP-module there is... ,
can't say it was for ISPConfig or 'just in case', if the latter... that sux.
(Check video: https://youtu.be/kah1PzC1gzo?t=525 why install package for mssql?? )
- Why I didn't know that a database specific admin user only could see it's own database gotta be that I always use super user when handling MariaDB so.... ooops
- Tried ProFTP again and it worked. I can't say what I did wrong last time since it couldn't list any files in the /var/www... directory but now it can see them all
and hopefully also add/del/mod them all, haven't tried that yet.
- Looked a bit on XAMPP but I didn't get why this is better than LAMP or as I do, install all 'em all by hand? OK it also has Perl, but when do I use that? Haven't so far.

Well think that is all.... at least that I can think of.

Thanks again and...


UPDATE: Just saw that Webmin uses Perl so, sorry

Last edited by Basher52; 11-15-2019 at 03:23 PM. Reason: Just saw that Webmin uses Perl, so... oops :p
 
  


Reply

Tags
apache, database, own web hosting, setup



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
LXer: Web Server Setup Series - How To Setup And Manage Your Own Web Server LXer Syndicated Linux News 0 02-08-2018 08:11 AM
Is Private Web Browsing Really Private? LinuxCrushesWindows Linux - Software 16 03-03-2014 12:38 PM
How do I set up my own APT-GET RPM server on my web hosting Val-Ent Linux - General 1 01-12-2007 03:41 AM
LXer: Web Hosting Provider Verizon Business Expands Managed Hosting ... LXer Syndicated Linux News 0 09-17-2006 06:21 AM
LXer: Web Hosting Provider Zen Internet Offer Linux Hosting Trial for 1 ... LXer Syndicated Linux News 0 04-20-2006 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:24 AM.

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
Open Source Consulting | Domain Registration