pages tagged documentation http://meng6net.localhost/tag/documentation/ <p><small>Copyright © 2005-2020 by <code>Meng Lu &lt;lumeng3@gmail.com&gt;</code></small></p> Meng Lu's home page ikiwiki Sat, 27 Mar 2021 22:58:13 +0000 Examples of using Evernote http://meng6net.localhost/computing/example/examples_of_using_Evernote/ http://meng6net.localhost/computing/example/examples_of_using_Evernote/ Evernote computing documentation example note software tip Wed, 11 Mar 2020 18:41:54 +0000 2020-03-11T18:41:54Z <h2>Resync all data</h2> <ol> <li>Open Evernote.app on macOS.</li> <li>Press <kbd>Shift</kbd>-<kbd>Option/Alt</kbd> and click the synchronization wheel icon next to the search input field (as of Evernote macOS version 7.14 and 2020-3).</li> </ol> <h2>Refresh database indices</h2> <ul> <li>Press <kbd>Option/Alt</kbd> and click menu item 'Option &gt; Troubleshooting'</li> <li>Click 'Recreate Full Text Search Index' and 'Recreate Spotlight Search Index'.</li> </ul> Installing and configuring mutt http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_mutt/ http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_mutt/ computing configuration documentation homebrew installation macOS note pkgsrc software to-do Tue, 04 Feb 2020 19:44:45 +0000 2020-02-04T19:44:45Z <h2>Intro to Mutt</h2> <p><a href="http://www.mutt.org/"><code>mutt</code></a> is a text-based mail client for Unix operating systems.</p> <h2>Installing <code>mutt</code></h2> <pre><code>brew install mutt </code></pre> <h2>Installing <code>getmail</code></h2> <pre><code>brew install getmail </code></pre> Installing and configuring Docker http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_docker/ http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_docker/ Docker computing configuration documentation draft installation note software Sun, 02 Jul 2017 01:09:02 +0000 2017-08-29T18:36:58Z <h2>macOS</h2> <h3>Homebrew</h3> <pre><code>brew cask install docker brew cask install docker-toolbox </code></pre> <h2>Create a virtual machine</h2> <pre><code>bash$ docker-machine create default </code></pre> <h2>Start the virtual machine</h2> <p>Start the virtual machine <code>default</code>:</p> <pre><code>bash$ docker-machine start bash$ docker-machine env export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/Users/meng/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default" # Run this command to configure your shell: # eval $(docker-machine env) bash$ eval "$(docker-machine env default)" </code></pre> <h2>Verify that the docker machine is working</h2> <pre><code>bash$ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world b04784fba78d: Pull complete Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/ </code></pre> <h2>Run and test the 'tensorflow/tensorflow' Docker image</h2> <pre><code>bash$ docker run -it tensorflow/tensorflow:1.1.0 bash Unable to find image 'tensorflow/tensorflow:1.1.0' locally 1.1.0: Pulling from tensorflow/tensorflow c62795f78da9: Pull complete d4fceeeb758e: Pull complete 5c9125a401ae: Pull complete 0062f774e994: Pull complete 6b33fd031fac: Pull complete 353b34ef0a98: Pull complete 4f6aefc14b68: Pull complete ce066374c6ca: Pull complete c0755a91ab3a: Pull complete f03279b52d25: Pull complete d1c27c29b7e3: Pull complete 23807c5f4b3e: Pull complete Digest: sha256:27bd43f1cf71c45eb48cb6e067b7cef47b168ac11c685d55a3495d27f0d59543 Status: Downloaded newer image for tensorflow/tensorflow:1.1.0 root@d000fef7e8dc:/notebooks# root@d000fef7e8dc:/notebooks# python Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; &gt;&gt;&gt; import tensorflow as tf &gt;&gt;&gt; hello = tf.constant('Hello, TensorFlow!') &gt;&gt;&gt; sess = tf.Session() # It will print some warnings here. 2017-06-29 06:08:55.848559: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-29 06:08:55.848626: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-29 06:08:55.848663: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. &gt;&gt;&gt; print(sess.run(hello)) Hello, TensorFlow! &gt;&gt;&gt; </code></pre> <h2>List all virtual machines</h2> <pre> <code>$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default - virtualbox Stopped Unknown </code></pre> <h2>Delete a virtual machine</h2> <pre><code>$ docker-machine rm default About to remove default WARNING: This action will delete both local reference and remote instance. Are you sure? (y/n): y Successfully removed default </code></pre> <h2>References</h2> <ul> <li> https://stackoverflow.com/questions/21871479/docker-cant-connect-to-docker-daemon</li> </ul> Installing and configuring TensorFlow http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_TensorFlow/ http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_TensorFlow/ Docker TensorFlow computing configuration documentation draft installation note software Sat, 01 Jul 2017 21:23:24 +0000 2017-07-01T21:23:24Z <h2>Install TensorFlow using 'tensorflow/tensorflow' Docker image</h2> <h3>Start the Docker virtual machine</h3> <p>Create a virtual machine if not already</p> <pre><code>bash$ docker-machine create default </code></pre> <p>Start the virtual machine <code>default</code>:</p> <pre><code>bash$ docker-machine start Starting "default"... (default) Check network to re-create if needed... (default) Waiting for an IP... Machine "default" was started. Waiting for SSH to be available... Detecting the provisioner... Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command. &gt;&gt;&gt; elapsed time 35s bash$ docker-machine env export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/Users/meng/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default" # Run this command to configure your shell: # eval $(docker-machine env) bash$ eval "$(docker-machine env default)" </code></pre> <h3>Start 'tensorflow/tensorflow' Docker image</h3> <pre><code>$ export MY_WORKSPACE_DIR='/Users/meng/workspace' $ docker run -it \ --net=host \ --publish 6006:6006 \ --volume ${MY_WORKSPACE_DIR}/tensorflow_test:/tensorflow_test \ --workdir /tensorflow_test \ tensorflow/tensorflow:1.1.0 bash root@30d79c2e5fc3:/tensorflow_test# pwd /tensorflow_test </code></pre> <h3>Start TensorBoard</h3> <pre> <code>root@30d79c2e5fc3:/tensorflow_test# tensorboard --logdir training_summaries &amp; [1] 12 root@30d79c2e5fc3:/tensorflow_test# Starting TensorBoard 47 at http://0.0.0.0:6006 (Press CTRL+C to quit) root@30d79c2e5fc3:/tensorflow_test# </code></pre> <p>Open TensorBoard at</p> <pre><code>http://192.168.99.100:6006 </code></pre> <p>in a Web browser, where the IP is the same as <code>DOCKER_HOST</code> in the output of <code>docker-machine env</code>.</p> <h3>Download training data</h3> <pre> <code># curl -O http://download.tensorflow.org/example_images/flower_photos.tgz # tar xzf flower_photos.tgz # find flower_photos -type f | wc -l 3671 # cp -R flower_photos flower_photos_subset # rm flower_photos_subset/*/[2-9]* # find flower_photos_subset/ -type f | wc -l 1202 </code></pre> <h3>Download training script</h3> <pre> <code># curl -O https://raw.githubusercontent.com/tensorflow/tensorflow/r1.1/tensorflow/examples/image_retraining/retrain.py </code></pre> <h3>Training</h3> <pre><code># python retrain.py \ --bottleneck_dir=bottlenecks \ --how_many_training_steps=500 \ --model_dir=inception \ --summaries_dir=training_summaries/basic \ --output_graph=retrained_graph.pb \ --output_labels=retrained_labels.txt \ --image_dir=flower_photos_subset </code></pre> <h2>Python script to classify new images of flowers</h2> <p>Create a new file <code>label_image.py</code>:</p> <pre><code>import os, sys import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # change this as you see fit image_path = sys.argv[1] # Read in the image_data image_data = tf.gfile.FastGFile(image_path, 'rb').read() # Loads label file, strips off carriage return label_lines = [line.rstrip() for line in tf.gfile.GFile("retrained_labels.txt")] # Unpersists graph from file with tf.gfile.FastGFile("retrained_graph.pb", 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) tf.import_graph_def(graph_def, name='') with tf.Session() as sess: # Feed the image_data as input to the graph and get first prediction softmax_tensor = sess.graph.get_tensor_by_name('final_result:0') predictions = sess.run(softmax_tensor, \ {'DecodeJpeg/contents:0': image_data}) # Sort to show labels of first prediction in order of confidence top_k = predictions[0].argsort()[-len(predictions[0]):][::-1] for node_id in top_k: human_string = label_lines[node_id] score = predictions[0][node_id] print('%s (score = %.5f)' % (human_string, score)) </code></pre> <p>Classify a new image:</p> <pre> <code># python label_image.py flower_photos/daisy/99306615_739eb94b9e_m.jpg daisy (score = 0.47996) dandelion (score = 0.24667) sunflowers (score = 0.24508) tulips (score = 0.02018) roses (score = 0.00811) </code></pre> <h3>Exit the Docker image and stop the Docker virtual machine</h3> <p>Ctrl+D to exit Docker image and then run</p> <pre><code>$ docker-machine stop </code></pre> <h2>References</h2> <ul> <li> https://codelabs.developers.google.com/codelabs/tensorflow-for-poets</li> </ul> Examples http://meng6net.localhost/computing/example/ http://meng6net.localhost/computing/example/ computing documentation example note software tip Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>New</h2> <div class="feedlink"><a class="feedbutton" type= "application/rss+xml" rel="alternate" title= "Meng Lu's home page (RSS feed)" href= "http://meng6net.localhost/computing/example/index.rss">RSS</a> <a class="feedbutton" type="application/atom+xml" rel="alternate" title= "Meng Lu's home page (Atom feed)" href= "http://meng6net.localhost/computing/example/index.atom">Atom</a></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_gpg-agent/">Examples of using `gpg-agent`</a><br /> <span class="archivepagedate">Posted <span class="date">Tue Jan 12 21:03:09 2021</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_wget/">Examples of using wget</a><br /> <span class="archivepagedate">Posted <span class="date">Sun May 3 05:47:34 2020</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_Evernote/">Examples of using Evernote</a><br /> <span class="archivepagedate">Posted <span class="date">Wed Mar 11 18:41:54 2020</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_tree/">Examples of using `tree`</a><br /> <span class="archivepagedate">Posted <span class="date">Tue Jan 21 20:00:14 2020</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_afinfo/">Examples of using afinfo</a><br /> <span class="archivepagedate">Posted <span class="date">Thu Dec 27 19:29:57 2018</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_pandoc/">Examples of using pandoc</a><br /> <span class="archivepagedate">Posted <span class="date">Tue Jul 25 19:35:27 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_7z/">examples of using 7z</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_Imagemagick/">Examples of using Imagemagick</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_ack/">Examples of using ack</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_awk/">Examples of using awk</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_bash/">Examples of using Bash</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_command-line/">Examples of using command-line</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_curl/">Examples of using curl</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_cvs/">Examples of using CVS</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_du/">examples of using du</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_eclipse/">Examples of using Eclipse</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_emacs/">Examples of using Emacs</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_ffmpeg/">Examples of using ffmpeg</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_find/">Examples of using find</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> <div class="archivepage"><a href= "http://meng6net.localhost/computing/example/examples_of_using_gmail/">Examples of using Gmail</a><br /> <span class="archivepagedate">Posted <span class="date">Tue May 16 23:59:39 2017</span></span></div> Examples of using Eclipse http://meng6net.localhost/computing/example/examples_of_using_eclipse/ http://meng6net.localhost/computing/example/examples_of_using_eclipse/ computing documentation eclipse example note software Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>Uninstalling plug-in</h2> <p>Preferences → Install/Update → Uninstall or update software that is already installed → select some plug-ins → click Uninstall</p> <h2>Move a project's directory</h2> <p>Suppose you have a project 'project1' which is at path <code>/home/XXX/workspace/project1/</code> and you want to move it to <code>/home/XXX/workspace/group/project1/</code>.</p> <p>In order to avoid destroying the metadata of the project such as working sets and .project file, use the refactor function in the menu rather than deleting and recreating the project.</p> <ol> <li>Create the directory <code>/home/XXX/workspace/group/</code>.</li> <li>Use menu Windows &gt; Views &gt; Other &gt; Navigator.</li> <li>Right click on the project of interest in the Navigator view.</li> <li>Choose refactor &gt; move, and select the new path <code>/home/XXX/workspace/group/</code>, and click OK.</li> </ol> <h2>Change a CVS repository to use 'ext' connection method</h2> <p>By default a CVS repostiory created in Eclipse uses a non-standard connection method 'extssh'. To change an existing project to use 'ext' connection method,</p> <ol> <li> <p>Window &gt; Open Perspective &gt; CVS Repository Exploring &gt; add a CVS repository with same setup as the 'extssh' repository but this time specify 'ext' as connection method.</p> </li> <li> <p>Preferences &gt; Team &gt; CVS &gt; Ext Connection Method &gt; check 'Use another connection method type to connect', choose 'connection type' as 'extssh'.</p> </li> <li> <p>Open Window &gt; View &gt; Navigator, in the Navigator view, right click on the interested project, go to menu Properties &gt; CVS &gt; Change Sharing &gt; choose the CVS repository with 'ext' connection method.</p> </li> </ol> <h2>Using the same physical directory as projects in different workspaces</h2> <ul> <li>Git clone (or CVS check out) a version controlled project to a centralized location on one's computer.</li> <li>In each Eclipse workspace that you need the repository or project, use the menu "File &gt; Import... General: Existing Projects in Workspace" to import the repository, but point it to the directory prepared in the last step. Make sure the "copy projects into workspace" checkbox is <em>unchecked</em>.</li> </ul> <h2>Notes</h2> <h2>See also</h2> <h2>References</h2> <h2>External links</h2> Examples of using myrepos http://meng6net.localhost/computing/example/examples_of_using_myrepos/ http://meng6net.localhost/computing/example/examples_of_using_myrepos/ computing documentation example git myrepos note software tip Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>Set user name and email to multiple Git repositories</h2> <p>Set up your myrepos and Git repositories according to <a href= "https://myrepos.branchable.com/">https://myrepos.branchable.com/</a>.</p> <p>Add the following in <code>~/.mrconfig</code>:</p> <pre><code>[DEFAULT] ## Teach mr how to config user name and email with `mr configusername` and `mr configuseremail` configusername = git config user.name "Meng Lu" configuseremail = git config user.email lumeng.dev@gmail.com </code></pre> <p>Navigate to a path that contains all the Git repositories you would like to set or update user name and email, and run</p> <pre><code>mr configusername mr configuseremail </code></pre> <p><code>myrepos</code> will print the paths of the Git repositories whose user name and email are updated.</p> <h2>References</h2> <ul> <li><code>myrepos</code>: <a href= "https://myrepos.branchable.com/">https://myrepos.branchable.com/</a>.</li> <li>Git documentation on configuring user: https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup</li> </ul> Examples of using rsync http://meng6net.localhost/computing/example/examples_of_using_rsync/ http://meng6net.localhost/computing/example/examples_of_using_rsync/ computing documentation example rsync Tue, 16 May 2017 23:59:39 +0000 2021-03-27T22:58:13Z <h2>Publishing static content of a web site</h2> <p>Publish web site composed of static files and directories in directory <code>~/subdir/</code> on local machine to web site directory <code>~/dir/subdir</code> on remote server</p> <pre> <code>$ rsync -thrivpbl ~/mysite/ foouser@host.domain.com:~/dir/msite </code></pre> <p>or</p> <pre> <code>$ rsync -zhavib ~/mysite/ foouser@host.domain.com:~/dir/mysite </code></pre> <ul> <li><code>-a</code> equals <code>-rlptgoD</code> <ul> <li><code>-r</code> recursive</li> <li><code>-l</code> preserve links</li> <li><code>-p</code> preserve permissions</li> <li><code>-t</code> preserve time stamp</li> <li>If copying on the same computer: <ul> <li><code>-g</code> preserve group</li> <li><code>-o</code> preserve owner</li> <li><code>-D</code> or <code>--devices</code> preserve device files</li> </ul> </li> </ul> </li> <li><code>-h</code> report human readable numbers</li> <li><code>-i</code> report itemized list of the changes to each file, including attribute changes.</li> <li><code>-v</code> verbose</li> <li><code>-b</code> backup</li> <li><code>-z</code> compress file data during transfer</li> </ul> <h3>Verbose output (<code>-v</code>)</h3> <p>Some common indicators:</p> <ul> <li><code>&gt;f+++++++++</code>: recieving (<code>&gt;</code>) a regular file (<code>f</code>) which is newly created (<code>+</code>).</li> <li><code>&lt;f.st......</code>: sending (<code>&lt;</code>) a regular file (<code>f</code>) whose size (<code>s</code>) and time stamp (<code>t</code>) are different.</li> <li><code>&gt;f.st......</code>: recieving (<code>&gt;</code>) a regular file (<code>f</code>) whose size (<code>s</code>) and time stamp (<code>t</code>) are different.</li> <li><code>.d..t......</code>: not updating (initial <code>.</code>) a directory (<code>d</code>) whose time stamp (<code>t</code>) is different.</li> </ul> <p>References: <a href= "http://stackoverflow.com/questions/4493525/rsync-what-means-the-f-on-rsync-logs"> http://stackoverflow.com/questions/4493525/rsync-what-means-the-f-on-rsync-logs</a></p> <h2>Safely copying large file</h2> <pre> <code>$ sudo rsync -vahzi --progress /Volumes/large_file.mp4 /Volumes/new_file.mp4 </code></pre> <h2>Safely copying a large directory</h2> <pre> <code>$ sudo rsync -vahzi --progress /Volumes/large_dir/ /Volumes/new_dir </code></pre> <h2>Installing up-to-date rsync via Homebrew on macOS</h2> <p>The version of <code>rsync</code> coming with macOS operating system is an older version (<code>2.*</code> as of OS X 10.10.2). To install the more up-to-date version,</p> <pre><code>brew doctor brew upgrade brew tap homebrew/dupes brew install rsync </code></pre> <p>Make sure the path Homebrew installs softwares to, <code>/usr/local/bin</code> appears before other paths in <code>/private/etc/paths</code> so it's searched first. Restart the terminal.</p> Examples of using tee http://meng6net.localhost/computing/example/examples_of_using_tee/ http://meng6net.localhost/computing/example/examples_of_using_tee/ computing documentation example note software tee tip Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <h2>Print command output including errors to multiple files and not screen</h2> <pre> <code>echo "$(date)" 2&gt;&amp;1 | tee -a file1 file2 &gt;/dev/null </code></pre> Installing and configuring Apache HTTP Server on macOS http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_Apache_HTTP_Server_on_macOS/ http://meng6net.localhost/computing/installing_and_configuring/installing_and_configuring_Apache_HTTP_Server_on_macOS/ Apache HTTP Server computing configuration documentation installation macOS note software Tue, 16 May 2017 23:59:39 +0000 2018-10-13T03:33:59Z <h2>previous version of Apache configuration files</h2> <h2>Apache configuration file</h2> <pre><code>$ cd /etc/apache2/users $ touch "${USERNAME}.conf" $ sudo chmod 644 "${USERNAME}.conf" </code></pre> <p>The configuration file <code>"${USERNAME}.conf"</code>:</p> <pre><code>&lt;Directory "/Users/XXX/Sites/"&gt; AllowOverride All Options Indexes MultiViews FollowSymLinks Require all granted &lt;/Directory&gt; </code></pre> <h2><code>/etc/apache2/httpd.conf</code></h2> <pre> <code>LoadModule authz_host_module libexec/apache2/mod_authz_host.so LoadModule authz_core_module libexec/apache2/mod_authz_core.so LoadModule userdir_module libexec/apache2/mod_userdir.so LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so Include /private/etc/apache2/extra/httpd-userdir.conf Include /private/etc/apache2/extra/httpd-vhosts.conf </code></pre> <h2><code>/etc/apache2/extra/httpd-userdir.conf</code></h2> <pre><code>Include /private/etc/apache2/users/*.conf </code></pre> <h2>Restarting Apache server</h2> <pre><code>$ sudo apachectl restart </code></pre> <h2>References</h2> <ul> <li> <p>John Foderaro, <a href= "https://medium.com/@JohnFoderaro/how-to-set-up-apache-in-macos-sierra-10-12-bca5a5dfffba"> How to Set up Apache in macOS Sierra 10.12</a>, 2016.</p> </li> <li> <p><a href= "https://serverfault.com/questions/520195/how-does-servername-and-serveralias-work"> How does ServerName and ServerAlias work?</a></p> </li> <li> <p><a href= "https://wiki.apache.org/httpd/CommonMisconfigurations">Common Apache Misconfigurations</a></p> </li> </ul>