Created
June 10, 2020 16:08
-
-
Save kngvamxx/582a187510eda9d74b879ae52a1e44b4 to your computer and use it in GitHub Desktop.
mautic using lamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://www.mautic.org/download/latest | |
The file will be saved as latest. Use unzip command to unzip it to /var/www/mautic/ directory. | |
sudo apt install unzip | |
sudo unzip latest -d /var/www/mautic/ | |
Then make the web server user (www-data) as the owner of this directory. | |
sudo chown -R www-data:www-data /var/www/mautic/ | |
Step 2: Create a MariaDB Database and User for Mautic | |
Now we need to log in to MariaDB console and create a database and user for Mautic. By default, the MaraiDB package on Ubuntu uses unix_socket to authenticate user login, which basically means you can use username and password of the OS to log into MariaDB console. So you can run the following command to login without providing MariaDB root password. | |
# Install MySQL & check | |
sudo apt install mysql-server | |
sudo mysql_secure_installation | |
mysql --version | |
sudo service mysql start | |
sudo service mysql enable | |
sudo service mysql stop | |
sudo service mysql start | |
sudo service mysql restart | |
# Create MySQL DB, User | |
sudo mysql -u root -p | |
CREATE DATABASE wpdata DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
GRANT ALL ON wpdata.* TO 'wpuser'@'localhost' IDENTIFIED BY 'Hira2019#@'; | |
FLUSH PRIVILEGES; | |
EXIT; | |
#INSTALL PHP | |
sudo apt-get install php7.2 php7.2-cli php7.2-fpm php7.2-mysql php7.2-json php7.2-opcache php7.2-mbstring php7.2-xml php7.2-gd php7.2-curl | |
##INSTALL APACHE | |
sudo apt install apache2 | |
sudo systemctl restart apache2 | |
Step 4: Create Apache Virtual Host or Nginx Config File for Mautic | |
Apache | |
If you use Apache web server, create a virtual host for Mautic. | |
sudo nano /etc/apache2/sites-available/mautic.conf | |
Put the following text into the file. Replace mautic.example.com with your real domain name and don’t forget to set DNS A record for it. | |
<VirtualHost *:80> | |
ServerName mautic.example.com | |
DocumentRoot /var/www/mautic/ | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride All | |
</Directory> | |
<Directory /var/www/mautic/> | |
Options FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> | |
</VirtualHost> | |
Save and close the file. Then enable this virtual host with: | |
sudo a2ensite mautic.conf | |
Reload Apache for the changes to take effect. | |
sudo systemctl reload apache2 | |
visit-localhost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment