Powered by eUKhost®

Announcement

Collapse
No announcement yet.

Configuring a server without using cpanel

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring a server without using cpanel

    Hi,

    I've just signed up for a dedicated Linux server with eukhost and thought it might be fun to post about my experience of setting it up in the hope that it may help others in the future and those more experienced might cast their wisdom over it.

    A bit about me; I'm a software developer of 20 years experience, almost all Windows based C++ - tho I do a small amount of cross-platform development (Redhat/Montavista/Windows) these days. First and only experience of installing/configuring Linux was back in 1998/9 with an Intel 486 and Kernels 2.0/2.2.. just basic installation on a home PC (no email, webserver) but did have to recompile the kernel (can't remember the reason - it was a long-time ago!)

    This morning I received the welcome email... lots of information to digest.. and a few thoughts of what have I let myself in for

    After reading the email the first step is to try and log in.

    Don't try and telnet the Primary IP Address it doesn't work.. (on windows) you need to use something like WinSCP. After entering your username/password and Primary IP Address you can connect and browse the directories on your server.. and if your keen open a terminal (command prompt) too.

    Now back to the email...

    1) Hostname:
    Hostname is the name of your Dedicated Server and should point to your server's Main IP. It should be FQDN (Fully Qualified Domain Name) like server. or ns., which should be hosted on your Dedicated Server.
    Please also change the hostname of the server once you are logged in.
    So how to do this? Well googling threw up a very easy to follow set of instructions;

    If you want to change your server hostname you have to make changes in following file.
    1) /etc/hosts
    your server IP address serverfullname (like server.domainname ) shortname (server)
    for example
    91.186.30.32 server.eukhost.com servr
    2) /etc/sysconfig/network
    HOSTNAME=server.domainname
    3) run following command on ssh shell to set hostname
    hostname server.domainname
    Back to the email to see what's next...

    ) Nameservers:
    You have to set the default nameservers for your Dedicated Server. These nameservers will be assigned by default to all the accounts or domains which would be created on your Dedicated Server. You may use any of the spare IP's you have for your DNS.
    If you want the DNS to be the same as your domain name i.e. for instance if your domain name is myself.com & you wish to have your DNS as ns1.myself.com & ns2.myself.com, then you would have to register the DNS from the same registrar where you have registered the domain name myself.com.
    If you have registered your domain name with eukhost.com, then please contact our billing department to have your DNS registered free of cost!
    Must admit I haven't done this yet.. since the web site hosting is currently running on a shared server, and I can access the new server via it's IP address for the time being (got to leave something to do tomorrow!)

    Next how do I install apache, MySQL Server and php? Again googling throws up a gold nugget... in the form of'

    Installing Apache, MySQL and PHP on a Linux Server in under 10 minutes

    Apache, MySql and PHP; these three products are open source programs available for use on most well known operating systems. In this article I will explain how you can install Apache, MySql and PHP on a Linux box using yum in under 10 minutes.

    1 - Checking and Removing Any Existing Installations of the 3 of Them

    Run the following command to make sure that any existing installations of Apache, MySql or PHP are removed:

    yum -y remove httpd mysqld mysql-server php

    2 - Installing Apache

    Run the following to install the Apache web server:

    yum -y install httpd

    3 - Installing MySql Server

    Run the following command to install MySql Server:

    yum -y install mysqld mysql-server

    4 - Install PHP

    Run the following command to install PHP:

    yum -y install php php-mysql

    5 - Installing PHP Libraries

    PHP has many different libraries and add-ons which you want or need to utilize; in your case we want to install the PHP GD image library and the PHP IMAP library, to do this we’ll be using the following command:

    yum -y install php-gd php-imap

    Thats it - you have now AMP’d a server! All you need to do now is start the individual services, to do this run the following commands (individually):

    service httpd start

    service mysqld start

    PHP will be seen by Apache as a library and so does not need to be started.
    Within 10 minutes the installation is complete.. and time to try it out.

    First I created a test.html under /var/www/html containing;

    <html>
    <head>
    <title>Testing</title>
    </head>
    <body>
    <p>This is a test page )</p>
    </body>
    </html>
    Now browse to http://<your primary ip address>/test.html

    Next to test php, I created a test.php also under /var/www/html containing;

    <html>
    <head>
    <title>Testing</title>
    </head>
    <body>
    <?php
    for($i=0; $i<10; ++$i) {
    echo "<p>This is a test $i</p>\n";
    }
    ?>
    </body>
    </html>
    And to see the result, browse http://<your primary ip address>/test.php

    That's enough excitement for today, tomorrow I'm going to try and tackle setting up; nameservers, ftp and uploading a copy of the existing site.

    Cheers
    Mark
    Last edited by mb7674; 25-06-2008, 22:52.

  • #2
    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 20 per month if you are going to host only 1 website hosting on your server.
    eUKhost - eNlight Cloud Hosting || eUKhost Knowledgebase
    Toll Free : 0808 262 0255 || Skype : mark_ducadi

    Comment


    • #3
      Originally posted by eUKhost.com View Post
      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.
      20k a month wow thats an expensive version.

      Cheers,
      Clive.

      Comment


      • #4
        Originally posted by viking30 View Post
        20k a month wow thats an expensive version.

        Cheers,
        Clive.
        lol. you can figure it out from time of my previous post
        eUKhost - eNlight Cloud Hosting || eUKhost Knowledgebase
        Toll Free : 0808 262 0255 || Skype : mark_ducadi

        Comment


        • #5
          Originally posted by eUKhost.com View Post
          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

          yum list "*ftp*"
          Gives a list of all the packages containing 'ftp'.. googling shows vsftpd is the server, so to install;

          yum -y install vsftpd
          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;

          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

          # 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;

          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

          service vsftpd start
          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;

          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;

          ServerAdmin [email protected]
          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

          service httpd restart
          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.

          Comment


          • #6
            These guides are very helpful and you can skip the first few pages...
            The Perfect Server - CentOS 5.7 x86_64 [ISPConfig 2] - Page 3 | HowtoForge - Linux Howtos and Tutorials
            sigpicManaged osCmax hosting
            (I'm not social )

            Comment


            • #7
              Originally posted by ejsolutions View Post
              These guides are very helpful and you can skip the first few pages...
              The Perfect Server - CentOS 5.7 x86_64 [ISPConfig 2] - Page 3 | HowtoForge - Linux Howtos and Tutorials
              Nice tutorial, thanks for sharing .
              David Smith
              Managing Director
              DPS Computing Limited

              - Massive update! (September 2011) - It's now not neglected!!
              - New Site (10/2009)

              Comment


              • #8
                Re: Configuring a server without using cpanel

                Or install virtualmin it's free.

                Comment

                ban-img
                Working...
                X