4 ms·
With a Texteditor you need to "describe" the process. Like "Open your text editor and create a file called /etc/apache2/sites-enabled/000-default.conf then put
by mg 5y ago
With a Texteditor you need to "describe" the process. Like "Open your text editor and create a file called /etc/apache2/sites-enabled/000-default.conf then put the following code into it ... then save it, make sure the access rights are... make sure the file encoding is..., make sure it does or does not contain a final carriage return ..."
With the shell, all of this can be combined in one command that you can easily read, understand, copy and paste and which is exactly reproducable:
cat << 'EOF' > /etc/apache2/sites-enabled/000-default.conf
WSGIPythonPath /var/www/mysite
<VirtualHost *:80>
WSGIScriptAlias / /var/www/mysite/mysite/wsgi.py
<Directory /var/www/mysite/mysite>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
EOF
- mkl 5y agoBut no one will want to exactly copy and paste everything from the tutorial (e.g. you'd put the name of your thing instead of "mysite") so by doing it that way you're forcing people to copy and paste it into a text editor, make the edits, and then copy and paste into a terminal. It all seems overly complicated. To be editable and equivalent to your example, all you need is two instructions: 1. Run this: $EDITOR /etc/apache2/sites-enabled/000-default.conf 2. Now paste in this: [file contents] Access rights are a separate command in both methods, and if you're really concerned about file encodings (seems unlikely for this sort of thing), that's either an editor setup step at the very start, or one command to convert in either method.
- mg 5y agoTo test it, I would copy all commands verbatim and play around with the running web application afterwards. Say to try Django or some other framework which I have not used before. Even just reading it would give me an unambiguous insight into the concepts of the framework. To "fork" it, I would copy all commands into a shellscript and then change something like "mysite" via search+replace. In vim it would be: :%s/mysite/yoursite/gc to change all occurances of "mysite" to "yoursite" and be shown each replacement before it takes place.