1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Debian Server Setup [Deleted]

Discussion in 'Other Releases' started by Adam Howard, Aug 14, 2012.

  1. Adam Howard

    Adam Howard Well-Known Member

    Adam Howard submitted a new resource:

    Debian Server Setup (version 6.0) - Basic guide on how to setup and install your own VPS or Dedicated Server without a control panel

    Read more about this resource...
     
    Shelley likes this.
  2. Adam Howard

    Adam Howard Well-Known Member

    NOTE:

    This guide was tested on Debian 6 and Debian 7

    It can be used for Ubuntu by simply using Ubuntu's repositories and NOT Debain's repositories.

    It can be used for Mint Linux by simply using Mint's repositories and NOT Debain's repositories.

    IMPORTANT: It is strongly advised you do not mix repositories (use the repositories for the correct version of Linux you are using)
     
  3. Chris D

    Chris D XenForo Developer Staff Member

    I'm going to try this out in Ubuntu.

    Been meaning to do this.

    Traditionally I'm a Windows man (day job) so beginning to dabble in Linux is long overdue!
     
  4. Adam Howard

    Adam Howard Well-Known Member

    Been using Ubuntu on my home computer for a little over 1 year now. I have an older and smaller (80GB) for Windows, which I only use for the few games which will not play well with Wine. I've not been disappointed.

    If you're going to follow this guide for Ubuntu... Remember to use their repositories and not the ones supplied. Everything else in this guide will work as expected (and you can follow it).
     
    Shelley likes this.
  5. Adam Howard

    Adam Howard Well-Known Member

    Question: How do you setup FTP?

    Answer: The less you have installed, the less resources you will be using. And the less ways into your server, the more secure you are.

    I much prefer using SFTP which is automatically configured through SSH (already pre-installed and configured with any copy of Linux).

    There is a debate on the value on doing this. Some will argue this is less secure and unwise and others like myself will point out that FTP protocols are often proven insecure either directly or indirectly.

    However, one thing I forgot to add into this guide and will include now.... Is you DO want to change your ssh / sftp port away from the default

    PHP:
    nano /etc/ssh/sshd_config
    Within the first 5 lines, you should clearly see something that reads

    PHP:
    Port 22
    Change this number to whatever port you like except for (do not use) port 21, 80, 81, or any other common port.

    PHP:
    /etc/init.d/ssh restart
    Depending what other services or processes you have; you may need to reboot for this to take affect (as it could remain in memory).
     
    Shelley likes this.
  6. Adam Howard

    Adam Howard Well-Known Member

    A little toy for advance users to help fight spam bots
    You're welcome :)


    Command: crontab -e

    0 12 * * * /home/spam.sh >/dev/null 2>&1

    PHP:
    #!/bin/bash
     
    IPT=/sbin/iptables”
     
    FILE
    =/tmp/drop.lasso”
     
    URL
    =”http://www.spamhaus.org/drop/drop.lasso”
     
    echo “”
     
    echo -n “Deleting DROP list from existing firewall…”
     
    #This will delete all dropped ips from firewall
     
    ipdel=$(cat $FILE  egrep -v ‘^;’ awk ‘{ print $1})
     
    for 
    ipblock in $ipdel
     
    do
     
    $IPT -D spamhaus-droplist -s $ipblock -j DROP
     
    $IPT 
    -D droplist -s $ipblock -j LOG –log-prefix “DROP Spamhaus List”
     
    done
     
    echo -n “Applying DROP list to existing firewall…”
     
    #This will drop all ips from spamhaus list.
     
    [ -f $FILE ] && /bin/rm -f $FILE || :
     
    cd /tmp
     
    wget $URL
     
    blocks
    =$(cat $FILE  egrep -v ‘^;’ awk ‘{ print $1})
     
    $IPT -N spamhaus-droplist
     
    for ipblock in $blocks
     
    do
     
    $IPT -A droplist -s $ipblock -j LOG –log-prefix “DROP Spamhaus List”
     
    $IPT 
    -A droplist -s $ipblock -j DROP
     
    done
     
    $IPT 
    -I INPUT -j droplist
     
    $IPT 
    -I OUTPUT -j droplist
     
    $IPT 
    -I FORWARD -j droplist
     
    echo “…Done”
     
     
    Sway and Shelley like this.
  7. Adam Howard

    Adam Howard Well-Known Member

    Question: I really want to do this, but I'm not completely comfortable doing this myself. Will you do this for me?

    Answer: YES, I will be willing to setup a basic Debian, Ubuntu, or Mint web server for anyone. However there will be a small fee of $25 for me to do so.

    If you wish me to also install your forum with add-ons (yes, I'll even install the add-ons and skins) it is another $25.
     
    Shelley likes this.
  8. Adam Howard

    Adam Howard Well-Known Member

    Question:

    I wanted to do this on a local install on my home computer so that I may test and run things locally, but got the following message from the terminal.

    PHP:
    ECould not open lock file /var/lib/dpkg/lock open (13Permission denied)
    EUnable to lock the administration directory (/var/lib/dpkg/), are you root?
    What am I doing wrong?

    Answer:

    Typically on your own computer you will need to start everything with the sudo command.

    It is a security feature for Linux not to run everything using full root access. When doing this remotely, you're automatically log-in as root. But typical from the desktop, the computer doesn't want your average low end user doing crazy things without first giving it some thought.

    See example
    PHP:
    sudo X Y Z
    Simply add sudo before whatever you're doing (update, upgrade, or install)
     
    Shelley and MichaelDance like this.
  9. gordy

    gordy Well-Known Member

    Very helpful thank you. One note the "libapache2-mod-php5-mysql" would work nicer : "libapache2-mod-php5 php5-mysql" ;)
     
    Adam Howard and Insy like this.
  10. Adam Howard

    Adam Howard Well-Known Member

    You are correct. Small typing error on my part. Good eye :D
     
  11. Adam Howard

    Adam Howard Well-Known Member

    Adam Howard updated Debian Server Setup with a new update entry:

    small typing error

    Read the rest of this update entry...
     
  12. Adam Howard

    Adam Howard Well-Known Member

    Dedicated Server

    Linux Kernel 3.6 Stable has been released. :D

    The improvements include better hardware support, security bug fixes, and better memory optimizations.

    Caution

    VPS Servers are a toss up.

    Some you can update the kernel and some you can not, because they're plugged into a "master shell" which connects them all for easier super administrator managements ... ie... Your host, who in the end is basically "GOD" over the server.

    This varies though so some VPS servers can update the kernel and some can not. I'd suggest you contact your host about this first.

    For the rest of you who have true dedicated servers. A kernel upgrade can be very useful.

    BACK UP EVERY-THING

    Place this script in your /tmp folder

    PHP:
    cd /tmp
    PHP:
    chmod +x linux-kernel-3.6
    PHP:
    sh linux-kernel-3.6
    This will install Linux Kernel 3.6 for you.

    IMPORTANT = Once completed (successful install) you MUST reboot. If you can not reboot for whatever reason... Do not proceed with trying to install this.

    PHP:
    reboot
    Remember it could take a few minutes before you are back online. Do not panic if things do not boot up right away.

    Thanks and credit to Ubuntu who actually host generic vanilla kernels and thus make this possible for anyone using Debian, Ubuntu, or even Linux Mint :)

    Tested on Debian 6, 7, Ubuntu 12.04, 12.10, and Mint (current).


    The full script code is thus:

    PHP:
    #!/bin/bash
     
    #### Script Created By SociallyUncensored.eu ####
     
    #i386 links
     
    link1="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-headers-3.6.0-030600_3.6.0-030600.201209302035_all.deb"
     
    link2="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-headers-3.6.0-030600-generic_3.6.0-030600.201209302035_i386.deb"
     
    link3="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-image-3.6.0-030600-generic_3.6.0-030600.201209302035_i386.deb"
     
    link4="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-image-extra-3.6.0-030600-generic_3.6.0-030600.201209302035_i386.deb"
     
    #amd64 links
     
    url1="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-headers-3.6.0-030600-generic_3.6.0-030600.201209302035_amd64.deb"
     
    url2="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-image-3.6.0-030600-generic_3.6.0-030600.201209302035_amd64.deb"
     
    url3="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.6-quantal/linux-image-extra-3.6.0-030600-generic_3.6.0-030600.201209302035_amd64.deb"
     
    #System architecture
     
    arch=`uname -m`
    if  [ 
    $arch i686 ] || [ $arch i386 ]; then
     
    mkdir $HOME
    /kernel3.6-i386
     
    sudo rm 
    -rf $HOME/kernel3.6-i386/*
     
    cd $HOME/kernel3.6-i386
     
    wget $link1
    wget $link2
    wget $link3
    wget $link4
     
    sudo dpkg -i *.deb
     
    sudo rm -rf $HOME/kernel3.6-i386
     
    elif [ $arch = "x86_64" ]; then
     
     
    mkdir $HOME/kernel3.6-amd64
     
    sudo rm -rf $HOME/kernel3.6-amd64/*
     
    cd $HOME/kernel3.6-amd64
     
    wget $link1
    wget $url1
    wget $url2
    wget $url3
     
    sudo dpkg -i *.deb
     
    sudo rm -rf $HOME/kernel3.6-amd64
     
        else
            echo "Unsupported Architecture"
    fi
     

    Attached Files:

  13. Adam Howard

    Adam Howard Well-Known Member

    Adam Howard updated Debian Server Setup with a new update entry:

    Optional Linux Kernel Update

    Read the rest of this update entry...
     
  14. Adam Howard

    Adam Howard Well-Known Member

    Attached Files:

  15. Adam Howard

    Adam Howard Well-Known Member

    Attached Files:

  16. Adam Howard

    Adam Howard Well-Known Member

    Linux Kernel 3.6.5
     

    Attached Files:

  17. Sway

    Sway Active Member

    I can't seem to get phpmyadmin installed on my new server. I run nginx. There are only 2 options for this. Apache and lighthttp or whatever it's called lol..
     
  18. Adam Howard

    Adam Howard Well-Known Member

    It's been a while since I played with nginx. While it is faster... I find it next to impossible to teach. Just about everything changes in each version.

    I could tell you that v1.0 to do X. But in v1.1 it would be different. And it would change completely again in v1.2 :confused:

    Until they settle on a few things..... I'd stick to Apache.
     
  19. Sway

    Sway Active Member

    Nginx is great once you finally figure it out.
    I think i managed to get phpmyadmin working again. I used a symlink.

    Also, when installing phpmyadmin with aptitude it seems to prompt you for an automatic configuration for one of those 2 web servers. I managed to install it with apt-get without getting that prompt.
     
  20. Adam Howard

    Adam Howard Well-Known Member

    My problem wasn't learning..... My problem was being forced to re-learn and re-configure for every update, for every version. :confused:

    I cover that in the instructions ;)

    apt-get will sometime also bring up that option. Always select NO.
     
    Sway likes this.

Share This Page