Debian Cloud Server setup

Debian Cloud Server setup

Postby stephen » Sun Feb 07, 2010 3:41 pm

I have just obtained a Debian server on CLoud Centrals web sitehttp://www.cloudcentral.com.au/
I have putty ssh access to the console I will document how I set up this machine.

Note to enable web access you need to logon to the Cloud Central Console
and manage your cloud server and manage the network access and ensure allow web access is ticked.

This site has a step by step setup of debian
http://www.howtoforge.com/perfect_setup_debian_etch_p3
This site shows How to install software packages on Debian-Ubuntu
http://www.math-linux.com/spip.php?article80
login as root

find out what apache packages are installed
Code: Select all
dpkg-query -W |grep apache

root@debian:~#
apache2 2.2.14-1
apache2-mpm-prefork 2.2.14-1
apache2-utils 2.2.14-1
apache2.2-bin 2.2.14-1
apache2.2-common 2.2.14-1
libapache2-mod-php5 5.2.11.dfsg.1-1

To get a description of installed packages use
Code: Select all
dpkg -l


To install a software package
Code: Select all
apt-get install firefox


To configure apache
see this web site
http://www.debianadmin.com/apache2-installation-and-configuration-with-php-support-in-debian-linux.html
the server configurations are in /etc/apache2/apache2.conf
the user configurations are in /etc/apache2/httpd.conf

These directories contain more configuration information
# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

the sites-enabled folder contains links to files in sites-available folder
eg
:/etc/apache2# ls -l sites-enabled
total 0
lrwxrwxrwx 1 root root 26 2009-11-06 00:29 000-default -> ../sites-available/default



Code: Select all
vi /etc/apache2/httpd.conf


I tried to restart apache
Code: Select all
/etc/init.d/apache2 restart

and received this error
Restarting web server: apache2apache2: apr_sockaddr_info_get() failed for debian
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
... waiting apache2: apr_sockaddr_info_get() failed for debian
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

The fix was to edit /etc/hostname and add the url to your server in there
eg
Code: Select all
cloud-1.elstar.com.au

then edit /etc/apache2/httpd.conf and add a line
Code: Select all
servername cloud-1.elstar.com.au

The default site is defined in /etc/apache2/sites-available/default
the documentroot is /var/www


to access phpmyadmin
add /phpmyadmin to your url

Some debian commands
Code: Select all
hostname
hostname -f

shutdown -r now
vi /etc/apt/sources.list

// upgrade database
apt-get update

// install latest patches
apt-get upgrade

// install some packages
apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev linux-kernel-headers lynx m4 make ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++

vi /etc/fstab

apt-get install locate

apt-get install bind9

/etc/init.d/bind9 stop

vi /etc/default/bind9
//OPTIONS="-u bind -t /var/lib/named"

mkdir -p /var/lib/named/etc
mkdir /var/lib/named/dev
mkdir -p /var/lib/named/var/cache/bind
mkdir -p /var/lib/named/var/run/bind/run

mv /etc/bind /var/lib/named/etc

ln -s /var/lib/named/etc/bind /etc/bind
mknod /var/lib/named/dev/null c 1 3
mknod /var/lib/named/dev/random c 1 8
chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random
chown -R bind:bind /var/lib/named/var/*
chown -R bind:bind /var/lib/named/etc/bind

apt-get install syslogd

vi /etc/default/syslogd
SYSLOGD="-a /var/lib/named/dev/log"

vi /etc/mysql/my.cnf

/etc/init.d/sysklogd restart

/etc/init.d/mysql restart

netstat -tap

mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword


apt-get install postfix libsasl2 sasl2-bin libsasl2-modules libdb3-util procmail

dpkg-reconfigure postfix

/etc/init.d/postfix restart

vi /etc/apache2/mods-available/dir.conf
vi /etc/apache2/ports.conf

/etc/init.d/apache2 force-reload




Firewalls see
http://wiki.debian.org/Firewalls

How to install pure-ftp on a debian server
http://www.debian-administration.org/articles/383

apt-cache search ftp-server

Install ftp server
apt-get install vsftpd

edit the vsftpd.conf file
vi /etc/vsftpd.conf
Code: Select all
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022
# sjk
local_umask=022



/etc/init.d/vsftpd restart

To create a new user john
adduser john
addgroup webmaster
usermod -G john,webmaster john
cd /var
chgrp webmaster www
chmod 775 www

Change the password of a user
As the root user, you can change the password associated with any user account. The system doesn't ask you for the current password, it immediately prompts for the new password:

Code: Select all
debian:~# passwd newbie
Changing password for newbie
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:
Password changed.


apt-get install proftpd
/etc/init.d/proftpd stop
vi /etc/proftpd/proftpd.conf
stephen
 
Posts: 507
Joined: Thu Feb 09, 2006 9:37 am
Location: Brisbane

Return to Linux Server Configuration Notes

Who is online

Users browsing this forum: No registered users and 3 guests

cron