Setting up a web server with Ubuntu 7.04 desktop linux

On this page I describe how I turned my old work PC into a web server for our work intranet, to host a wiki and so on.

The PC in question was an Athlon 64 2800+ (socket 754), with 1 GB of RAM, and a 120 GB hard disk. I can't recall what graphics card it has but it is something like an Nvidia 5700. It was previously running Windows XP Pro.

In summary, this is what I did:

  • Installed Ubuntu 7.04 “Feisty Fawn” Desktop.
  • Installed gVim text editor.
  • Set up OpenSSH server.
  • Enabled VNC remote access.
  • Installed Apache 2 web server.
  • Installed PHP 5.
  • Set up basic website index page (stored at /var/www ).

Journal

Thursday 4 October 2007

Installed Ubuntu 7.04 “Feisty Fawn” Desktop Edition.

  • Set computer name to hostname
  • Used eth1 (Realtek?) as default network adapter
  • Disk is in 2 partitions - one main one and one small swap.

Installed gVim

  • Did this using “Add/Remove Programs” under GNOME menu.

Installed OpenSSH server

sudo apt-get install openssh-server
  • OpenSSH client config file is: /etc/ssh/ssh_config
  • OpenSSH server config file is: /etc/ssh/sshd_config
  • Made a backup of the server one to sshd_config.original and made it not writeable.
  • Left config file as is for now; set up on port 22.
  • Tested by logging in from local terminal:
ssh hostname
  • Set up custom greeting message by doing the following:
    • Edited /etc/issue.net which is greeting message that will be displayed upon SSH login.
    • Edited /etc/ssh/sshd_config - uncommented a line to show the contents of /etc/issue.net as a banner when someone logs in.
    • Restarted SSH server using:
sudo /etc/init.d/ssh restart
  • Tested by logging in using PuTTY from my main Windows PC.

Enabled VNC access

  • Under GNOME menu went to System | Preferences | Remote Desktop.
  • Allow remote desktop view/control. Set password. No confirmation.
  • Tested using Real VNC viewer client on my main PC.

Tried to install LAMP (Linux/Apache/MySQL/PHP).

  • To install tried:
sudo tasksel install lamp-servero
  • Failed (got message “tasksel: aptitude failed (100)” )

Installed Apache and PHP manually

  • Going to install required stuff manually…
  • DokuWiki requires Apache and PHP
  • To install Apache 2 and PHP 5:
sudo apt-get install apache2
sudo apt-get install libapache2-mod-php5
sudo apt-get install php5
  • At this point typing in http://hostname/ in a web browser brings up an index page.
  • Started creating website by placing a file index.php at /var/www
  • Now going to http://hostname/ brings up that page (where hostname is the name of the PC). :)
  • Confirmed that PHP works (tested by creating a PHP file in the /var/www directory which contains the phpinfo() command and viewing it in a web browser).

Friday 5 October 2007

Installed DokuWiki

tar -zxvf dokuwiki-2007-06-26b.tgz
  • Moved/renamed the folder to /var/www/wiki
  sudo mv dokuwiki-2007-06-26b /var/www/
  cd /var/www
  sudo mv dokuwiki-2007-06-26b wiki
  • Made a backup of the .htaccess to htaccess.original and made it not readable by group/others.
  cd wiki
  cp .htaccess htaccess.original
  chmod og-r htaccess.original
  • Tried to set up DokuWiki by accessing the install file in a web browser http://hostname/wiki/install.php
  • The page reported that it didn't have necessary permissions for some folders and subfolders in the wiki directory.
  • Apache web server runs as its own user (specified in the apache2.conf config file). So it seems like this user doesn't have write access to my /var/www directory. Looking in apache2.conf, it contains the following two lines in there somewhere:
  User www-data
  Group www-data
  • This indicates that Apache is running as user www-data.
  • Changed ownership of my wiki directory:
  cd /var/www
  sudo chown -R www-data:www-data wiki
  • Now the wiki folder and everything within is owned by www-data and in the www-data group.
  • Now opened the install script in a web browser again http://hostname/wiki/install.php
  • This time no errors. Entered wiki basic options and hit OK.
  • Now can delete the install.php.
  cd /var/www/wiki
  sudo rm install.php

Trying to get DokuWiki to send emails

  • Harold tried to register himself as a user on the wiki. It couldn't send him an email with his password. Trying to figure out how to get it to work. See http://wiki.splitbrain.org/wiki:tips:mailconfig
  • Based on advice from that page, edited /etc/php5/apache2/php.ini
  • Changed a line:
sendmail_path = /usr/sbin/sendmail -smailservername -t -i

(where mailservername is the name of the mail server)

  • Restarted Apache:
sudo apache2ctl -k restart
  • Still doesn't work. Realised I don't have sendmail installed. Installed using:
sudo apt-get install sendmail
  • Restarted Apache:
sudo apache2ctl -k restart
  • Still doesn't work.
  • Undid changes to /etc/php5/apache2/php.ini
  • Then tried again using just hostname instead of hostname.domainname.com

Adding new Linux users

  • To add a user:
sudo adduser usernamegoeshere
  • It will prompt for their password, etc.

Still trying to get DokuWiki able to send emails

sudo mv wiki docuwiki-2006-11-06
  • Applied patch:
patch -Np0 < patch.txt
  • Renamed directory back:
sudo mv docuwiki-2006-11-06 wiki
  • Using DokuWiki admin config interface, entered email details that are now visible at the bottom of the config page.
  • Still doesn't work! :(
 
linux/setting_up_web_server_with_ubuntu_704_desktop.txt · Last modified: 2008/04/08 12:10 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki