2021-11-08 06:30:46
This commit is contained in:
16
bonus.sh
16
bonus.sh
@@ -6,7 +6,7 @@
|
||||
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2021/11/07 14:23:18 by gbaconni #+# #+# #
|
||||
# Updated: 2021/11/07 22:32:30 by gbaconni ### lausanne.ch #
|
||||
# Updated: 2021/11/08 06:30:44 by gbaconni ### lausanne.ch #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
@@ -29,9 +29,15 @@ ft_apache ()
|
||||
apt-get install -qq -y ssl-cert apache2
|
||||
a2enmod alias headers ssl
|
||||
a2ensite default-ssl
|
||||
sed -i 's/80/4243/g; s/443/4244/g;' /etc/apache2/ports.conf /etc/apache2/sites-available/{default,default-ssl}
|
||||
sed -i 's/@HostName/localhost/g' /usr/share/ssl-cert/ssleay.cnf
|
||||
sed -i 's/80/4243/g; s/443/4244/g;' /etc/apache2/ports.conf /etc/apache2/sites-available/{000-default,default-ssl}.conf
|
||||
sed -i 's/@HostName@/localhost/g' /usr/share/ssl-cert/ssleay.cnf
|
||||
make-ssl-cert generate-default-snakeoil --force-overwrite
|
||||
#openssl req -x509 \
|
||||
# -out /etc/ssl/certs/ssl-cert-snakeoil.pem \
|
||||
# -keyout /etc/ssl/private/ssl-cert-snakeoil.key \
|
||||
# -newkey rsa:2048 -nodes -sha256 \
|
||||
# -subj '/CN=localhost' -extensions EXT -config <( \
|
||||
# printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
|
||||
systemctl reload apache2
|
||||
fi
|
||||
return 0
|
||||
@@ -61,9 +67,9 @@ ft_wordpress ()
|
||||
if ! test -d /var/lib/mysql/wordpress
|
||||
then
|
||||
rm -f /etc/wordpress/config-localhost.php
|
||||
sed -i -r "s/(read.*)(yn|DB_PASSWORD)/\2=y/g; s/ -u \$DB_USER -p / -u root /g;" /usr/share/doc/wordpress/examples/setup-mysql
|
||||
sed -i -r "s/(read.*)(yn|DB_PASSWORD)/\2=y/g; s/ -u .DB_USER -p / -u root /g;" /usr/share/doc/wordpress/examples/setup-mysql
|
||||
bash -x /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost
|
||||
mysql -e "ALTER USER root@localhost IDENTIFIED BY '${password}'; FLUSH PRIVILEGES;" mysql
|
||||
mysql -u root -h localhost -e "ALTER USER root@localhost IDENTIFIED BY '${password}'; FLUSH PRIVILEGES;" mysql
|
||||
ln -snf /etc/wordpress/config-localhost.php /etc/wordpress/config-default.php
|
||||
fi
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user