logoISU  

CS469/569 - Linux and Unix Administration and Networking

Spring 2022

Displaying ./code/h9/h9.txt

CS469/569 Assignment #9 - 10 of 11 points

Time to make sure your web server is setup and install some web services on your
virtual machine (ssh to cs469@u## from CS/Effie):

Tasks to be performed:

0) (0pts) Setup the Apache HTTP server. This task should have been completed in
   H7, please see me if you need help with this task. Make your web server
   start on boot (i.e. make /etc/rc.d/rc.httpd executable) and configure
   /etc/httpd/httpd.conf to use /net/web as its document root directory
   (Note: Do NOT change the "server root" directory) and enable PHP, making sure
   that index.php is accepted as a default web page in addition to index.html.
   Make a test index.php file in /net/web and verify that your web server is
   working by browsing to:

   http://effie.indstate.edu:469##/

-- index.php --
<?php
  echo phpinfo();
?>
-- index.php --

  Or you may use the text based "lynx" browser:
   > lynx http://localhost/info.php

1) (1pt) Add an entry in /etc/hosts (man 5 hosts) for your machine in the
  following format:

  <ip-address>	<host-name>.indstate.edu <host-name>

  Substitute <ip-address> and <host-name> for your machines IP address (use
  /sbin/ifconfig eth0 to find it) and host-name respectively (should be u## by
  now)

2) (2pts) Get the drupal tar-ball (in effie:/net/soft/) and extract/install it
  into your web area as /net/web/drupal. (read 'man tar' for information on how
  to extract a tar archive.) It should not have the version number on the
  directory name, so you will have to rename it after extracting it.

  Note: do NOT do any installation scripts at this point - just get the files
  extracted to /net/web/drupal, and check the core/INSTALL.txt file for what
  is needed as a mysql user and database, then move on to number 3).

3) (2pts) Create a MySQL database for your Drupal installation and an associated
  account w/ password for it. L:ook in core/INSTALL.mysql.txt for what is needed.

  Note: the mysqladmin command listed in INSTALL.mysql.txt did not work for me,
  so I instead used the following sequence of commands...
  mysql # run as root, to start mysql
  create user # and choose what the username will be, and give it a password
  create database # choose what the database name will be
  GRANT # get the precise command from core/INSTALL.mysql.txt and make
        # sure to grant for localhost
  flush privileges;

4) (2pts) Finish the Drupal installation. (browse to
   http://effie.indstate.edu:469##/drupal/ and follow the online instructions)

  Note: read ahead in the core/INSTALL.txt problem about problems that may
  happen and how to fix them. I did the following to fix a few of them...
  Use setfacl to give the user apache rwx permission to /net/web/drupal,
    by setting the permission and default permissions for that directory,
    and using the -R option
  Search /etc/httpd/httpd.conf for .htaccess and set AllowOverride there to All
  Search /etc/httpd/httpd.conf for mod_rewrite and uncomment that LoadModule
  Restart the httpd daemon (in /etc/rc.d).
  If you get mysql permission problems, you may need to grant all privileges
  to your drupal user on your drupal database on localhost.

  When it asks for an email address in the drupal installation, you can use
  cs469##@cs.indstate.edu
  For the admin drupal username, use drupal_u##

  You can check your cs469## email on cs using pine, or you can forward it
  to your @sycamores.indstate.edu by editing ~/.forward and putting your
  email address in that file.

  Note that the installation could run for an hour or so, so make sure to start
  it when your computer can stay in one place and connected to the internet
  for a while.

5) (1pt) Get the mediawiki tar-ball (in effie:/net/soft/) and extract/install it
  into your web area as /net/web/wiki.  It should not have the version number on
  the directory name, so you will have to rename it after extracting it.

  Note - do not do any more installation before setting up the wiki database
  and username.
  
6) (1pt) Create a MySQL database for your wiki installation and an associated
  account w/ password for it.

  Note: you may need to grant all privileges to the database to the wiki database
  user, and you may need to flush privileges.
  
7) (2pts) Finish the wiki installation
  (browse to http://effie.indstate.edu:469##/wiki/)

  For the email address, when asked, use cs469##@cs.indstate.edu

  Note that the installation could run for an hour or so, so make sure to start
  it when your computer can stay in one place and connected to the internet
  for a while.

  Note that when the installation is almost complete, it saves LocalSettings.php
  to your computer. You need to transfer it to your u## machine in the
  directory /net/web/wiki/, and you need to make it so the apache user
  can read/execute it (using setfacl).


#####
Things I will do to make sure you have done things right...

For each of the below, ## is your 469 number (11 for me).

0)
In my browser, I will browse to
effie.indstate.edu:469##

1)
ping u##
ping u##.indstate.edu
Both of the above should work when logged in to your system, after you have completed problem 1.

2)
ls /net/web/drupal

3)
mysql
show databases; # and I should see one that looks from the name like you plan
# to use it with drupal
select user from mysql.user; # should see a user that looks from the name like
# plan to use with with drupal;
show grants for DRUPAL_USER on DRUPAL_DB; # substituting in your drupal user and db names

4) Browse to
https://effie.indstate.edu:469##/drupal

5)
ls /net/web/wiki/

6)
Similar to checking for the drupal database user and database

7)
Browse to
https://effie.indstate.edu:469##/wiki

ls -l /net/web/wiki/*.php