Open funderburkjim opened 7 years ago
Feb 24, 2017
Based on OSX El Capitan
ref: https://discussions.apple.com/docs/DOC-3083
Open a terminal.
0)
mkdir ~/Sites # This may or may not already exist. No problem
cd ~/Sites
ls
# if index.html does NOT exist, create a dummy index.html
echo "<html><body><h1>My site works</h1></body></html>" > ~/Sites/index.html
1) Enable php for the web server
edit file /private/etc/apache2/httpd.conf (as administrator)
search for line '#LoadModule php5_module libexec/apache2/libphp5.so'
and remove the '#' and save.
One way: (this uses 'nano' editor. reference uses vi editor. Either ok)
Open terminal
cd /private/etc/apache2/
sudo nano httpd.conf
[You will be prompted for your OSX admin password]
^W (Ctrl-W) to search for php
Use arrow keys to get to the #, the delete key
^O (Ctrl-O) to write the file
SHOWS File Name to Write: httpd.conf
Press return to finish the write
^X (Ctrl-X) to exit
1a) For my OSX, I also had to uncomment the lines
#LoadModule userdir_module libexec/apache2/mod_userdir.so
#Include /private/etc/apache2/extra/httpd-userdir.conf
1b) also edited /private/etc/apache2/extra/httpd-userdir.conf and
uncommented #Include /private/etc/apache2/users/*.conf
2) Create /etc/apache2/users/<your short user name>.conf
Let's suppose your short user name is mary.
When you do this, replace 'mary' by YOUR short user name.
sudo nano /etc/apache2/users/mary.conf
[type or alter what is in the file so you end up with the following;
be sure to change 'mary' to YOUR user name]
<Directory "/Users/mary/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from localhost
</Directory>
Then write the file and exit nano, using Ctrl-O and Ctrl-X as before.
3) Finally, Turn on Apache web server with this terminal command
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
4) In your browser, enter this URL
http://localhost
It should say 'IT WORKS' in the browser window.
-------------------------------------------------
Now, to get one of the Cologne dictionaries.
I suggest you make a 'cologne' folder within the '~/Sites/' folder:
In terminal,
mkdir ~/Sites/cologne
Let's start with the MacDonell dictionary, since it is fairly small.
In your browser, go to url: http://www.sanskrit-lexicon.uni-koeln.de/
At dictionary 'MD', click the 'D' (download) link
You should not be at the MacDonell Downloads page.
Click item 5, mdweb1.zip to download
When downloaded, 'open' the zip. This will create a folder called 'web'
in your download directory.
Move this to a folder named 'md' in ~/Sites/cologne/
For instance, with terminal:
mv ~/Downloads/web ~/Sites/cologne/md
As a final thing to do (I'm not sure whether it is required, but I did it),
change permissions on the Sites directory:
cd ~
chmod -R 0777 Sites
Finally, cross your fingers, go to your browser, and enter url:
(Remember: change 'mary' to your short user name)
http://localhost/~mary/cologne/md/
You should now have links to all the displays for the md dictionary.
Note 1:
For another dictionary (say mw), download the mwweb1.zip for mw from Colonge,
unzip and move the 'web' folder to ~/Sites/cologne/mw, etc.
Note 2:
If you want the images locally, you can choose the 'Xweb.zip' download.
It will be MUCH larger, but should work fine.
NOTE: If you make any changes to configuration files, you should
restart the apache server. Here's the terminal command to do that:
sudo apachectl restart
Can't there be a shell script that does most of the above steps in one click?
Sounds plausible.. Maybe you can get a Mac expert to do that. I don't know how to edit files in a script, as in step 1.
Let us make cross-browser cross-distro distributions as our goal.
Recently, a Mac user asked how to make local versions of the Web Apps for a dictionary at Cologne. Here is a sequence of steps that worked for me. The dictionary being installed is MD, but an analogous procedure should work for other dictionaries.
There are basically two steps:
Below are the sometimes gory instructions (parental guidance advised).