Quote:
Originally Posted by eUKhost.com
 Mark
I'll stick this thread as information you have included will help other customers who wish to avoid control panel like cPanel. There's absolutely no need to pay £20k per month if you are going to host only 1 website hosting on your server.
|
Thanks... yes 20k is a bit excessive
Round 2... nameservers, ftp and uploading the site
In my previous post I mentioned I hadn't followed the instructions to set up the nameservers... so late last night I fired off a ticket to billing (my domain was purchased via eukhost.. if yours wasn't you need to talk to the registrar of your domain name).
I've asked for ns1.mydomain.com and ns2.mydomain.com to be set up using 2 spare ip address, and got a message back saying it's done and needs time to propagate. So that's another task crossed off the list (is there anything i need to do to config the server? it's not clear from the welcome email)
Next ftp.
After the success with yum last night.. I thought more of the same please!
So running
Gives a list of all the packages containing 'ftp'.. googling shows vsftpd is the server, so to install;
Next security starts to rear its head.. I'd like to restrict access to me (so I can upload the site) and disallow ftp access by anyone else.
Also logging in as root isn't good for day to day stuff, so time to create a new user which I'll use to manage the
website hosting.
Running WinSCP;
Quote:
useradd newuser
passwd newuser
|
i found you can't run passwd when using WinSCP as it can't cope with commands that require user input.
So instead, download puTTy and login as root then issue the 'passwd newuser' command at which point you can enter and confirm the newuser password.
As a check, you should be able to login via WinSCP with your newuser details.
Next to configure vsftpd so you can connect with your newuser details.
First edit /etc/vsfttpd/user_list
Quote:
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
newuser
|
Then edit /etc/vsftpd/vsftpd.conf and change the following entries;
Quote:
anonymous_enable=NO
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=600
nopriv_user=nobody
ascii_upload_enable=YES
ftpd_banner= **** WARNING - Your actions are being logged ****
pam_service_name=vsftpd
userlist_enable=YES
listen=YES
tcp_wrappers=YES
userlist_deny=NO
|
Now you can start the ftp
And run up your ftp client and connect using your newuser details.
newuser only has access to the directory /home/newuser .. so my plan is to make that the root directory of the
website hosting.
Log on as newuser and under /home/newuser create the following directory structure;
Quote:
mkdir web cgi-bin private logs
cd web
mkdir stats
|
Next to configure apache to use the new directory (rather than the default /var/www/html)
As root you need to tell apache about the new directory to use so backup a copy then edit /etc/httpd/conf/httpd.conf and change;
Quote:
ServerAdmin admin@mydomain.com
ServerName www. mydomain .com:80
DocumentRoot "/home/newuser/web"
<Directory "/home/newuser/web">
ScriptAlias /cgi-bin/ "/home/newuser/cgi-bin/"
<Directory "/home/newuser/cgi-bin/">
ErrorLog /home/newuser/logs/error_log
TransferLog /home/newuser/logs/access_log
|
Now restart appache
If I've got it right, you should now be able to ftp to /home/newuser .. upload your html pages to the web subdirectory, and view them via your primary ip address
Cheers
Mark
... a disclaimer: I'm not an expert in this area, this is simply what I did and may have implications. Hopefully by posting here, other experienced sysadmins may spot a flaw in what I've done. If you have please post them! Thanks.