Results 1 to 1 of 1

Thread: HOWTO: Set up a website and webserver, Part One.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    kshcshbash's Avatar My Good Sir CNSW
    Civitate

    Join Date
    Nov 2005
    Location
    Ontario, Canada
    Posts
    736

    Default HOWTO: Set up a website and webserver, Part One.

    Or, "What CNSW does in the early hours of the morning."

    Herein, I'm going to walk you through making a basic fileserving website. (Actually, I'm making the website that chris_uk_83 asked for, for lack of something better to do with my life. I'm writing the tutorial in real time. Everything you see works.)

    Also, secure the server before you do anything with it.. Right now I'm paying no attention to security whatsoever. If you're on Ubuntu, prefix everything with sudo. If you don't know how to get root on a machine already, you'd be dangerous to yourself with it. Also, commands to run are in italics, my shell output is in spoiler tags.

    Without further ado...

    Section 1:Server side setup
    If you already have your server setup, PHP/MySQL hosting, or for some other reason don't love me enough to read this section, skip to Section 2

    Step One: Get the VPS.
    Personall, I use RapidVPS. Fair pricing and it works. I am using their Level 2 package with Ubuntu 6.10 (I'd usually use Debian, but I thought I'd do something that Desktop users can apply as well). This is all done on a completely vanilla server. Completely, ya hear? I booted clean JUST for this 'tutorial'. Send cookies and gratitude-filled sexual favours to:usr.bin.bash@gmail.com

    The basic concept of a VPS is that it creates a whole new 'fake' computer for you to use. We call this a Virtual Machine. A VPS is a Virtual Private Server. Virtualization software on your host's end of things control everything, but as far as you need to worry, you have complete and total control of your Operating System. That was a crap, explanation. I'm sure you can find a better one floating around the internet somewhere.

    Step Two: SSH haxx0rzz your way in
    Alrighty, you should know the IP of your VPS by this point. SSH is just logging into your server, via the shell. As far as bash (or ksh, csh, zsh, tcsh and so on and so forth) is concerned, you are on the server once you are logged in.
    Just ssh root@<IP ADDRESS>.
    It's rather simple, I'll show you how I did mine.
    Spoiler Alert, click show to read: 

    sanjay@sanjay-desktop:~$ ssh root@204.8.177.24
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that the RSA host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    d7:2c:58:a7:a8:96:5b:fc:fa:24:bc:52:c4:39:c6:3b.
    Please contact your system administrator.
    Add correct host key in /home/sanjay/.ssh/known_hosts to get rid of this message.
    Offending key in /home/sanjay/.ssh/known_hosts:5
    RSA host key for 204.8.177.24 has changed and you have requested strict checking.
    Host key verification failed.
    sanjay@sanjay-desktop:~$ gedit /home/sanjay/.ssh/known_hosts

    You probably won't get this error, but for future reference this is because my server was reformatted for this tutorial. Ubuntu was clever and warned me that the server was NOT the server that I connected to at that IP last time. How to fix it, you ask? Just open up gedit, scroll down to the fifth key. Don't cock it up, by the way. Bad things might happen. A key is basically everything from a "|1|" to the next "|1|". DO NOT DELETE THE SECOND "|1|".
    Example:
    Spoiler Alert, click show to read: 
    |1|idoasi=-0-0ei1e01eidmpas;kidpqwiri11049dadasmpio13-e91j2e2kpasd
    oasdaseuiqoewdoasdnasd=1239?/2312
    djasoietguiorwdc

    |1|...

    Continuing, let SSH do it's stuff.
    Spoiler Alert, click show to read: 

    sanjay@sanjay-desktop:~$ ssh root@204.8.177.24
    The authenticity of host '204.8.177.24 (204.8.177.24)' can't be established.
    RSA key fingerprint is d7:2c:58:a7:a8:96:5b:fc:fa:24:bc:52:c4:39:c6:3b.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '204.8.177.24' (RSA) to the list of known hosts.
    root@204.8.177.24's password:
    Linux sanjay.sodhi.TLD 2.6.9 #2 SMP Fri Sep 29 02:47:35 EDT 2006 i686

    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.
    root@sanjay:~#

    And you're in! Anything you do now will happen on the webserver. And I mean anything.

    [b]Step 3: Update your list of packages[b]
    We're going to set this webserver up by essentially just calling "installer" files, called packages, that are located in the Ubuntu repositories. Before you do install a package, update your list so that you are installing the most up to date version.
    Run the command "apt-get update".
    Spoiler Alert, click show to read: 

    root@sanjay:~# apt-get update
    Get:1 http://us.archive.ubuntu.com edgy Release.gpg [191B]
    Get:2 http://us.archive.ubuntu.com edgy-updates Release.gpg [191B]
    Ign http://us.archive.ubuntu.com edgy-updates/main Translation-en_CA
    Ign http://us.archive.ubuntu.com edgy-updates/restricted Translation-en_CA
    Get:3 http://archive.ubuntu.com edgy Release.gpg [191B]
    Ign http://archive.ubuntu.com edgy/multiverse Translation-en_CA
    Ign http://archive.ubuntu.com edgy/universe Translation-en_CA
    Ign http://archive.ubuntu.com edgy/main Translation-en_CA
    Ign http://archive.ubuntu.com edgy/restricted Translation-en_CA
    Hit http://archive.ubuntu.com edgy Release
    Hit http://us.archive.ubuntu.com edgy Release
    Get:4 http://us.archive.ubuntu.com edgy-updates Release [38.4kB]
    Hit http://archive.ubuntu.com edgy/multiverse Packages
    Hit http://archive.ubuntu.com edgy/universe Packages
    Hit http://archive.ubuntu.com edgy/main Packages
    Hit http://archive.ubuntu.com edgy/restricted Packages
    Hit http://us.archive.ubuntu.com edgy/main Sources
    Hit http://us.archive.ubuntu.com edgy/restricted Sources
    Get:5 http://us.archive.ubuntu.com edgy-updates/main Packages [79.3kB]
    Get:6 http://us.archive.ubuntu.com edgy-updates/restricted Packages [14B]
    Get:7 http://us.archive.ubuntu.com edgy-updates/main Sources [24.0kB]
    Get:8 http://us.archive.ubuntu.com edgy-updates/restricted Sources [14B]
    Fetched 142kB in 8s (16.9kB/s)
    Reading package lists... Done
    root@sanjay:~#

    Et voila! You have an updated package listing. Aren't you just special now?
    Continuing...

    Step 4: Install APACHE2
    Simple enough.
    apt-get install apache2
    While Apache2 installs, I'll tell you what it is. It's the program that gives people your website when they ask for it. It controls EVERYTHING about your server as a "website". Nothing can happen without Apache saying it can. Also, that was complete bollocks. Apache is God. Just, a benevolent God who lets other applications take turns on occassion. Either way, as far as you are concerned, Apache controls the serving of web pages totally and completely. Apache demands that you give CNSW money. CNSW is his prophet.

    Spoiler Alert, click show to read: 

    root@sanjay:~# apt-get install apache2
    Reading package lists... Done
    Building dependency tree... Done
    The following extra packages will be installed:
    apache2-common apache2-mpm-worker openssl ssl-cert
    Suggested packages:
    apache2-doc ca-certificates
    The following NEW packages will be installed:
    apache2 apache2-common apache2-mpm-worker openssl ssl-cert
    0 upgraded, 5 newly installed, 0 to remove and 3 not upgraded.
    Need to get 2055kB of archives.
    After unpacking, 6169kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://archive.ubuntu.com edgy/main openssl 0.9.8b-2ubuntu2 [993kB]
    Get:2 http://archive.ubuntu.com edgy/main ssl-cert 1.0.13 [9526B]
    Get:3 http://archive.ubuntu.com edgy/main apache2-common 2.0.55-4ubuntu4 [807kB]
    Get:4 http://archive.ubuntu.com edgy/main apache2-mpm-worker 2.0.55-4ubuntu4 [209kB]
    Get:5 http://archive.ubuntu.com edgy/main apache2 2.0.55-4ubuntu4 [36.0kB]
    Fetched 2055kB in 8s (237kB/s)
    Preconfiguring packages ...
    Selecting previously deselected package openssl.
    (Reading database ... 13750 files and directories currently installed.)
    Unpacking openssl (from .../openssl_0.9.8b-2ubuntu2_i386.deb) ...
    Creating directory /etc/ssl
    Selecting previously deselected package ssl-cert.
    Unpacking ssl-cert (from .../ssl-cert_1.0.13_all.deb) ...
    Selecting previously deselected package apache2-common.
    Unpacking apache2-common (from .../apache2-common_2.0.55-4ubuntu4_i386.deb) ...
    Selecting previously deselected package apache2-mpm-worker.
    Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.0.55-4ubuntu4_i386.deb) ...
    Selecting previously deselected package apache2.
    Unpacking apache2 (from .../apache2_2.0.55-4ubuntu4_i386.deb) ...
    Setting up openssl (0.9.8b-2ubuntu2) ...

    Setting up ssl-cert (1.0.13) ...

    Setting up apache2-common (2.0.55-4ubuntu4) ...
    Setting Apache2 to Listen on port 80. If this is not desired, please edit /etc/apache2/ports.conf as desired. Note that the Port directive no longer works.
    Module userdir installed; run /etc/init.d/apache2 force-reload to enable.

    Setting up apache2-mpm-worker (2.0.55-4ubuntu4) ...
    * Starting apache 2.0 web server... [ ok ]

    Setting up apache2 (2.0.55-4ubuntu4) ...

    Now go to your IP address! Should have a nice placeholder page:
    Spoiler Alert, click show to read: 

    Congratulations! You have a website!

    Now, your website is complete and utter shite. Let's make it less horrific:

    Step 5: Install PHP
    PHP is like an embedded programming language. Our Lord Apache evaluates all of the logic in your PHP script and then sends it to the client's browser. You'll learn more when you actually learn the PHP language. Until then, the point is that it's cool.
    apt-get install php5 libapache2-mod-php5 php5-curl php5-gd php5-mysql
    While we let that run, I'll explain what the important ones are.
    libapache2-mod-php5 is the package that tells Apache what PHP is and what to do about it
    php5-gd is a powerful image handling library that you will almost certainly come across as you use PHP.
    php5-curl is a library for getting files from FTP, GOPHER, HTTP server.

    PHP5 is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.
    Now you know what PHP is as well! YAY!

    Anyways, here is what you should see:
    Spoiler Alert, click show to read: 

    root@sanjay:~# apt-get install php5 libapache2-mod-php5 php5-curl php5-gd
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
    apache2-mpm-worker
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
    apache2-mpm-prefork ca-certificates defoma file fontconfig-config libcurl3 libfontconfig1 libfreetype6 libgd2-xpm
    libidn11 libjpeg62 libpng12-0 libt1-5 libx11-6 libx11-data libxau6 libxdmcp6 libxml2 libxpm4 php5-common ttf-dejavu
    Suggested packages:
    defoma-doc psfontmgr x-ttcidfont-conf dfontmgr php-pear libfreetype6-dev libgd-tools
    Recommended packages:
    libft-perl xml-core
    The following packages will be REMOVED:
    apache2-mpm-worker
    The following NEW packages will be installed:
    apache2-mpm-prefork ca-certificates defoma file fontconfig-config libapache2-mod-php5 libcurl3 libfontconfig1
    libfreetype6 libgd2-xpm libidn11 libjpeg62 libpng12-0 libt1-5 libx11-6 libx11-data libxau6 libxdmcp6 libxml2 libxpm4 php5
    php5-common php5-curl php5-gd ttf-dejavu
    0 upgraded, 25 newly installed, 1 to remove and 3 not upgraded.
    Need to get 8870kB of archives.
    After unpacking, 21.6MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Get:1 http://archive.ubuntu.com edgy/main libxau6 1:1.0.1-1 [6516B]
    Get:2 http://archive.ubuntu.com edgy/main libxdmcp6 1:1.0.1-1 [10.5kB]
    Get:3 http://archive.ubuntu.com edgy/main libx11-data 2:1.0.3-0ubuntu4 [197kB]
    Get:4 http://archive.ubuntu.com edgy/main libx11-6 2:1.0.3-0ubuntu4 [582kB]
    Get:5 http://archive.ubuntu.com edgy/main file 4.17-2ubuntu1 [31.0kB]
    Get:6 http://archive.ubuntu.com edgy/main apache2-mpm-prefork 2.0.55-4ubuntu4 [206kB]
    Get:7 http://archive.ubuntu.com edgy/main ca-certificates 20050804 [93.2kB]
    Get:8 http://archive.ubuntu.com edgy/main defoma 0.11.10 [78.7kB]
    Get:9 http://archive.ubuntu.com edgy/main ttf-dejavu 2.7-2 [3051kB]
    Get:10 http://archive.ubuntu.com edgy/main fontconfig-config 2.3.2-7ubuntu2 [54.7kB]
    Get:11 http://archive.ubuntu.com edgy/main libxml2 2.6.26.dfsg-2ubuntu4 [741kB]
    Get:12 http://archive.ubuntu.com edgy/main php5-common 5.1.6-1ubuntu2 [139kB]
    Get:13 http://archive.ubuntu.com edgy/main libapache2-mod-php5 5.1.6-1ubuntu2 [2317kB]
    Get:14 http://archive.ubuntu.com edgy/main libidn11 0.6.3-1 [113kB]
    Get:15 http://archive.ubuntu.com edgy/main libcurl3 7.15.4-1ubuntu2 [161kB]
    Get:16 http://archive.ubuntu.com edgy/main libfreetype6 2.2.1-5 [341kB]
    Get:17 http://archive.ubuntu.com edgy/main libfontconfig1 2.3.2-7ubuntu2 [120kB]
    Get:18 http://archive.ubuntu.com edgy/main libjpeg62 6b-13 [82.9kB]
    Get:19 http://archive.ubuntu.com edgy/main libpng12-0 1.2.8rel-5.1 [111kB]
    Get:20 http://archive.ubuntu.com edgy/main libxpm4 1:3.5.5-1 [33.5kB]
    Get:21 http://archive.ubuntu.com edgy/main libgd2-xpm 2.0.33-4ubuntu2 [199kB]
    Get:22 http://archive.ubuntu.com edgy/main libt1-5 5.1.0-2 [140kB]
    Get:23 http://archive.ubuntu.com edgy/main php5 5.1.6-1ubuntu2 [1068B]
    Get:24 http://archive.ubuntu.com edgy/main php5-curl 5.1.6-1ubuntu2 [24.6kB]
    Get:25 http://archive.ubuntu.com edgy/main php5-gd 5.1.6-1ubuntu2 [34.1kB]
    Fetched 8870kB in 15s (583kB/s)
    Preconfiguring packages ...
    dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you request:
    apache2 depends on apache2-mpm-worker (= 2.0.55-4ubuntu4) | apache2-mpm-prefork (= 2.0.55-4ubuntu4) | apache2-mpm-perchild (= 2.0.55-4ubuntu4); however:
    Package apache2-mpm-worker is to be removed.
    Package apache2-mpm-prefork is not installed.
    Package apache2-mpm-perchild is not installed.
    (Reading database ... 14571 files and directories currently installed.)
    Removing apache2-mpm-worker ...
    * Stopping apache 2.0 web server... [ ok ]
    Selecting previously deselected package libxau6.
    (Reading database ... 14566 files and directories currently installed.)
    Unpacking libxau6 (from .../libxau6_1%3a1.0.1-1_i386.deb) ...
    Selecting previously deselected package libxdmcp6.
    Unpacking libxdmcp6 (from .../libxdmcp6_1%3a1.0.1-1_i386.deb) ...
    Selecting previously deselected package libx11-data.
    Unpacking libx11-data (from .../libx11-data_2%3a1.0.3-0ubuntu4_all.deb) ...
    Selecting previously deselected package libx11-6.
    Unpacking libx11-6 (from .../libx11-6_2%3a1.0.3-0ubuntu4_i386.deb) ...
    Selecting previously deselected package file.
    Unpacking file (from .../file_4.17-2ubuntu1_i386.deb) ...
    Selecting previously deselected package apache2-mpm-prefork.
    Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.0.55-4ubuntu4_i386.deb) ...
    Selecting previously deselected package ca-certificates.
    Unpacking ca-certificates (from .../ca-certificates_20050804_all.deb) ...
    Selecting previously deselected package defoma.
    Unpacking defoma (from .../defoma_0.11.10_all.deb) ...
    Selecting previously deselected package ttf-dejavu.
    Unpacking ttf-dejavu (from .../ttf-dejavu_2.7-2_all.deb) ...
    Selecting previously deselected package fontconfig-config.
    Unpacking fontconfig-config (from .../fontconfig-config_2.3.2-7ubuntu2_all.deb) ...
    Selecting previously deselected package libxml2.
    Unpacking libxml2 (from .../libxml2_2.6.26.dfsg-2ubuntu4_i386.deb) ...
    Selecting previously deselected package php5-common.
    Unpacking php5-common (from .../php5-common_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package libapache2-mod-php5.
    Unpacking libapache2-mod-php5 (from .../libapache2-mod-php5_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package libidn11.
    Unpacking libidn11 (from .../libidn11_0.6.3-1_i386.deb) ...
    Selecting previously deselected package libcurl3.
    Unpacking libcurl3 (from .../libcurl3_7.15.4-1ubuntu2_i386.deb) ...
    Selecting previously deselected package libfreetype6.
    Unpacking libfreetype6 (from .../libfreetype6_2.2.1-5_i386.deb) ...
    Selecting previously deselected package libfontconfig1.
    Unpacking libfontconfig1 (from .../libfontconfig1_2.3.2-7ubuntu2_i386.deb) ...
    Selecting previously deselected package libjpeg62.
    Unpacking libjpeg62 (from .../libjpeg62_6b-13_i386.deb) ...
    Selecting previously deselected package libpng12-0.
    Unpacking libpng12-0 (from .../libpng12-0_1.2.8rel-5.1_i386.deb) ...
    Selecting previously deselected package libxpm4.
    Unpacking libxpm4 (from .../libxpm4_1%3a3.5.5-1_i386.deb) ...
    Selecting previously deselected package libgd2-xpm.
    Unpacking libgd2-xpm (from .../libgd2-xpm_2.0.33-4ubuntu2_i386.deb) ...
    Selecting previously deselected package libt1-5.
    Unpacking libt1-5 (from .../libt1-5_5.1.0-2_i386.deb) ...
    Selecting previously deselected package php5.
    Unpacking php5 (from .../php5_5.1.6-1ubuntu2_all.deb) ...
    Selecting previously deselected package php5-curl.
    Unpacking php5-curl (from .../php5-curl_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package php5-gd.
    Unpacking php5-gd (from .../php5-gd_5.1.6-1ubuntu2_i386.deb) ...
    Setting up libxau6 (1.0.1-1) ...

    Setting up libxdmcp6 (1.0.1-1) ...

    Setting up libx11-data (1.0.3-0ubuntu4) ...
    Setting up libx11-6 (1.0.3-0ubuntu4) ...

    Setting up file (4.17-2ubuntu1) ...
    Setting up apache2-mpm-prefork (2.0.55-4ubuntu4) ...
    * Starting apache 2.0 web server... [ ok ]

    Setting up ca-certificates (20050804) ...
    Updating certificates in /etc/ssl/certs....done.

    Setting up defoma (0.11.10) ...

    Setting up ttf-dejavu (2.7-2) ...

    Setting up fontconfig-config (2.3.2-7ubuntu2) ...

    Setting up libxml2 (2.6.26.dfsg-2ubuntu4) ...

    Setting up php5-common (5.1.6-1ubuntu2) ...
    Setting up libapache2-mod-php5 (5.1.6-1ubuntu2) ...
    * Forcing reload of apache 2.0 web server... [ ok ]

    Setting up libidn11 (0.6.3-1) ...

    Setting up libcurl3 (7.15.4-1ubuntu2) ...

    Setting up libfreetype6 (2.2.1-5) ...

    Setting up libfontconfig1 (2.3.2-7ubuntu2) ...

    Setting up libjpeg62 (6b-13) ...

    Setting up libpng12-0 (1.2.8rel-5.1) ...

    Setting up libxpm4 (3.5.5-1) ...

    Setting up libgd2-xpm (2.0.33-4ubuntu2) ...
    Setting up libt1-5 (5.1.0-2) ...

    Setting up php5 (5.1.6-1ubuntu2) ...
    Setting up php5-curl (5.1.6-1ubuntu2) ...

    Setting up php5-gd (5.1.6-1ubuntu2) ...

    root@sanjay:~#



    Now change your directory to where Apache is going to look for all of your website's files.
    cd /var/www/
    Spoiler Alert, click show to read: 

    If you need my shell output for that, quit this tutorial now before you hurt someone

    Let's make sure PHP installed properly. PHP has a neato function that displays everything about your PHP installation. It's rather useful while debugging, but you should definitely keep your phpinfo() out of the public eye once you deploy your site, it has much knowledge that could be used to own your webserver.
    echo '<? phpinfo() ?>' >> phpinfo.php
    Spoiler Alert, click show to read: 

    root@sanjay:/var/www# echo '<? phpinfo(); ?> >> phpinfo.php
    > ;
    > q
    > **** off.
    > ****...I know how to get out of this...
    > ah
    > '
    <? phpinfo(); ?> >> phpinfo.php
    ;
    q
    **** off.
    ****...I know how to get out of this...
    ah

    root@sanjay:/var/www# owned *****.
    -bash: owned: command not found
    root@sanjay:/var/www# echo '<? phpinfo(); ?>'>>phpinfo.php

    And you have PHP! Check it out at <yourip>/phpinfo.php
    Mine:
    Spoiler Alert, click show to read: 




    Step Six: Installing MySQL
    Most PHP applications need some kind of a database behind them. Yours will be no exception! I use MySQL, and you might as well too. If you're using this tutorial you're probably not used to anything else.
    apt-get install php5-mysql mysql-server phpmyadmin
    php5-mysql lets PHP interface with your MySQL server.
    mysql-server IS MySQL.
    phpmyadmin is an excellent web based interface for you to admin your application.
    So...this is taking a while.
    What do you want to talk about? Let's talk about Mastercard. You should get a Mastercard as soon as you are legally eligible. Before, if you can. Old people are more than willing to share as long as you have some kind of scary weapon. Don't be afraid, you need a Mastercard. I mean, the ads are so damn funny...
    Also, its done. Now, SHELL OUTPUT:
    Spoiler Alert, click show to read: 

    root@sanjay:/var/www# apt-get install php5-mysql mysql-server phpmyadmin
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
    libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-common
    mysql-server-5.0 php5-mysqli psmisc
    Suggested packages:
    dbishell libcompress-zlib-perl tinyca
    Recommended packages:
    mailx php5-mcrypt php4-mcrypt
    The following NEW packages will be installed:
    libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-common
    mysql-server mysql-server-5.0 php5-mysql php5-mysqli phpmyadmin psmisc
    0 upgraded, 13 newly installed, 0 to remove and 3 not upgraded.
    Need to get 38.3MB of archives.
    After unpacking, 105MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Get:1 http://archive.ubuntu.com edgy/main psmisc 22.2-1 [49.1kB]
    Get:2 http://us.archive.ubuntu.com edgy-updates/main mysql-common 5.0.24a-9ubuntu2 [42.3kB]
    Get:3 http://us.archive.ubuntu.com edgy-updates/main libmysqlclient15off 5.0.24a-9ubuntu2 [1760kB]
    Get:4 http://archive.ubuntu.com edgy/main libnet-daemon-perl 0.38-1.1 [45.9kB]
    Get:5 http://archive.ubuntu.com edgy/main libplrpc-perl 0.2017-1.1 [35.0kB]
    Get:6 http://archive.ubuntu.com edgy/main libdbi-perl 1.51-2 [640kB]
    Get:7 http://archive.ubuntu.com edgy/main libdbd-mysql-perl 3.0006-1 [138kB]
    Get:8 http://archive.ubuntu.com edgy/main php5-mysqli 5.1.6-1ubuntu2 [39.5kB]
    Get:9 http://archive.ubuntu.com edgy/main php5-mysql 5.1.6-1ubuntu2 [23.1kB]
    Get:10 http://archive.ubuntu.com edgy/universe phpmyadmin 4:2.8.2-0.2 [3607kB]
    Get:11 http://us.archive.ubuntu.com edgy-updates/main mysql-client-5.0 5.0.24a-9ubuntu2 [6956kB]
    Get:12 http://us.archive.ubuntu.com edgy-updates/main mysql-server-5.0 5.0.24a-9ubuntu2 [24.9MB]
    Get:13 http://us.archive.ubuntu.com edgy-updates/main mysql-server 5.0.24a-9ubuntu2 [39.7kB]
    Fetched 38.3MB in 42s (896kB/s)
    Preconfiguring packages ...
    Selecting previously deselected package psmisc.
    (Reading database ... 15249 files and directories currently installed.)
    Unpacking psmisc (from .../psmisc_22.2-1_i386.deb) ...
    Selecting previously deselected package mysql-common.
    Unpacking mysql-common (from .../mysql-common_5.0.24a-9ubuntu2_all.deb) ...
    Selecting previously deselected package libmysqlclient15off.
    Unpacking libmysqlclient15off (from .../libmysqlclient15off_5.0.24a-9ubuntu2_i386.deb) ...
    Selecting previously deselected package libnet-daemon-perl.
    Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.38-1.1_all.deb) ...
    Selecting previously deselected package libplrpc-perl.
    Unpacking libplrpc-perl (from .../libplrpc-perl_0.2017-1.1_all.deb) ...
    Selecting previously deselected package libdbi-perl.
    Unpacking libdbi-perl (from .../libdbi-perl_1.51-2_i386.deb) ...
    Selecting previously deselected package libdbd-mysql-perl.
    Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_3.0006-1_i386.deb) ...
    Selecting previously deselected package mysql-client-5.0.
    Unpacking mysql-client-5.0 (from .../mysql-client-5.0_5.0.24a-9ubuntu2_i386.deb) ...
    Selecting previously deselected package mysql-server-5.0.
    Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.0.24a-9ubuntu2_i386.deb) ...
    Selecting previously deselected package mysql-server.
    Unpacking mysql-server (from .../mysql-server_5.0.24a-9ubuntu2_all.deb) ...
    Selecting previously deselected package php5-mysqli.
    Unpacking php5-mysqli (from .../php5-mysqli_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package php5-mysql.
    Unpacking php5-mysql (from .../php5-mysql_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package phpmyadmin.
    Unpacking phpmyadmin (from .../phpmyadmin_4%3a2.8.2-0.2_all.deb) ...
    Setting up psmisc (22.2-1) ...

    Setting up mysql-common (5.0.24a-9ubuntu2) ...
    Setting up libmysqlclient15off (5.0.24a-9ubuntu2) ...

    Setting up libnet-daemon-perl (0.38-1.1) ...
    Setting up libplrpc-perl (0.2017-1.1) ...
    Setting up libdbi-perl (1.51-2) ...
    Setting up libdbd-mysql-perl (3.0006-1) ...
    Setting up mysql-client-5.0 (5.0.24a-9ubuntu2) ...
    Setting up mysql-server-5.0 (5.0.24a-9ubuntu2) ...
    * Stopping MySQL database server mysqld [ ok ]
    * Starting MySQL database server mysqld [ ok ]
    * Checking for corrupt, not cleanly closed and upgrade needing tables.

    Setting up mysql-server (5.0.24a-9ubuntu2) ...
    Setting up php5-mysql (5.1.6-1ubuntu2) ...

    Setting up php5-mysqli (5.1.6-1ubuntu2) ...

    Setting up phpmyadmin (2.8.2-0.2) ...

    Creating config file /etc/phpmyadmin/apache.conf with new version

    Creating config file /etc/phpmyadmin/config.footer.inc.php with new version

    Creating config file /etc/phpmyadmin/config.header.inc.php with new version

    Creating config file /etc/phpmyadmin/config.inc.php with new version

    Creating config file /etc/phpmyadmin/htaccess with new version

    root@sanjay:/var/www#

    You currently have no root password. No root password whatsoever. How does that make you feel? On second thought, I don't give a ****. Check out that everything works via phpmyadmin.
    Log in with the username root and a blank password.
    Spoiler Alert, click show to read: 



    Click on "Privileges" and then the edit button next to "root". It's actually an image with something that resembles a pen on it. Scroll down to find the password box.
    If you managed to cock this up, there's a whole tutorial on it here.

    [u]Step Six: FTP[/url]
    This bit gave me most hassles. I'll get you started with an anonymous user. FTP basically lets you get files onto your webserver in the first place.
    apt-get install proftpd
    I chose inted mode. You should too. Unless you're an experienced webmaster serving a large community who is reading my five am rant about webservers for guidance.

    Spoiler Alert, click show to read: 

    root@sanjay:/var/www# apt-get install proftpd
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
    libpq4
    Suggested packages:
    proftpd-doc
    The following NEW packages will be installed:
    libpq4 proftpd
    0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
    Need to get 795kB of archives.
    After unpacking, 2294kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://archive.ubuntu.com edgy/main libpq4 8.1.4-7 [202kB]
    Get:2 http://archive.ubuntu.com edgy/universe proftpd 1.3.0-9 [593kB]
    Fetched 795kB in 1s (537kB/s)
    Preconfiguring packages ...
    Selecting previously deselected package libpq4.
    (Reading database ... 17586 files and directories currently installed.)
    Unpacking libpq4 (from .../libpq4_8.1.4-7_i386.deb) ...
    Selecting previously deselected package proftpd.
    Unpacking proftpd (from .../proftpd_1.3.0-9_i386.deb) ...
    Setting up libpq4 (8.1.4-7) ...

    Setting up proftpd (1.3.0-9) ...
    Adding system user `proftpd' with uid 105...
    Adding new user `proftpd' (105) with group `nogroup'.
    Not creating home directory `/var/run/proftpd'.
    Adding system user `ftp' with uid 106...
    Adding new user `ftp' (106) with group `nogroup'.
    Creating home directory `/home/ftp'.
    `/usr/share/proftpd/templates/welcome.msg' -> `/home/ftp/welcome.msg.proftpd-new'
    ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.

    root@sanjay:/var/www#


    For some reason, it is being a whore. Change your proftpd configuration to go to standalone, manually.
    vi /etc/proftpd/proftpd.conf
    I'll introduce you to vi:
    Press the down arrow until you're on the line beggining "ServerType inetd"
    Press the right arrow until you're on the first "i"
    Press x a few times to delete the word inetd
    Now, type standalone.
    It should now read exactly the same as it did before, only with standalone on there instead.
    Spoiler Alert, click show to read: 

    root@sanjay:/var/www# vi /etc/proftpd/proftpd.conf
    root@sanjay:/var/www# /etc/init.d/proftpd restart

    Also, it doesn't work yet.
    cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup BACKUP before we do anything else. I'm guessing hereinafter.

    THE FTP SECTION IS NOT COMPLETE. I WILL COMPLETE IT WHEN I FIGURE IT OUT AND IT ISN'T APPROACHING 6AM. OH ****...I NEED SLEEP.

    Feedback, please.

    I'll update tomorrow (well, today) with getting your PHP coded and FTP'ing it up.
    For the sceptics among you, have my complete shell session.
    Spoiler Alert, click show to read: 

    sanjay@sanjay-desktop:~$ ssh root@204.8.177.24
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that the RSA host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    d7:2c:58:a7:a8:96:5b:fc:fa:24:bc:52:c4:39:c6:3b.
    Please contact your system administrator.
    Add correct host key in /home/sanjay/.ssh/known_hosts to get rid of this message.
    Offending key in /home/sanjay/.ssh/known_hosts:5
    RSA host key for 204.8.177.24 has changed and you have requested strict checking.
    Host key verification failed.
    sanjay@sanjay-desktop:~$ gedit /home/sanjay/.ssh/known_hosts
    sanjay@sanjay-desktop:~$ ssh root@204.8.177.24
    The authenticity of host '204.8.177.24 (204.8.177.24)' can't be established.
    RSA key fingerprint is d7:2c:58:a7:a8:96:5b:fc:fa:24:bc:52:c4:39:c6:3b.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '204.8.177.24' (RSA) to the list of known hosts.
    root@204.8.177.24's password:
    Linux sanjay.sodhi.TLD 2.6.9 #2 SMP Fri Sep 29 02:47:35 EDT 2006 i686

    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.
    root@sanjay:~# apt-get update
    Get:1 http://us.archive.ubuntu.com edgy Release.gpg [191B]
    Get:2 http://us.archive.ubuntu.com edgy-updates Release.gpg [191B]
    Ign http://us.archive.ubuntu.com edgy-updates/main Translation-en_CA
    Ign http://us.archive.ubuntu.com edgy-updates/restricted Translation-en_CA
    Get:3 http://archive.ubuntu.com edgy Release.gpg [191B]
    Ign http://archive.ubuntu.com edgy/multiverse Translation-en_CA
    Ign http://archive.ubuntu.com edgy/universe Translation-en_CA
    Ign http://archive.ubuntu.com edgy/main Translation-en_CA
    Ign http://archive.ubuntu.com edgy/restricted Translation-en_CA
    Hit http://archive.ubuntu.com edgy Release
    Hit http://us.archive.ubuntu.com edgy Release
    Get:4 http://us.archive.ubuntu.com edgy-updates Release [38.4kB]
    Hit http://archive.ubuntu.com edgy/multiverse Packages
    Hit http://archive.ubuntu.com edgy/universe Packages
    Hit http://archive.ubuntu.com edgy/main Packages
    Hit http://archive.ubuntu.com edgy/restricted Packages
    Hit http://us.archive.ubuntu.com edgy/main Sources
    Hit http://us.archive.ubuntu.com edgy/restricted Sources
    Get:5 http://us.archive.ubuntu.com edgy-updates/main Packages [79.3kB]
    Get:6 http://us.archive.ubuntu.com edgy-updates/restricted Packages [14B]
    Get:7 http://us.archive.ubuntu.com edgy-updates/main Sources [24.0kB]
    Get:8 http://us.archive.ubuntu.com edgy-updates/restricted Sources [14B]
    Fetched 142kB in 8s (16.9kB/s)
    Reading package lists... Done
    root@sanjay:~#
    root@sanjay:~# apt-get install apache2
    Reading package lists... Done
    Building dependency tree... Done
    The following extra packages will be installed:
    apache2-common apache2-mpm-worker openssl ssl-cert
    Suggested packages:
    apache2-doc ca-certificates
    The following NEW packages will be installed:
    apache2 apache2-common apache2-mpm-worker openssl ssl-cert
    0 upgraded, 5 newly installed, 0 to remove and 3 not upgraded.
    Need to get 2055kB of archives.
    After unpacking, 6169kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://archive.ubuntu.com edgy/main openssl 0.9.8b-2ubuntu2 [993kB]
    Get:2 http://archive.ubuntu.com edgy/main ssl-cert 1.0.13 [9526B]
    Get:3 http://archive.ubuntu.com edgy/main apache2-common 2.0.55-4ubuntu4 [807kB]
    Get:4 http://archive.ubuntu.com edgy/main apache2-mpm-worker 2.0.55-4ubuntu4 [209kB]
    Get:5 http://archive.ubuntu.com edgy/main apache2 2.0.55-4ubuntu4 [36.0kB]
    Fetched 2055kB in 8s (237kB/s)
    Preconfiguring packages ...
    Selecting previously deselected package openssl.
    (Reading database ... 13750 files and directories currently installed.)
    Unpacking openssl (from .../openssl_0.9.8b-2ubuntu2_i386.deb) ...
    Creating directory /etc/ssl
    Selecting previously deselected package ssl-cert.
    Unpacking ssl-cert (from .../ssl-cert_1.0.13_all.deb) ...
    Selecting previously deselected package apache2-common.
    Unpacking apache2-common (from .../apache2-common_2.0.55-4ubuntu4_i386.deb) ...
    Selecting previously deselected package apache2-mpm-worker.
    Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.0.55-4ubuntu4_i386.deb) ...
    Selecting previously deselected package apache2.
    Unpacking apache2 (from .../apache2_2.0.55-4ubuntu4_i386.deb) ...
    Setting up openssl (0.9.8b-2ubuntu2) ...

    Setting up ssl-cert (1.0.13) ...

    Setting up apache2-common (2.0.55-4ubuntu4) ...
    Setting Apache2 to Listen on port 80. If this is not desired, please edit /etc/apache2/ports.conf as desired. Note that the Port directive no longer works.
    Module userdir installed; run /etc/init.d/apache2 force-reload to enable.

    Setting up apache2-mpm-worker (2.0.55-4ubuntu4) ...
    * Starting apache 2.0 web server... [ ok ]

    Setting up apache2 (2.0.55-4ubuntu4) ...
    root@sanjay:~# apt-get install php5 libapache2-mod-php5 php5-curl php5-gd
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
    apache2-mpm-worker
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
    apache2-mpm-prefork ca-certificates defoma file fontconfig-config libcurl3 libfontconfig1 libfreetype6 libgd2-xpm
    libidn11 libjpeg62 libpng12-0 libt1-5 libx11-6 libx11-data libxau6 libxdmcp6 libxml2 libxpm4 php5-common ttf-dejavu
    Suggested packages:
    defoma-doc psfontmgr x-ttcidfont-conf dfontmgr php-pear libfreetype6-dev libgd-tools
    Recommended packages:
    libft-perl xml-core
    The following packages will be REMOVED:
    apache2-mpm-worker
    The following NEW packages will be installed:
    apache2-mpm-prefork ca-certificates defoma file fontconfig-config libapache2-mod-php5 libcurl3 libfontconfig1
    libfreetype6 libgd2-xpm libidn11 libjpeg62 libpng12-0 libt1-5 libx11-6 libx11-data libxau6 libxdmcp6 libxml2 libxpm4 php5
    php5-common php5-curl php5-gd ttf-dejavu
    0 upgraded, 25 newly installed, 1 to remove and 3 not upgraded.
    Need to get 8870kB of archives.
    After unpacking, 21.6MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Get:1 http://archive.ubuntu.com edgy/main libxau6 1:1.0.1-1 [6516B]
    Get:2 http://archive.ubuntu.com edgy/main libxdmcp6 1:1.0.1-1 [10.5kB]
    Get:3 http://archive.ubuntu.com edgy/main libx11-data 2:1.0.3-0ubuntu4 [197kB]
    Get:4 http://archive.ubuntu.com edgy/main libx11-6 2:1.0.3-0ubuntu4 [582kB]
    Get:5 http://archive.ubuntu.com edgy/main file 4.17-2ubuntu1 [31.0kB]
    Get:6 http://archive.ubuntu.com edgy/main apache2-mpm-prefork 2.0.55-4ubuntu4 [206kB]
    Get:7 http://archive.ubuntu.com edgy/main ca-certificates 20050804 [93.2kB]
    Get:8 http://archive.ubuntu.com edgy/main defoma 0.11.10 [78.7kB]
    Get:9 http://archive.ubuntu.com edgy/main ttf-dejavu 2.7-2 [3051kB]
    Get:10 http://archive.ubuntu.com edgy/main fontconfig-config 2.3.2-7ubuntu2 [54.7kB]
    Get:11 http://archive.ubuntu.com edgy/main libxml2 2.6.26.dfsg-2ubuntu4 [741kB]
    Get:12 http://archive.ubuntu.com edgy/main php5-common 5.1.6-1ubuntu2 [139kB]
    Get:13 http://archive.ubuntu.com edgy/main libapache2-mod-php5 5.1.6-1ubuntu2 [2317kB]
    Get:14 http://archive.ubuntu.com edgy/main libidn11 0.6.3-1 [113kB]
    Get:15 http://archive.ubuntu.com edgy/main libcurl3 7.15.4-1ubuntu2 [161kB]
    Get:16 http://archive.ubuntu.com edgy/main libfreetype6 2.2.1-5 [341kB]
    Get:17 http://archive.ubuntu.com edgy/main libfontconfig1 2.3.2-7ubuntu2 [120kB]
    Get:18 http://archive.ubuntu.com edgy/main libjpeg62 6b-13 [82.9kB]
    Get:19 http://archive.ubuntu.com edgy/main libpng12-0 1.2.8rel-5.1 [111kB]
    Get:20 http://archive.ubuntu.com edgy/main libxpm4 1:3.5.5-1 [33.5kB]
    Get:21 http://archive.ubuntu.com edgy/main libgd2-xpm 2.0.33-4ubuntu2 [199kB]
    Get:22 http://archive.ubuntu.com edgy/main libt1-5 5.1.0-2 [140kB]
    Get:23 http://archive.ubuntu.com edgy/main php5 5.1.6-1ubuntu2 [1068B]
    Get:24 http://archive.ubuntu.com edgy/main php5-curl 5.1.6-1ubuntu2 [24.6kB]
    Get:25 http://archive.ubuntu.com edgy/main php5-gd 5.1.6-1ubuntu2 [34.1kB]
    Fetched 8870kB in 15s (583kB/s)
    Preconfiguring packages ...
    dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you request:
    apache2 depends on apache2-mpm-worker (= 2.0.55-4ubuntu4) | apache2-mpm-prefork (= 2.0.55-4ubuntu4) | apache2-mpm-perchild (= 2.0.55-4ubuntu4); however:
    Package apache2-mpm-worker is to be removed.
    Package apache2-mpm-prefork is not installed.
    Package apache2-mpm-perchild is not installed.
    (Reading database ... 14571 files and directories currently installed.)
    Removing apache2-mpm-worker ...
    * Stopping apache 2.0 web server... [ ok ]
    Selecting previously deselected package libxau6.
    (Reading database ... 14566 files and directories currently installed.)
    Unpacking libxau6 (from .../libxau6_1%3a1.0.1-1_i386.deb) ...
    Selecting previously deselected package libxdmcp6.
    Unpacking libxdmcp6 (from .../libxdmcp6_1%3a1.0.1-1_i386.deb) ...
    Selecting previously deselected package libx11-data.
    Unpacking libx11-data (from .../libx11-data_2%3a1.0.3-0ubuntu4_all.deb) ...
    Selecting previously deselected package libx11-6.
    Unpacking libx11-6 (from .../libx11-6_2%3a1.0.3-0ubuntu4_i386.deb) ...
    Selecting previously deselected package file.
    Unpacking file (from .../file_4.17-2ubuntu1_i386.deb) ...
    Selecting previously deselected package apache2-mpm-prefork.
    Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.0.55-4ubuntu4_i386.deb) ...
    Selecting previously deselected package ca-certificates.
    Unpacking ca-certificates (from .../ca-certificates_20050804_all.deb) ...
    Selecting previously deselected package defoma.
    Unpacking defoma (from .../defoma_0.11.10_all.deb) ...
    Selecting previously deselected package ttf-dejavu.
    Unpacking ttf-dejavu (from .../ttf-dejavu_2.7-2_all.deb) ...
    Selecting previously deselected package fontconfig-config.
    Unpacking fontconfig-config (from .../fontconfig-config_2.3.2-7ubuntu2_all.deb) ...
    Selecting previously deselected package libxml2.
    Unpacking libxml2 (from .../libxml2_2.6.26.dfsg-2ubuntu4_i386.deb) ...
    Selecting previously deselected package php5-common.
    Unpacking php5-common (from .../php5-common_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package libapache2-mod-php5.
    Unpacking libapache2-mod-php5 (from .../libapache2-mod-php5_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package libidn11.
    Unpacking libidn11 (from .../libidn11_0.6.3-1_i386.deb) ...
    Selecting previously deselected package libcurl3.
    Unpacking libcurl3 (from .../libcurl3_7.15.4-1ubuntu2_i386.deb) ...
    Selecting previously deselected package libfreetype6.
    Unpacking libfreetype6 (from .../libfreetype6_2.2.1-5_i386.deb) ...
    Selecting previously deselected package libfontconfig1.
    Unpacking libfontconfig1 (from .../libfontconfig1_2.3.2-7ubuntu2_i386.deb) ...
    Selecting previously deselected package libjpeg62.
    Unpacking libjpeg62 (from .../libjpeg62_6b-13_i386.deb) ...
    Selecting previously deselected package libpng12-0.
    Unpacking libpng12-0 (from .../libpng12-0_1.2.8rel-5.1_i386.deb) ...
    Selecting previously deselected package libxpm4.
    Unpacking libxpm4 (from .../libxpm4_1%3a3.5.5-1_i386.deb) ...
    Selecting previously deselected package libgd2-xpm.
    Unpacking libgd2-xpm (from .../libgd2-xpm_2.0.33-4ubuntu2_i386.deb) ...
    Selecting previously deselected package libt1-5.
    Unpacking libt1-5 (from .../libt1-5_5.1.0-2_i386.deb) ...
    Selecting previously deselected package php5.
    Unpacking php5 (from .../php5_5.1.6-1ubuntu2_all.deb) ...
    Selecting previously deselected package php5-curl.
    Unpacking php5-curl (from .../php5-curl_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package php5-gd.
    Unpacking php5-gd (from .../php5-gd_5.1.6-1ubuntu2_i386.deb) ...
    Setting up libxau6 (1.0.1-1) ...

    Setting up libxdmcp6 (1.0.1-1) ...

    Setting up libx11-data (1.0.3-0ubuntu4) ...
    Setting up libx11-6 (1.0.3-0ubuntu4) ...

    Setting up file (4.17-2ubuntu1) ...
    Setting up apache2-mpm-prefork (2.0.55-4ubuntu4) ...
    * Starting apache 2.0 web server... [ ok ]

    Setting up ca-certificates (20050804) ...
    Updating certificates in /etc/ssl/certs....done.

    Setting up defoma (0.11.10) ...

    Setting up ttf-dejavu (2.7-2) ...

    Setting up fontconfig-config (2.3.2-7ubuntu2) ...

    Setting up libxml2 (2.6.26.dfsg-2ubuntu4) ...

    Setting up php5-common (5.1.6-1ubuntu2) ...
    Setting up libapache2-mod-php5 (5.1.6-1ubuntu2) ...
    * Forcing reload of apache 2.0 web server... [ ok ]

    Setting up libidn11 (0.6.3-1) ...

    Setting up libcurl3 (7.15.4-1ubuntu2) ...

    Setting up libfreetype6 (2.2.1-5) ...

    Setting up libfontconfig1 (2.3.2-7ubuntu2) ...

    Setting up libjpeg62 (6b-13) ...

    Setting up libpng12-0 (1.2.8rel-5.1) ...

    Setting up libxpm4 (3.5.5-1) ...

    Setting up libgd2-xpm (2.0.33-4ubuntu2) ...
    Setting up libt1-5 (5.1.0-2) ...

    Setting up php5 (5.1.6-1ubuntu2) ...
    Setting up php5-curl (5.1.6-1ubuntu2) ...

    Setting up php5-gd (5.1.6-1ubuntu2) ...

    root@sanjay:~# cd /var/www/
    root@sanjay:/var/www# echo '<? phpinfo(); ?> >> phpinfo.php
    > ;
    > q
    > **** off.
    > ****...I know how to get out of this...
    > ah
    > '
    <? phpinfo(); ?> >> phpinfo.php
    ;
    q
    **** off.
    ****...I know how to get out of this...
    ah

    root@sanjay:/var/www# owned *****.
    -bash: owned: command not found
    root@sanjay:/var/www# echo '<? phpinfo(); ?>'>>phpinfo.php
    root@sanjay:/var/www# apt-get install php5-mysql mysql-server phpmyadmin
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
    libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-common
    mysql-server-5.0 php5-mysqli psmisc
    Suggested packages:
    dbishell libcompress-zlib-perl tinyca
    Recommended packages:
    mailx php5-mcrypt php4-mcrypt
    The following NEW packages will be installed:
    libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-common
    mysql-server mysql-server-5.0 php5-mysql php5-mysqli phpmyadmin psmisc
    0 upgraded, 13 newly installed, 0 to remove and 3 not upgraded.
    Need to get 38.3MB of archives.
    After unpacking, 105MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Get:1 http://archive.ubuntu.com edgy/main psmisc 22.2-1 [49.1kB]
    Get:2 http://us.archive.ubuntu.com edgy-updates/main mysql-common 5.0.24a-9ubuntu2 [42.3kB]
    Get:3 http://us.archive.ubuntu.com edgy-updates/main libmysqlclient15off 5.0.24a-9ubuntu2 [1760kB]
    Get:4 http://archive.ubuntu.com edgy/main libnet-daemon-perl 0.38-1.1 [45.9kB]
    Get:5 http://archive.ubuntu.com edgy/main libplrpc-perl 0.2017-1.1 [35.0kB]
    Get:6 http://archive.ubuntu.com edgy/main libdbi-perl 1.51-2 [640kB]
    Get:7 http://archive.ubuntu.com edgy/main libdbd-mysql-perl 3.0006-1 [138kB]
    Get:8 http://archive.ubuntu.com edgy/main php5-mysqli 5.1.6-1ubuntu2 [39.5kB]
    Get:9 http://archive.ubuntu.com edgy/main php5-mysql 5.1.6-1ubuntu2 [23.1kB]
    Get:10 http://archive.ubuntu.com edgy/universe phpmyadmin 4:2.8.2-0.2 [3607kB]
    Get:11 http://us.archive.ubuntu.com edgy-updates/main mysql-client-5.0 5.0.24a-9ubuntu2 [6956kB]
    Get:12 http://us.archive.ubuntu.com edgy-updates/main mysql-server-5.0 5.0.24a-9ubuntu2 [24.9MB]
    Get:13 http://us.archive.ubuntu.com edgy-updates/main mysql-server 5.0.24a-9ubuntu2 [39.7kB]
    Fetched 38.3MB in 42s (896kB/s)
    Preconfiguring packages ...
    Selecting previously deselected package psmisc.
    (Reading database ... 15249 files and directories currently installed.)
    Unpacking psmisc (from .../psmisc_22.2-1_i386.deb) ...
    Selecting previously deselected package mysql-common.
    Unpacking mysql-common (from .../mysql-common_5.0.24a-9ubuntu2_all.deb) ...
    Selecting previously deselected package libmysqlclient15off.
    Unpacking libmysqlclient15off (from .../libmysqlclient15off_5.0.24a-9ubuntu2_i386.deb) ...
    Selecting previously deselected package libnet-daemon-perl.
    Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.38-1.1_all.deb) ...
    Selecting previously deselected package libplrpc-perl.
    Unpacking libplrpc-perl (from .../libplrpc-perl_0.2017-1.1_all.deb) ...
    Selecting previously deselected package libdbi-perl.
    Unpacking libdbi-perl (from .../libdbi-perl_1.51-2_i386.deb) ...
    Selecting previously deselected package libdbd-mysql-perl.
    Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_3.0006-1_i386.deb) ...
    Selecting previously deselected package mysql-client-5.0.
    Unpacking mysql-client-5.0 (from .../mysql-client-5.0_5.0.24a-9ubuntu2_i386.deb) ...
    Selecting previously deselected package mysql-server-5.0.
    Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.0.24a-9ubuntu2_i386.deb) ...
    Selecting previously deselected package mysql-server.
    Unpacking mysql-server (from .../mysql-server_5.0.24a-9ubuntu2_all.deb) ...
    Selecting previously deselected package php5-mysqli.
    Unpacking php5-mysqli (from .../php5-mysqli_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package php5-mysql.
    Unpacking php5-mysql (from .../php5-mysql_5.1.6-1ubuntu2_i386.deb) ...
    Selecting previously deselected package phpmyadmin.
    Unpacking phpmyadmin (from .../phpmyadmin_4%3a2.8.2-0.2_all.deb) ...
    Setting up psmisc (22.2-1) ...

    Setting up mysql-common (5.0.24a-9ubuntu2) ...
    Setting up libmysqlclient15off (5.0.24a-9ubuntu2) ...

    Setting up libnet-daemon-perl (0.38-1.1) ...
    Setting up libplrpc-perl (0.2017-1.1) ...
    Setting up libdbi-perl (1.51-2) ...
    Setting up libdbd-mysql-perl (3.0006-1) ...
    Setting up mysql-client-5.0 (5.0.24a-9ubuntu2) ...
    Setting up mysql-server-5.0 (5.0.24a-9ubuntu2) ...
    * Stopping MySQL database server mysqld [ ok ]
    * Starting MySQL database server mysqld [ ok ]
    * Checking for corrupt, not cleanly closed and upgrade needing tables.

    Setting up mysql-server (5.0.24a-9ubuntu2) ...
    Setting up php5-mysql (5.1.6-1ubuntu2) ...

    Setting up php5-mysqli (5.1.6-1ubuntu2) ...

    Setting up phpmyadmin (2.8.2-0.2) ...

    Creating config file /etc/phpmyadmin/apache.conf with new version

    Creating config file /etc/phpmyadmin/config.footer.inc.php with new version

    Creating config file /etc/phpmyadmin/config.header.inc.php with new version

    Creating config file /etc/phpmyadmin/config.inc.php with new version

    Creating config file /etc/phpmyadmin/htaccess with new version

    root@sanjay:/var/www# apt-get install proftpd
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
    libpq4
    Suggested packages:
    proftpd-doc
    The following NEW packages will be installed:
    libpq4 proftpd
    0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
    Need to get 795kB of archives.
    After unpacking, 2294kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Get:1 http://archive.ubuntu.com edgy/main libpq4 8.1.4-7 [202kB]
    Get:2 http://archive.ubuntu.com edgy/universe proftpd 1.3.0-9 [593kB]
    Fetched 795kB in 1s (537kB/s)
    Preconfiguring packages ...
    Selecting previously deselected package libpq4.
    (Reading database ... 17586 files and directories currently installed.)
    Unpacking libpq4 (from .../libpq4_8.1.4-7_i386.deb) ...
    Selecting previously deselected package proftpd.
    Unpacking proftpd (from .../proftpd_1.3.0-9_i386.deb) ...
    Setting up libpq4 (8.1.4-7) ...

    Setting up proftpd (1.3.0-9) ...
    Adding system user `proftpd' with uid 105...
    Adding new user `proftpd' (105) with group `nogroup'.
    Not creating home directory `/var/run/proftpd'.
    Adding system user `ftp' with uid 106...
    Adding new user `ftp' (106) with group `nogroup'.
    Creating home directory `/home/ftp'.
    `/usr/share/proftpd/templates/welcome.msg' -> `/home/ftp/welcome.msg.proftpd-new'
    ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.

    root@sanjay:/var/www# /etc/init.d/protftpd
    -bash: /etc/init.d/protftpd: No such file or directory
    root@sanjay:/var/www# proftpd
    - IPv6 getaddrinfo 'sanjay.sodhi.TLD' error: Name or service not known
    sanjay.sodhi.TLD - fatal: Socket operation on non-socket
    root@sanjay:/var/www# apt-get remove proftpd
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
    proftpd libpq4
    Use 'apt-get autoremove' to remove them.
    The following packages will be REMOVED:
    proftpd
    0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
    Need to get 0B of archives.
    After unpacking, 1544kB disk space will be freed.
    Do you want to continue [Y/n]? Y
    (Reading database ... 17649 files and directories currently installed.)
    Removing proftpd ...
    ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.
    root@sanjay:/var/www# Oh well **** you. I bet I can make it run in standalone.
    -bash: Oh: command not found
    root@sanjay:/var/www# Wanna bet?
    -bash: Wanna: command not found
    root@sanjay:/var/www# You're on...
    > Not this again. I know what to do!'
    -bash: Youre on...
    Not this again. I know what to do!: command not found
    root@sanjay:/var/www# vi /etc/proftpd/proftpd.conf
    root@sanjay:/var/www#
    root@sanjay:/var/www# /etc/init.d/proftpd restart
    root@sanjay:/var/www# netstat -a
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0 *:www *:* LISTEN
    tcp 0 0 *:ssh *:* LISTEN
    tcp 0 0 sanjay.sodhi.TLD:mysql *:* LISTEN
    tcp 0 224 sanjay.sodhi.TLD:ssh CPE0013102d9e78-C:42589 ESTABLISHED
    Active UNIX domain sockets (servers and established)
    Proto RefCnt Flags Type State I-Node Path
    unix 4 [ ] DGRAM 1324323816 /dev/log
    unix 2 [ ACC ] STREAM LISTENING 1327397020 /var/run/mysqld/mysqld.sock
    unix 2 [ ] DGRAM 1327384151
    unix 2 [ ] DGRAM 1324324001
    root@sanjay:/var/www#



    Sorry for the poorly writtenness and incompleteness. I'll finish, I promise.



    INDEX OF COMMANDS:
    ssh root@<IP ADDRESS>
    apt-get update
    apt-get install apache2
    apt-get install php5 libapache2-mod-php5 php5-curl php5-gd php5-mysql
    cd /var/www/
    echo '<? phpinfo() ?>' >> phpinfo.php
    apt-get install php5-mysql mysql-server phpmyadmin
    apt-get install proftpd
    Last edited by kshcshbash; April 29, 2007 at 05:31 AM. Reason: Index of commands
    Simetrical's homeboy, yo.
    You take the blue pill and the story ends. You wake in your bed and you believe whatever you want to believe. You take the red pill and you stay in Wonderland and I show you how deep the rabbit-hole goes. Remember -- all I am offering is the truth, nothing more.

    Sign up to learn Java!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •