Posted: May 10, 2019 @ 11:36 AM
I could find a way to install on a VirtualBox machine, and also on my work laptop. The way I got success is similiar to "Install Without Composer" and "and All Files in Public Folder". Here is my write-up: fresh install of OpenSuSE Leap 15 in a virtual machine, with all updates.
System Configuration:
=====================
CodePattern Web and LAMP server, and these packages:
apache2-mod_php7
php7
php7-fileinfo
php7-mysql
and load the modules:
Codesudo a2enmod php7
sudo a2enmod fileinfo
sudo a2enmod rewrite
Apache Configuration:
=====================
The file
/etc/hosts should be prepared, I used this:
Code127.0.0.1 localhost
127.0.0.1 oslhpeb840.my.domain oslhpeb840
/etc/apache2/default-server.conf
CodeServerName "oslhpeb840.my.domain"
DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
Options FollowSymLinks
AllowOverride All
...
</Directory>
Check if Apache works for UAP:
##############################
(shamelessly stolen from the interwebs)
Create the following files in Apache's DocumentRoot:
File
info.php:
File
test.html:
Code<h1 style="color:red">This is the HTML file.</h1>
File
test.php:
Code<h1 style="color:green">HELLO WORLD! This is the PHP file.</h1>
File
.htaccess:
CodeRewriteEngine on
RewriteRule ^/?test.html$ test.php [L]
Codechown wwwrun:www *
chmod 664 *
1.) Check if PHP ('a2enmod php7') is working in Apache:
Direct your browser to /srv/www/htdocs/info.php. This should display the PHP webpage with it's version number and the many settings of PHP.
2.) Check if redirect ('a2enmod rewrite') is working
Codeapache2ctl -t -D DUMP_MODULES 2>&1 |grep rewrite
It should display a line like this:
Coderewrite_module (shared)
If it is not, then you might have to run 'a2enmod rewrite'
Direct your browser to /srv/www/htdocs/test.html (Apache's DocumentRoot), the result should be the
green HELLO WORLD line from the php file. If the
red HELLO WORLD line from test.html is shown, the mod_rewrite doesn't work. Check in the config file, if "AllowOverride All" is set for the DocumentRoot.
MariaDB Configuration
=====================
After the default installation from the LAMP stack, follow the instructions to provide a password to "mariadb root user".
Create this simple script file, name it e.g. ~/uap_initdb.sh, chmod it to 755 and execute it.
File
~/uap_initdb.sh:
Code#! /bin/bash
newUser='uap_user'
newDbPassword='uap_password'
newDb='uap_databse'
host=localhost
#host='%'
commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
echo "setup initial user and database:"
echo "user: ${newUser}"
echo "user pw: ${newDbPassword}"
echo "database: ${newDb}"
echo "Enter mariadb root password to continue:"
echo "${commands}" | /usr/bin/mysql -u root -p
UAP files:
==========
UserApplePie-v4-4.2.1-Full.zip, no composer, installer files in DocumentRoot:
Codecd /srv/www/htdocs
rm index.html
unzip /tmp/UserApplePie-v4-4.2.1-Full.zip
mv UserApplePie-v4-4.2.1-Full/* .
rm -r UserApplePie-v4-4.2.1-Full
correct ownership and access rights (as root)
Codechown -R wwwrun:www *
chown -R wwwrun:www .*
sh -c "find . -type f -exec chmod 664 {} \;"
sh -c "find . -type d -exec chmod 775 {} \;"
move installer files to DocumentRoot:
Codemv ./public/.htaccess .
mv ./public/index.php .
edit the lines 11-14 to be:
Codedefine('APPDIR', realpath(__DIR__.'/app/').'/');
define('SYSTEMDIR', realpath(__DIR__.'/system/').'/');
define('PUBLICDIR', realpath(__DIR__).'/');
define('ROOTDIR', realpath(__DIR__.'/').'/');
point browser to /srv/www/htdocs, and feel good :-)