Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ====
- Assume basic installation of Alpine Linux, openssh server installed and setup, a non-root user created.
- ====
- su -
- apk add --no-cache git bash build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev curl bash bash-doc bash-completion redis npm mariadb mariadb-client mariadb-connector-c-dev jpeg-dev exiv2-dev boost-dev libxml2-dev libxslt-dev
- adduser --disabled-password --gecos "" -s /bin/bash app
- su - app
- curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
- echo 'export PATH="/home/app/.pyenv/bin:$PATH"' >> ~/.bashrc
- echo 'eval "$(pyenv init -)"' >> ~/.bashrc
- echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
- bash
- pyenv install 3.5.7
- pyenv virtualenv 3.5.7 app
- git clone https://phab.phuks.co/source/throat.git
- cd throat
- npm install
- npm run build
- pyenv local app
- pip install --upgrade pip
- pip install -r requirements.txt
- exit
- exit
- mysql_install_db --user=mysql --datadir=/var/lib/mysql
- rc-service mariadb start
- mysqladmin -u root password "P@ssword"
- rc-update add mariadb default
- mysql -u root -p
- CREATE DATABASE throat;
- CREATE USER 'throat'@localhost IDENTIFIED BY 'P@ssword';
- GRANT ALL PRIVILEGES ON throat.* TO 'throat'@localhost;
- exit
- rc-service redis start
- rc-update add redis default
- su - app
- bash
- cd throat
- cp example.config.py config.py
- nano config.py
- #set DB_USER to throat
- #set DB_PASSWD to P@ssword
- #set DB_NAME to throat (or whatever was created, default is phuks)
- cd scripts
- ./install.py
- cd ..
- # to run: ./wsgi.py
- # find IP of your machine, visit: http://<ip address>:5000
- # username: admin, password: adminadmin
- ====
- Hiawatha
- ====
- su -
- apk add cmake make musl-dev util-linux php7-json php7-fpm
- wget https://www.hiawatha-webserver.org/files/hiawatha-10.9.tar.gz
- tar -xzf hiawatha-10.9.tar.gz
- cd hiawatha-10.9/
- mkdir build && cd build
- cmake .. -DENABLE_MONITOR=ON -DENABLE_TOMAHAWK=ON -DCMAKE_INSTALL_PREFIX=/usr -DCONFIG_DIR=/etc/hiawatha/ -DWORK_DIR=/var/tmp/hiawatha -DPID_DIR=/var/run -DLOG_DIR=/var/log/hiawatha -DWEBROOT_DIR=/var/www/hiawatha
- make install/strip -j 8
- addgroup www-data
- adduser -s /sbin/nologin www-data -D -H -G www-data
- nano /etc/hiawatha/hiawatha.conf
- --Uncomment #ServerId = www-data
- nano /etc/init.d/hiawatha
- ==========
- #!/sbin/openrc-run
- # /etc/init.d/hiawatha: start and stop the Hiawatha webserver daemon
- NAME="Hiawatha"
- DAEMON=/usr/sbin/hiawatha
- WIGWAM=/usr/sbin/wigwam
- PIDFILE=/var/run/hiawatha.pid
- description="hiawatha-webserver.org on Alpine Linux"
- #extra_started=""
- #depend() {
- # dependency information if any required
- #depend net
- #use logger dns
- #}
- start() {
- rm -f $PIDFILE
- [ -x $DAEMON ] || exit 5
- umask 077
- echo -n $"Starting Hiawatha webserver: "
- $WIGWAM -q || failure
- start-stop-daemon --start --exec "$DAEMON" --pidfile "$PIDFILE"
- }
- stop() {
- echo -n $"Shutting down Hiawatha webserver: "
- start-stop-daemon --stop --exec $DAEMON --pidfile $PIDFILE
- }
- hwstatus() {
- echo "$PIDFILE" -l $NAME $DAEMON
- }
- restart() {
- stop
- start
- }
- ==========
- nano /etc/hiawatha/hiawatha.conf
- - Append to bottom of file, modify for your setup.
- ==========
- VirtualHost {
- Hostname = 192.168.1.198
- WebsiteRoot = /var/www/hiawatha
- AccessLogfile = /var/log/hiawatha/throat/access.log
- ErrorLogfile = /var/log/hiawatha/throat/error.log
- ReverseProxy / http://127.0.0.1:5000/
- }
- ==========
- mkdir /var/log/hiawatha/throat
- chmod +x /etc/init.d/hiawatha
- rc-service hiawatha start
- rc-update add hiawatha default
- # Now go back to throat folder and run
- su - app
- bash
- cd throat
- ./wsgi.py
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement