Lab #10 - Users & Groups and the Apache Webserver

Lab Steps:


Creating Users and Groups via GUI A. Select System > Administration > Users and Groups from the GNOME menu. B. Provide your root password when prompted. Click OK. C. Click the Add User button. D. Enter tempuser as the username, Temporary User as the full name, and tdummy as the password for the new account. Click OK when you are done configuring the account. E. Click the Add Group button, and name your new group webdev. Click the OK button. F. Click the Groups tab and double-click the webdev group. G. Click the Group Users tab and click the box for tempuser and your username. Click OK. H. Close the User Manager when finished. Creating Users and Groups via CLI A. Open Terminal and type su - root and enter your root password. B. Type useradd -c “Lab Rat” lrat to add the user lrat to the system. C. Type usermod -a -G webdev lrat to append the user lrat to the webdev group. 1. Note: Itʼs important to use the ʻaʼ option otherwise you will overwrite all users in that group. D. Use the tail command on /etc/passwd and then on /etc/group to see your changes. E. Use tail on the file /etc/shadow and note that lrat has two exclamation points rather than a password hash -- this is because lrat doesnʼt have a password yet. F. Type passwd lrat to set a password on the lrat user account. Set the password to labratsrule. G. Check the /etc/shadow file again and you will now see a hashed password for labrat.


II. Configuring the httpd.conf Apache Configuration File A. Open a Terminal if you donʼt already have one and then su - root B. Configure Apache to listen on port 8080. C. Replace the root@localhost for “ServerAdmin” with an e-mail you own. D. Turn “ServerSignature” off. E. Uncomment the “ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var” line. F. Change the “Timeout” directive from 120 to 150 seconds. G. Save your changes and restart Apache by typing /etc/init.d/httpd start H. Configure Apache to start on system-start by running chkconfig --levels 345 httpd on III. Configuring Web Root Permissions and Ownership A. Add your user to the webdev group if you havenʼt already. 1. Note: You can confirm that your user is in this group already by checking /etc/group B. Use the command chmod 775 /var/www/html to change permissions on the web root. C. Next type chown root:webdev /var/www/html to change ownership of the directory. D. Type exit to become your regular user again. Type whoami to verify this after you exit. E. As your regular user, type newgrp webdev to immediately use your membership in this group. Create a Basic Web Page on Your Server & Test Your 404 Page A. Type vim /var/www/html/index.html and edit the generic index file for your Apache server. Save your file when you are done. B. Open Firefox and enter the following into the address bar: http://localhost:8080/ C. Verify the contents of the page you created are displaying in your web browser. D. Try going to the web page: http://localhost:8080/notarealpage and see if you receive your 404 error page successfully.


Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.