lab9

.pdf

School

Northern Kentucky University *

*We aren’t endorsed by this school

Course

436

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

4

Uploaded by KidFire12260

CIT 436 Lab 9 Due Monday, March 18 by 8 am (emailed to foxr@nku.edu ) You will install and run Squid in this lab. Boot VM2, open three terminal windows and su to root in each. Open your web browser. In this lab you will be asked to clear your browser history several times. To do this, select the menu button (3 horizontal lines) followed by History > Clear Recent History… and select OK (to clear all settings). Boot VM1 (with your Apache server) and start Apache. Make a note VM1’s IP address. WARNING: Step 1d will take 30-60 minutes; make sure you build that time into your schedule. 1. Exploring the Squid open source package a. In your web browser, go to www.squid-cache.org/Versions/v5 and select the most recent version’s tar.gz download (do not select the sig version). Save the downloaded package. In your terminal window, cd to your account’s Downloads directory. Type ls . You should find the downloaded file here named squid- version .tar.gz such as squid-5.9.tar.gz . Type tar xzf filename and cd into the directory created. Type ls . You will notice a configure script and a Makefile . This allows us to either use ./configure to tailor our installation or go right to the make / make install steps. We will use configure . Answer the following questions about the contents of this directory. i. In which directories do you find the .cc (source code) files? ii. In which directory do you find nothing but .h (header) files? iii. The errors directory contains subdirectories of files in different languages. Look in errors/en (English). What are these files used for? They do not have extensions but you can determine their type by viewing one. What type are they? iv. What type of content is stored in the icons/silk subdirectory? v. Type less INSTALL and look at the installation instructions. What three steps are recommended to compile and install Squid? In which location does it state that you should find the squid configuration file? What option should you use to initialize Squid? b. Type ./configure --help | less and scroll through the information. Without using –-prefix , the Squid components are placed in various directories (see pages 412- 413 of the textbook). Another option is to specify locations for these various components. For each of the following, what ./configure option is used to specify its location? i. user executables ii. system administration executables iii. man pages iv. root directory for all documentation c. Continuing to step through ./configure ’s help, answer the following questions. i. How would you specify less verbose build output (V=1)? ii. How would you enable or disable a feature named foo ? iii. How would you enable or disable a package named foo ? d. Type ./configure . What error message arises? Type dnf -y install g++ openssl-devel . g++ is the GNUs C++ compiler, which is different from gcc and needed to install Squid. The second, openssl-devel installs tools needed by Squid to work with HTTPS (which we add in lab 12). Issue the full command as shown below.
./configure --prefix=/usr/local/squid --enable-auth- helpers=NCSA --enable-ssl-crtd --with-openssl The enable / with options will be used in labs 10 and 12. The ./configure script will take several minutes to complete. Next, type make , which will take 40-60 minutes. e. While make is running, research the difference between gcc and g++ and explain why we are using g++ to compile Squid rather than gcc . Return to your web browser and in the left column select About Squid . What does the page say about the protocols that Squid is written for and is mostly written for? What software products is Squid based on? Who funded Squid, at least in part? When make ends, type make install (make sure you are root for this step). This will only take a couple of minutes. 2. Exploring the installed Squid Server a. (1) Type cd /usr/local/squid . What are the top-level directories? In which directory is the squid program stored? In step 1a, we saw directories of errors , icons and man pages. What subdirectory of squid have they been copied into? b. (1) cd into the var subdirectory. You will find three subdirectories, all of which are either empty or contain a single, empty subdirectory. At what point will each of these subdirectories begin to get populated with content? You may want to defer answering part of this question until you have completed 2c and part of this question you should be able to answer by looking at the subdirectory names. cd back to the top-level squid directory. c. (1) cd to squid/sbin . We use squid to run Squid. Type ./squid -h to view the help page. We start Squid with ./squid , but we can add -k to specify other run options. What are the options available when using -k ? By default, Squid runs in the background but -N runs Squid in the foreground. Look at option -z . What does this option do? Go back to answer the rest of 2b’s questions. d. (1) Type ls ../bin . Two additional programs are squidclient and purge . Attempt to view the man page for each of squid , squidclient and purge . What happens? As with Apache, the man pages are not placed in a default location for man to find them. In our case, the Squid man pages are found under /usr/local/squid/share/man . Update manpath by editing /etc/man_db.conf in vi and add MANDATORY_MANPATH /usr/local/squid/share/man after the three existing MANDATORY_MANPATH entries. Save and exit vi . You can now use man on each of squid , squidclient and purge . Use man to answer the following questions. i. What protocols does squid support? (see the 1 st and 3 rd paragraphs of the description) ii. How does squidclient differ from squid? iii. What does purge do? 3. Running Squid a. (1) cd to the sbin directory. Type ./squid -k parse . This command causes Squid to parse the configuration file to look for errors but does not start Squid. You will likely see lines of Startup or Processing. (2) Type cd /usr/local/squid/etc and load squid.conf into vi . Type G to reach the bottom of the file and add a new line with the text foobar . Save the file and (1) repeat squid -k parse command. Near the bottom
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help