Run Julia Programs as Web Applications Without Frameworks Julia Programming | Kovolff
Автор: kovolff
Загружено: 2021-01-26
Просмотров: 2042
To be able to run your Julia programs as web applications, just implement the steps below:
1. Download and Install Xampp
Xampp is a software which acts as a web server on your local machine
Website:https://www.apachefriends.org/index.html
Downloads: https://www.apachefriends.org/downloa...
2. Download and Install Julia
This is obvious, as without Julia installed, you cannot run any Julia applications
Website: https://julialang.org/
3. Go to your Xampp folder and then
Xampp / apache / conf / httpd.conf
Any line commencing with # is a comment
4. Add this string to the bottom of the httpd.conf file
AddHandler cgi-script .jl
ScriptInterpreterSource Registry-Strict
This enables Xampp to handle .jl scripts aka your Julia programs.
5. Search in httpd.conf for the following string: IfModule dir_module. You will see a lot of index.xx, home.xx or default.xx elements. Just add index.jl, home.jl and default.jl
This ensures that when you input a url such as localhost/my_webapp/, Xampp will use index.jl as the web application’s home page
6. Lastly you can change the location of your root / public folder. This is the folder where you place your Julia programs for Xampp to serve them as web applications.
Search for the string DocumentRoot. You will see that Xampp uses by default the directory htdocs. You can change that to any other directory on your drive. It does not have to be within the Xampp directory.
7. In your Julia code insert in the first line the path to your Julia installation preceded by #!,
For example: #!C:\Julia\Julia-1.4.0\bin\julia.exe
8. Before you utilize any print statement in your Julia code, ensure that your script outputs HTML. This is done with: println(‘Content-Type: text/html’)
#julia #xampp #learn #programming #apache
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: