for the last couple of days I've been struggling to configure and get mod_harbour and mercury running over a Ubuntu/Linux Virtual Machine using Oracle VirtualBox, but fortunately I made it!
I followed all the steps described in the github repo (https://github.com/FiveTechSoft/mod_har ... ster/linux) but I think there's some other steps missing (or maybe Ubuntu specifically requires it).
So now, let me explain how I got everything running after installing the Ubuntu VM in Oracle VirtualBox:
STEP 1: Install git
Código: Seleccionar todo
sudo apt-get install git-all
Código: Seleccionar todo
sudo apt install libcurl4-openssl-dev
sudo apt install libssl-dev
sudo cp -r /usr/include/x86_64-linux-gnu/curl /usr/include
Código: Seleccionar todo
sudo apt install apache2
sudo apt install apache2-dev
Código: Seleccionar todo
git clone https://github.com/fivetechsoft/mod_harbour
git clone https://github.com/carles9000/mercury
Código: Seleccionar todo
sudo chmod -R 777 /etc/apache2/
sudo chmod -R 777 /var/www/html/
sudo chmod -R 777 /usr/lib/x86_64-linux-gnu
** the second command allow me to create files and folders inside the /var/www/html (where our applications will be located)
** the third command allow me to read some important lib's required by my application
STEP 6: Let's move the files to the right directories (create references to the files)
Código: Seleccionar todo
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
STEP 8: Mofidy the /etc/apache2/apache2.conf file
Código: Seleccionar todo
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
LoadModule harbour_module /usr/lib/apache2/modules/mod_harbour.so
<FilesMatch "\.(prg|hrb)$">
SetHandler harbour
</FilesMatch>
<Directory /var/www/html/project_name>
SetEnv APP_TITLE "project_name v0.1"
SetEnv PATH_URL "/project_name"
SetEnv PATH_APP "/project_name"
SetEnv PATH_DATA "/project_name/data/"
SetEnv PATH_MERCURY "/project_name/lib/mercury"
DirectoryIndex index.prg main.prg
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.prg/$1 [L]
</Directory>
** for every project you got running you need to create a <Directory> block with some especifications, there's no need to use .htaccess files. this practice increases apache performance (correct me if I'm wrong)
This is enough to get mod_harbour and mercury running properly!