Issue: Its not easy to use the documentation on Linux
At the time of writing, one has to look at single pages to see documentation on Linux without all the features that there are available on windows
Solution:
Its possible to run it as a server. The following solution covers:
- How to do this on a ubuntu 22.04 desktop environment. It possible that it works with other distribution and different version of ubuntu.
- How to host the documentation locally. It will not be available for anyone on the subnet or remotely, there will not be provide solution for that. Since we wont apply any security.
- How to do this with Apache2
- This could probably be done with less code, but I'm not a expert in webservers.
Assumptions
- Its assume that everything is installed by default. If not you should make sure that the paths are correct
- There is no webserver already running on the system. These may overwrite each other.
- This was made for both Python and C++
Firstly, make sure you have eBUS installed. Then we'll install apache2
sudo apt update
sudo apt install apache2
Then we're going to make a new file in our apache2 system
sudo nano /etc/apache2/sites-available/jai-doc.conf
Depending on whether you have eBUS-Python installed, you may need to comment out the code from
"# allow access to /python" to "# allow access to /sdk".
Secondly the default path for eBUS on ubuntu 22.04 is "/opt/jai/ebus_sdk/Ubuntu-22.04-x86_64", you should check the path on our machine and insert in <Path to eBUS sdk> in the below.
Insert this into the file we just opened
<VirtualHost *:80>
DocumentRoot <Path to eBUS sdk>/share/doc
# allow access to /python
Alias /python "<Path to eBUS sdk>/share/doc/python"
<Directory <Path to eBUS sdk>/share/doc/python >
Options Indexes FollowSymLinks
AllowOverride None
Require local # allow only localhost
</Directory>
# allow access to /sdk
Alias /sdk "<Path to eBUS sdk>/share/doc/sdk"
<Directory <Path to eBUS sdk>/share/doc/sdk >
Options Indexes FollowSymLinks
AllowOverride None
Require local # allow only localhost
</Directory>
# Log
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Then we will enable it and remove a default page that would point to a unwanted page
# make link to enabled
sudo ln -s /etc/apache2/sites-available/jai-doc.conf /etc/apache2/sites-enabled/jai-doc.conf
sudo rm /etc/apache2/sites-enabled/000-default.conf
We need to allow the server to access and read the folders where the documentation is
cd <Path to eBUS sdk>
sudo chmod 755 share/doc/python
sudo chmod 755 share/doc/sdk
We need to name our server something to suppress errors from apache2
sudo nano /etc/apache2/apache2.conf
Add the following lines at the bottom:
ServerName 127.0.0.1
Then we just need to restart apache2
sudo apachectl restart
Now if you have eBUS-PYTHON installed, open a browsers and type:
127.0.0.1/python
The C++ documentation is located here:
127.0.0.1/sdk
Note: that I can help if this doesn't work, but I will not support changes that you have made to this configuration
0 Comments