Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (1)

Powered by Vanilla. Made with Bootstrap.
Setting up a server(Xubuntu)
  • Well I decided to make this quick guide for anybody wanting to make a web server from a spare computer.

    Step 1: Install Xubuntu, It comes with some critical files you will need. You can use another Linux distro but it requires a bit more work installing samba.

    Step 2: Now to set up sharing. Install samba. You can either do that by using aptitude on the terminal, or you can use synaptic package manager.

    Step 3: Change directory to /etc/samba
    open smb.conf in either gedit or nano and replace everything in the file with this:

    [global]
    panic action = /usr/share/samba/panic-action %d
    workgroup = \"Name\"
    netbios name = \"Server name\"
    invalid users = root
    security = user
    wins support = no
    log file = /var/log/samba.log
    log level = 3
    max log size = 1000
    syslog = 1
    encrypt passwords = true
    passdb backend = smbpasswd
    socket options = TCP_NODELAY
    dns proxy = no
    passwd program = /usr/bin/passwd %u
    passwd chat =*Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
    obey pam restrictions = yes
    pam password change = no
    null passwords = no

    #Share Definitions

    [homes]
    comment = Home Directories
    browseable = yes
    writable = yes
    security mask = 0700
    create mask = 0700

    Edit name and server name with your Xubuntu info.

    Step 4: Set the samba password:

    smbpasswd -a Username

    Replace Username with your Xubuntu username.

    Step 5: Now for FTP. Install proftpd using the terminal. When it comes up, select standalone server. Now configure it with either gedit or nano on this file:
    /etc/proftpd/proftpd.conf
    And replace everything in the file with this:

    #
    # /etc/proftpd.conf -- This is a basic ProFTPD configuration file.
    # To really apply changes reload proftpd after modifications.
    #

    ServerName \"FTP Server\"
    Serverident on \"FTP\"
    ServerType standalone
    DeferWelcome off
    TimesGMT off


    MultilineRFC2228 on
    #DefaultServer on
    ShowSymlinks on

    TimeoutNoTransfer 600
    TimeoutStalled 600
    TimeoutIdle 1200

    DisplayLogin welcome.msg
    DisplayFirstChdir .message
    ListOptions \"-l\"

    DenyFilter \*.*/

    AllowForeignAddress on
    AllowRetrieveRestart on

    # Uncomment this if you are using NIS or LDAP to retrieve passwords:
    #PersistentPasswd off

    # Uncomment this if you would use TLS module:
    #TLSEngine on

    # Uncomment this if you would use quota module:
    #Quotas on

    # Uncomment this if you would use ratio module:
    #Ratios on

    # Port 21 is the standard FTP port.
    Port 21
    SocketBindTight on

    PassivePorts 11000 20000


    # To prevent DoS attacks, set the maximum number of child processes
    # to 30. If you need to allow more than 30 concurrent connections
    # at once, simply increase this value. Note that this ONLY works
    # in standalone mode, in inetd mode you should use an inetd server
    # that allows you to limit maximum number of processes per service
    # (such as xinetd)
    MaxInstances 30

    # Set the user and group that the server normally runs at.
    User nobody
    Group nogroup

    # Umask 022 is a good standard umask to prevent new files and dirs
    # (second parm) from being group and world writable.
    Umask 022 022
    # Normally, we want files to be overwriteable.
    AllowOverwrite on

    AllowForeignAddress on
    AllowRetrieveRestart on
    AllowStoreRestart on

    # Speed up the server, no DNS lookups, just plain ip's. Turn off when being hax0r3d.
    UseReverseDNS off
    IdentLookups off

    DefaultRoot ~
    ExtendedLog /var/log/proftpd.all ALL


    # Delay engine reduces impact of the so-called Timing Attack described in
    # http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
    # It is on by default.
    DelayEngine off

    <Anonymous ~ftp>
    User ftp
    Group nogroup
    UserAlias anonymous ftp
    DirFakeUser on ftp
    DirFakeGroup on ftp
    RequireValidShell off
    MaxClients 10
    DisplayLogin welcome.msg
    DisplayFirstChdir .message
    AccessGrantMsg \"Anonymous access granted for user %u connecting.\"

    MaxClientsPerHost 1

    <Directory>
    #DenyAll
    TransferRate RETR 50
    <Limit WRITE>
    DenyAll
    </Limit>
    </Directory>

    Now restart proftd(/etc/init.d/proftd restart)

    Step 6: Now install the following:
    openssh-server
    x11vnc

    Open terminal and type
    vncpasswd ~/.vnc/passwd

    Now set the port:
    echo 1337 > ~/.vnc/port


    Now open /usr/local/bin/sharex11vnc
    and replace everything with this:
    #!/bin/sh
    x11vnc -nap -bg -many -rfbauth ~/.vnc/passwd -desktop \"VNC ${USER}@${HOSTNAME}\" \
    |grep -Eo \"[0-9]{4}\">~/.vnc/port


    Now change the permissions through the terminal:
    chmod 755 /usr/local/bin/sharex11vnc


    Now go to applications>settings>Autostart applications and add this:
    sharex11vnc



    Now you should have your server pretty much up. To connect you SSH into it with a program like putty. And you can also add new programs such as apache and php to enhance your server.

    NOTE: This isn't the first guide of how to do this, there are many out there. And this isn't the best server out there but it'll do if you want a quick one.
  • Xin
    Posts: 3,251
    Good paper :), i would say use debian or ubuntu server as xubuntu still wastes CPU with the GUI
    Xin
  • Nice guide. i am using arch for server
  • undead
    Posts: 822
    Nice guide chroniccommand
  • Sh3llc0d3
    Posts: 1,910
    said:


    Good paper :), i would say use debian or ubuntu server as xubuntu still wastes CPU with the GUI



    ...I use an ubuntu image for my VPS and it's running mysql, apache2 and php5... love the combo. Can't think of a reason i'd change.

    i am using arch for server


    Just outta curiosity :P What are you hosting Bursihido? How does Arch run as a server? I would've thought quite good.
  • I love all your threads chronic. Well done written all.
    #!usr/bin/stack3D :)