Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
133 lines (106 sloc) 4.17 KB
${APPASERVER_HOME}/INSTALL
--------------------------
-----------
A) Security
-----------
The challenge is to securely couple Appaserver, Mysql, and Apache.
For example, shell users need to access their private databases, yet
Apache may need to access all of them. Another example, Appaserver
creates sensitive files in $DOCUMENT_ROOT that world users should not
read. Also, you need to compile Appaserver which writes links to
Apaches's CGI directory. Yet, no one else should plant a trojan
horse there.
The historical solution was to pass out the root password. However,
UNIX (Linux) has an elegant solution -- the Group Centric Paradigm.
See:
https://github.com/timhriley/appaserver/blob/master/src_template/group_centric.txt
Appaserver's implementation of the Group Centric Paradigm
is to create group=appaserver in /etc/group.
Then assign as group members, `whoami` and www-data.
Alternatively, you could add yourself to the existing
group=www-data. The important characteristic is the
people who compile and the Apache process need write access,
and everyone else doesn't even have read access.
------------------------------
B) Make sure LAMP is installed
------------------------------
Here's a good tutorial:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04
----------------------------
C) Ensure proper permissions
----------------------------
Either add a new group=appaserver:
1) $ sudo addgroup appaserver
2) $ sudo usermod -a -G appaserver `whoami`
3) $ sudo usermod -a -G appaserver www-data
4) $ sudo service apache2 restart
5) $ newgrp appaserver
6) $ appaservergroup=appaserver
Or add yourself to group=www-data:
1) $ sudo usermod -a -G www-data `whoami`
2) $ newgrp www-data
3) $ appaservergroup=www-data
---------------------------
D) Shell installation steps
---------------------------
01) $ cd /foo
02) $ sudo mkdir appaserver
03) $ sudo chgrp $appaservergroup appaserver
04) $ sudo chmod g+ws appaserver
05) $ git clone https://github.com/timhriley/appaserver.git
06) $ cd appaserver/src_template
07) $ sudo cp template_appaserver.config /etc/appaserver.config
08) $ sudo vi /etc/appaserver.config
09) vi> set mysql password
10) vi> set appaserver_mount_point
11) vi> set appaserver_group=$appaservergroup <-- see step C)
12) vi> set other configurable variables
13) $ sudo ./install_appaserver_profile.sh noexecute|execute
14) $ . /etc/profile
15) $ sudo ./install_appaserver_filesystem.sh noexecute|execute
16) $ sudo ./protect_appaserver_filesystem.sh noexecute|execute
17) $ cd $APPASERVER_HOME
18) $ make
19) $ . set_project template
20) $ install_template_database.sh noexecute|execute
21) $ upgrade-appaserver-database template
---------
E) Log in
---------
Point your browser to:
http://localhost/appaserver/template/index.php
Login using:
login_name=nobody and password=changeit
---------------------------
F) Create first application
---------------------------
Once you log into the template application, execute the <Process>
called <Change Password>. However, don't create any application
tables, yet. Instead, execute the <Process> called
<Create Empty Application>. Then log into your new application
and build your tables.
--------------
G) Maintenance
--------------
Appaserver creates temporary files that need to be purged in:
1) $DOCUMENT_ROOT/appaserver/$DATABASE/data
2) /var/appaserver_data
These files are purged automatically as users press the <Submit>
button. However, an inactive system will leave temporary files
lingering. Therefore, place this line in your crontab:
0 2 * * * APPASERVER_HOME=/foo/appaserver; PATH=$PATH:$APPASERVER_HOME/src_appaserver:$APPASERVER_HOME/utility; export PATH; appaserver_purge_temporary_files.sh
---------------------
H) Upgrade Appaserver
---------------------
See UPGRADE
-----------------------
I) Uninstall Appaserver
-----------------------
1) $ echo "drop database template;" | sql.e
2) $ cd $APPASERVER_HOME && make clean
3) $ cd $APPASERVER_HOME/src_template
4) $ sudo ./uninstall_appaserver_filesystem.sh noexecute|execute
5) $ sudo rm -fr $APPASERVER_HOME
6) $ sudo rm /etc/appaserver.config
7) trim /etc/profile of appaserver variables
8) remove group=appaserver in /etc/group (maybe)