Install Script for Ubuntu 20.4 with apache2 #860
Unanswered
reset12
asked this question in
Troubleshooting
Replies: 2 comments
-
|
works? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Better you try this: https://www.howtoforge.com/ispconfig-autoinstall-debian-ubuntu/ this is much better and give you so much more possibilities... And you become a server administration like cpanel for free... ISPConfig is so a great software and if you create a client with a site you can install ph7cms regularly... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
i have created a script to install PH7-Social-Dating-CMS on Ubuntu 20.4 with Apache2 as Webserver.
Feel free to insert it in your software.
#!/bin/bash
script to install ph7cms on ubuntu 20.4
echo "password for mysql root user"
read pwd
user=$(whoami)
webdir=/var/www/html/ph7builder/
echo "Directory where ph7cms is installed "
read webdir
webdir=/var/www/html/ph7builder/
echo "Servername "
read servername
Only for local Tests
sudo sed '/example.com/! s/$/127.0.0.1 '$servername'/' /etc/hosts >/tmp/hosts
sudo mv /tmp/hosts /etc/hosts
Install ph7cms
#install apache2/php
sudo apt update
sudo apt install apache2
sudo tee /etc/apache2/sites-available/ph7builder.conf <<EOF
<VirtualHost *:80>
ServerAdmin admin@$servername
DocumentRoot $webdir
ServerName $servername
sudo a2ensite ph7builder.conf
sudo a2ensite ph7builder
sudo a2dissite 000-default
sudo a2enmod rewrite
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
sudo systemctl restart apache2.service
sudo systemctl reload apache2
install mariadb
sudo apt-get install mariadb-server mariadb-client
sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
sudo usermod -a -G mysql $user
sudo mysql_secure_installation
sudo mysql mysql -u root -p$pwd -e "Drop Database ph7cms;DROP USER 'ph7user'@'localhost';"
sudo mysql mysql -u root -p$pwd -e "CREATE DATABASE ph7cms DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;FLUSH PRIVILEGES;"
sudo mysql -u root -p$pwd -e "CREATE USER 'ph7user'@'localhost' IDENTIFIED BY '$pwd';FLUSH PRIVILEGES;"
sudo mysql -u root -p$pwd -e "GRANT ALL ON ph7cms.* TO 'ph7user'@'localhost' IDENTIFIED BY '$pwd' WITH GRANT OPTION;FLUSH PRIVILEGES;"
sudo mysql -u root -p$pwd -e "grant all privileges on ph7cms.* to root@localhost identified by '$pwd';FLUSH PRIVILEGES;"
sudo mysql -u root -p$pwd -e "FLUSH PRIVILEGES;"
sudo apt install php7.4-fpm php7.4-common php7.4-sqlite3 php7.4-curl php7.4-intl
sudo apt install php7.4-mbstring php7.4-xmlrpc php7.4-mysql php7.4-gd php7.4-xml php7.4-cli php7.4-zip libapache2-mod-php php-mysql
sudo a2enmod php7.4
sudo sed -i 's/file_uploads*/file_uploads = On/' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/allow_url_fopen/allow_url_fopen = On/' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/short_open_tag = */short_open_tag = On/' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/memory_limit = */memory_limit = 256M/' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/cgi.fix_pathinfo = */cgi.fix_pathinfo = 0/' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/upload_max_filesize = */upload_max_filesize = 100M/' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/max_execution_time = */max_execution_time = 360/' /etc/php/7.4/fpm/php.ini
sudo sed -i 's/date.timezone = */date.timezone = Europe/Berlin/' /etc/php/7.4/fpm/php.ini
sudo mkdir -p $webdir
sudo echo "" >$webdir/phpinfo.php
sudo chmod +x $webdir/phpinfo.php
sudo chown www-data:www-data $webdir/phpinfo.php
sudo chown -R www-data:www-data /var/www
#install cms
cd /tmp
wget https://sourceforge.net/projects/ph7socialdating/files/latest/download
sudo unzip /tmp/download -d $webdir
cd /var/www
find ./ -type d -print | awk '{print "sudo chmod 777 "$1}'|xargs -n4
find ./ -type f -print | awk '{print "sudo chmod 666 "$1}'|xargs -n4
sudo chown -R www-data:www-data /var/www
sudo reboot
Beta Was this translation helpful? Give feedback.
All reactions