728x90
1. firewall disable & selinux disable
vi /etc/sysconfig/selinux
systemctl stop firewalld
systemctl disable firewalld
2. Install core system packages and remi php repository
yum check-update
yum install -y git httpd curl wget yum-utils mariadb-server
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
yum-config-manager --enable remi-php82
yum install -y php php-cli php-common php-gd php-json php-ldap php-mysqlnd php-mbstring php-tidy php-xml php-zip php-mcrypt php-opcache
3. Start Apache & Mariadb
systemctl start httpd
systemctl start mariadb
4. Set Apache and Mariadb to start on system boot
systemctl enable httpd
systemctl enable mariadb
5. Set up database
CREATE DATABASE bookstack;
CREATE USER 'bookstack'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON bookstack.* TO 'bookstack'@'localhost';
FLUSH PRIVILEGES;
6. Download BookStack
cd /var/www
git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch bookstack
cd /var/www/bookstack
7. Install composer
wget https://composer.github.io/installer.sig -O - -q
curl -s https://getcomposer.org/installer > composer-setup.php
php composer-setup.php --quiet
php composer.phar install
8. Copy and update BookStack environment variables
cp .env.example .env
================================================================================
# Database details
APP_URL=http://172.23.0.10
DB_HOST=localhost
DB_DATABASE=bookstack
DB_USERNAME=bookstack
DB_PASSWORD=password
================================================================================
9. Generate the application key
php artisan key:generate --no-interaction --force
10. Migrate the databases
php artisan migrate --no-interaction --force
11. Set BookStack file and folder permissions
chown apache:apache -R bootstrap/cache public/uploads storage && chmod -R 755 bootstrap/cache public/uploads storage
12. Set up Apache VirtualHost
mkdir /etc/httpd/sites-available /etc/httpd/sites-enabled
echo "IncludeOptional sites-enabled/*.conf" >> /etc/httpd/conf/httpd.conf
cat >/etc/httpd/sites-available/bookstack.conf <<EOL
<VirtualHost *:80>
ServerName ${DOMAIN}
ServerAdmin webmaster@localhost
DocumentRoot /var/www/bookstack/public/
<Directory /var/www/bookstack/public/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
</Directory>
ErrorLog /var/log/httpd/bookstack-error.log
CustomLog /var/log/httpd/bookstack-access.log combined
</VirtualHost>
EOL
ln -s /etc/httpd/sites-available/bookstack.conf /etc/httpd/sites-enabled/bookstack.conf
13. Restart apache to load new config
systemctl restart httpd
You can login with the email 'admin@admin.com' and password of password
728x90
'IT > LINUX' 카테고리의 다른 글
서버 ping 체크 스크립트 (2) | 2023.04.20 |
---|---|
ubuntu timezone 변경 (0) | 2023.04.18 |
tcpdump 사용법 (0) | 2023.02.09 |
Docker 웹 GUI 관리 툴 (0) | 2022.11.18 |
Docker 기본 명령어 (1) | 2022.11.18 |