From 30869c1fa3d3ae3c305fe7beaf20a19b8d9d32fd Mon Sep 17 00:00:00 2001 From: Jair Gonzalez Date: Fri, 26 Jan 2018 19:12:16 -0600 Subject: [PATCH] Correct the default data directory references The default data directory for Apache is /var/www/html in the latest version (tested on VERSION_ID=20490), instead of /usr/share/httpd/htdocs as specified in the web-server-install tutorial. This causes several inconsistencies in the "Change the Default Configuration and Data Directory" section. This commit updates the steps to configure a different data directory for demostrative purposes (/var/www/tutorial) as the proposed one (/var/www/html) is currently the default value. As the rest of the document and the WordPress server tutorial refers to /var/www/html, it's also necesary to add aditional steps to return the configuration back to the original values to leave it ready for the user to be able to follow the next steps in this and the WordPress tutorials. Signed-off-by: Jair Gonzalez --- .../web-server-install/web-server-install.rst | 52 +++++++++++++------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/source/clear-linux/tutorials/web-server-install/web-server-install.rst b/source/clear-linux/tutorials/web-server-install/web-server-install.rst index 52e7af94..dafcac05 100644 --- a/source/clear-linux/tutorials/web-server-install/web-server-install.rst +++ b/source/clear-linux/tutorials/web-server-install/web-server-install.rst @@ -70,19 +70,19 @@ operational from host." on your browser as shown in figure 1. Confirmation the Apache service is running. -The :file:`index.html` file is located in the :file:`/usr/share/httpd/htdocs` -directory of your host system. We will copy this file into a new location +The :file:`index.html` file is located in the :file:`/var/www/html` +directory of your host system. We will copy this file into a new location after we modify the configuration. Change the Default Configuration and Data Directory =================================================== |CL| is designed to be a stateless operating system which means that you will -need to create an optional configuration file. The default location of the -Apache configuration file, :file:`httpd.conf`, is located in the -:file:`/usr/share/defaults/httpd` directory, which can be overwritten as part of the -stateless paradigm. This default :file:`.conf` file includes the following directives -that allow for additional locations of configuration definitions: +need to create an optional configuration file to make changes over the default values. +The default location of the Apache configuration file, :file:`httpd.conf`, is located +in the :file:`/usr/share/defaults/httpd` directory, which can be overwritten as part +of the stateless paradigm. This default :file:`.conf` file includes the following +directives that allow for additional locations of configuration definitions: .. code-block:: console @@ -105,26 +105,26 @@ Using your favorite editor, copy the content listed below into the new file # # Set a new location for DocumentRoot # - DocumentRoot "/var/www/html" + DocumentRoot "/var/www/tutorial" # - # Relax access to content within /var/www/html for this tutorial + # Relax access to content within /var/www/tutorial for this example # - + AllowOverride none Require all granted Finally, let’s create the new ``DocumentRoot`` directory structure and copy the -:file:`index.html` file from :file:`/usr/share/httpd/htdocs` directory to -:file:`/var/www/html`. +:file:`index.html` file from :file:`/var/www/html` directory to +:file:`/var/www/tutorial`. .. code-block:: console - sudo mkdir –p /var/www/html - cd /var/www/html - sudo cp /usr/share/httpd/htdocs/index.html . + sudo mkdir –p /var/www/tutorial + cd /var/www/tutorial + sudo cp /var/www/html/index.html . To make sure that we have everything set correctly, let’s edit the new @@ -143,6 +143,28 @@ restart the ``httpd.service``. Now when you go to http://localhost you should see your new screen. +To continue with the rest of the tutorial, it's necessary to return back to +the default location configuration. To do this, edit the file +:file:`/etc/httpd/conf.d/httpd.conf` again and replace any instance of +/var/www/tutorial with /var/www/html. + +Then, stop and then restart the ``httpd.service``. + +.. code-block:: console + + sudo systemctl stop httpd.service + sudo systemctl start httpd.service + +Now on http://localhost you should see the default screen again. + +Optionally, remove the /var/www/tutorial directory previously created. + +.. code-block:: console + + sudo rm /var/www/tutorial/index.html + sudo rmdir /var/www/tutorial + + Installing PHP ==============