Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
103 changes: 103 additions & 0 deletions linux/Fix_mod_harbour3.2.0_error_tweb/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
[![](https://bitbucket.org/fivetech/screenshots/downloads/fivetech_logo.gif)](http://www.fivetechsoft.com "FiveTech Software")

**How to install mod_harbour:**

```
git clone https://github.com/fivetechsoft/mod_harbour
cd /var/www/html
sudo ln -sf ~/mod_harbour/linux/libharbour.so.3.2.0 libharbour.so.3.2.0
sudo ln -sf ~/mod_harbour/samples modharbour_samples
cd /usr/lib/apache2/modules
sudo ln -sf ~/mod_harbour/linux/mod_harbour.so mod_harbour.so
```
In /etc/apache2/apache2.conf add these lines at the bottom of the file:
```
LoadModule harbour_module /usr/lib/apache2/modules/mod_harbour.so
<FilesMatch "\.(prg|hrb)$">
SetHandler harbour
</FilesMatch>
```
Restart apache doing this:

```
sudo apachectl restart
```

Go to localhost/modharbour_samples/ from your browser and click on any .prg

<hr>

**How to build mod_harbour:**

You need to install these Linux packages:
```
sudo apt install libcurl4-openssl-dev
sudo apt install libssl-dev
sudo cp -r /usr/include/x86_64-linux-gnu/curl /usr/include
```

First of all, build Harbour
```
git clone https://github.com/harbour/core harbour
cd harbour
export HB_USER_CFLAGS="-fPIC"
export HB_BUILD_CONTRIBS
make
```
Install apache and apache2-dev
```
sudo apt install apache2
sudo apt install apache2-dev
```
then give execution permissions to go.sh and execute it:
```
chmod +x go.sh
./go.sh
```
Once built, do this:
```
cd /var/www/html
sudo ln -sf ~/mod_harbour/linux/libharbour.so.3.2.0 libharbour.so.3.2.0
sudo ln -sf ~/mod_harbour/samples modharbour_samples
cd /usr/lib/apache2/modules
sudo ln -sf ~/mod_harbour/linux/mod_harbour.so mod_harbour.so
```
and restart apache
```
sudo systemctl restart apache2

or

sudo service apache2 restart
```

Then from your browser go to:
```
localhost/modharbour_samples
```
In case you get a wrong behavior, please check:
```
/var/log/apache2/error.log
```

***

To use the rewrite module you have to modify /etc/apache2/apache2.conf directly and not use .htaccess (because rewrite gets not enough memory). This way it works fine and there are no segmentation faults in error.log
```
<Directory /var/www/html/snipets>
SetEnv APP_TITLE "Snipets v0.1"
SetEnv PATH_URL "/snipets"
SetEnv PATH_APP "/snipets"
SetEnv PATH_DATA "/snipets/data/"
DirectoryIndex index.prg main.prg
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.prg/$1 [L]
</Directory>
```
https://httpd.apache.org/docs/2.4/en/howto/htaccess.html
***

[![](https://bitbucket.org/fivetech/screenshots/downloads/harbour.jpg)](https://harbour.github.io "The Harbour Project")
<a href="https://httpd.apache.org/" alt="The Apache HTTP Server Project"><img width="150" height="150" src="http://www.apache.org/img/support-apache.jpg"></a>
6 changes: 6 additions & 0 deletions samples/rastrelliera/data/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Options All -Indexes

<Files ./*.dbf>
Order Allow,Deny
Deny from all
</Files>
Binary file added samples/rastrelliera/data/controllers.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/controllers.dbt
Binary file not shown.
Binary file added samples/rastrelliera/data/database.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/database.dbt
Binary file not shown.
Binary file added samples/rastrelliera/data/logs.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/menus.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/routes.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/settings.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/settings.dbt
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/database.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/database.dbt
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/impegna.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/logs.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/menus.dbf
Binary file not shown.
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/settings.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/settings.dbt
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/tasks.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/tasks.dbt
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/users.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/users.dbt
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/views.dbf
Binary file not shown.
Binary file added samples/rastrelliera/data/test1/data/views.dbt
Binary file not shown.
57 changes: 57 additions & 0 deletions samples/rastrelliera/data/test1/views/body.view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<script>



$(document).ready(function(){

$('#leftmenu').css('display','none');
$('#maincontent').toggleClass('col-sm-10 col-sm-12');
$(window).resize(function() {
init();
});
});

</script>
<body onload="control_menu()">
<div class="container-fluid" style="overflow:hidden;padding:0px;">
<div class="row" style="margin-right:0px;height:100%;">



<div id="leftmenu" class="col-sm-2" style="padding:0px;background-color:rgb(34, 45, 50); ">

{{If( GetUserName() == nil, "<script>$('#leftmenu').css('display','none');</script>", View("menu"))}}

</div>


<div id = "maincontent" class="{{If( GetUserName() == nil,'col-sm-12','col-sm-10')}} " style="padding-left:0px;padding-right:0px">
<nav id="nav" class="navbar navbar-expand-lg navbar-inverse " style="background-color:{{GetColor2()}};border:0px;">
<button onclick="hide()" class="navbar" type="button" data-toggle="collapse" data-target="#navbarSupportedContent1"
aria-controls="navbarSupportedContent1" aria-expanded="false" aria-label="Toggle navigation"><span class="dark-blue-text"><i
class="fas fa-bars fa-1x"></i></span></button>

<a id="title" class="navbar-brand mr-auto" style="color:white;padding-left:30px;">{{hb_CapFirst(GetContent())}}</a>

<div class="nav-item" style="color:white;display:inline-block;cursor:pointer;"
onclick="{{If(GetUserName()!= nil,'Logout();','')}}">
<a class="nav-link" style="color:white;" style="cursor:pointer;">{{ if(GetUserName() != nil,'Benvenuto ' + GetUserName(),'')}}
<!--<i class="{{If( GetUserName() != nil, 'fa fa-sign-out', 'fas fa-sign-in-alt')}}" style="padding-left:15px;"></i>--></a>
</div>
</nav>



<div style="background-color:#ecf0f5;height:calc( 100% - 50px );padding-top:50px;">
{{Router()}}
</div>

</div>



</div>
</div>
</body>

</html>
26 changes: 26 additions & 0 deletions samples/rastrelliera/data/test1/views/browse.view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div style="max-height:98%;background-color:white;margin:30px;margin-top:-18px;padding:10px;padding-top:10px;overflow-x:hidden;overflow-y:auto;">
<hr>
<div class="row" style="padding-left:15px;">
<div class="col-sm-3">
<button onclick="Add('{{getcateg()}}');" type="button" class="btn btn-primary" style="background-color:{{GetColor1()}};">
<i class="fas fa-plus" style="color:lightgray;padding-right:15px;font-size:16px"></i>Add</button>
<button onclick="window.print();" type="button" class="btn btn-primary" style="background-color:{{GetColor1()}};">
<i class="fas fa-print" style="color:lightgray;padding-right:15px;font-size:16px"></i>Print</button>
</div>
<div class="col-sm-6"></div>
<div class="col-sm-3" style="padding-right:15px;padding-bottom:5px;margin-top:-5px;">
<div class="input-group">
<input id="searchfor" type="text" class="form-control"
placeholder="Ricerca...">
<span class="input-group-btn">
<button class="btn btn-default"
type="button" onclick="location.href='index.prg?{{GetContent()}}:search:' + SearchFor()"
style="width:40px;height:38px;color:white;background-color:{{GetColor1()}}">
<i class="fas fa-search" style="color:lightgray;padding-right:15px;font-size:16px"></i>
</button>
</span>
</div>
</div>
</div>
{{BuildBrowse( GetContent() )}}
</div>
15 changes: 15 additions & 0 deletions samples/rastrelliera/data/test1/views/code.view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div id="editor" style="height:650px;">function Main()

? "Hello world"

return nil </div>

<script src="https://fivetechsoft.github.io/xcloud/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/tomorrow_night_blue");
editor.setFontSize(18);
editor.setHighlightActiveLine(true);
editor.session.setMode("ace/mode/c_cpp");
</script>

3 changes: 3 additions & 0 deletions samples/rastrelliera/data/test1/views/default.view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{View("head")}}

{{View("body")}}
Loading