Can the Apache DocumentRoot point to an NSS data volume?

  • 3344085
  • 13-Oct-2006
  • 27-Apr-2012

Environment

Novell Open Enterprise Server (Linux based)

Situation

An NSS volume has several advantages

Resolution

Yes, Apaches DocumentRoot directive can point to an NSS volume on a Linux based OES server. What you need to keep in mind that when NSS volumes is introduced into an OES server configuration, the wwwrun user is converted to an eDirectory LUM user and therefore the rights to access the NSS volumes would have to be set through eDirectory rather than using the local Linux file system rights.

  1. Edit the default-server.conf file found in the /etc/apache2 directory. Change the DocumentRoot andDirectorylines to reflect the desired directory on the NSS volume. Note: The NSS volumes in this examples is DATA which has been mounted under /media/nss. The htdocs directory is where we will be hosting the DocumentRoot for apache in this example. You default directory, volume, and mount point may be different. It doesn't matter if it is different so long as the volume is mounted and the directory has been created before you restart apache.

    Before the change

    DocumentRoot "/srv/www/htdocs"


    After the change

    DocumentRoot "/media/nss/DATA/htdocs"


  2. Make sure that you have an index.html file that has been created under you new DocumentRoot. If one has not been created then you will receive an "Access Forbidden" message when you try and access the URL because the Options directive for that directory has been set to None by default.

  3. We need to make sure that the wwwrun user has rights to access the new DocumentRoot directory.In this example a Linux workstation is being used to access the server which provides us with several options for setting these rights.

    Novell Client for Linux- Map a drive to the NSS volume. Browse to the desired directory, right click, and choose Novell Properties. Select theNovell Rightstab and then browse the tree until you find the wwwrun user. Click the add button and verify that the proper rights have been given. Default rights should suffice.


    ConsoleOne- Navigate the tree to the NSS volume. Right click on the directory and choose Properties. Click on the Trustees tab and choose Add Trustee. Select the wwwrun user and click OK. Verify that the appropriate rights are assigned. Default rights should suffice.


    Terminal- With terminal access to your server (as root) run the rights command with the wwwrun user as trustee and at least read (r) and filescan (f) rights to the directory on the NSS volume. Note: Make sure you replace the .context.treename with the appropriate context and treename of your wwwrun user. If your directory is different than the one used in this example then make sure you adjust it as well. For more information on the rights command typeman rightsin the servers terminal window.

    rights -f /media/nss/DATA/htdocs/ -r rf trustee wwwrun.context.treename

  4. In order for the changes to take affect you will need to restart the Apache web server. Open a terminal with root access to your OES server. Stop apache by typing rcapache2 stop. Start apache by typing rcapache2 start.

    rcapache2 stop
    rcapache2 start

  5. Now open a browser and verify that you can access the index.html file on your NSS volume. Note: You may also need to clear your browser cache depending on the circumstances.