update enable mod_rewrite on container

This commit is contained in:
Ray Elliott 2020-03-19 13:25:29 +00:00
parent 6bd3bf2b50
commit 8f0497844b
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,11 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/wordpress
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<Directory /var/www/html/wordpress>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

View File

@ -5,6 +5,7 @@ set -e
_host="$_local_hostname.$_local_domain"
_user_root='root'
_ssh_cmd_root="ssh $_user_root@$_host"
_scp_to="$_user_root@$_host"
_ssh_cmd_www="sshpass -p$_passwd_www ssh $_user_www@$_host"
_ssh_cmd_www_cd="$_ssh_cmd_www cd /var/www/html/wordpress &&"
@ -15,7 +16,8 @@ printf "\nInstalling requirements ..."
$_ssh_cmd_root 'apt-get update && apt-get -y upgrade && apt-get -y install apache2 mariadb-server php php-common libapache2-mod-php python-mysqldb php-gd php-ssh2 php-mysql php-dom php-simplexml php-xml php-xmlreader php-curl php-ftp php-iconv php-imagick php-mbstring php-posix php-sockets php-tokenizer php-zip'
printf "\nConfiguring Apache ..."
$_ssh_cmd_root 'sed -i '\''s+DocumentRoot /var/www/html$+DocumentRoot /var/www/html/wordpress+'\'' /etc/apache2/sites-enabled/000-default.conf && systemctl restart apache2'
scp ./dev/config/000-default.conf "$_scp_to":/etc/apache2/sites-enabled/000-default.conf
$_ssh_cmd_root 'a2enmod rewrite; systemctl restart apache2'
printf "\nSetting %s permissions ..." "$_user_www"
$_ssh_cmd_root "echo \"$_user_www:$_passwd_www\" | chpasswd"