How To Create a Self-Signed SSL Certificate for Apache in Ubuntu 20.04

Introduction
TLS, or “transport layer security” — and its predecessor SSL — are protocols used to wrap normal traffic in a protected, encrypted wrapper. Using this technology, servers can safely send information to their clients without their messages being intercepted or read by an outside party.

In this guide, we will show you how to create and use a self-signed SSL certificate with the Apache web server on Ubuntu 20.04.

Note: A self-signed certificate will encrypt communication between your server and any clients. However, because it is not signed by any of the trusted certificate authorities included with web browsers and operating systems, users cannot use the certificate to validate the identity of your server automatically. As a result, your users will see a security error when visiting your site.

Because of this limitation, self-signed certificates are not appropriate for a production environment serving the public. They are typically used for testing, or for securing non-critical services used by a single user or a small group of users that can establish trust in the certificate’s validity through alternate communication channels.

For a more production-ready certificate solution, check out Let’s Encrypt, a free certificate authority. You can learn how to download and configure a Let’s Encrypt certificate in our How To Secure Apache with Let’s Encrypt on Ubuntu 20.04 tutorial.

Prerequisites
Before starting this tutorial, you’ll need the following:

Access to a Ubuntu 20.04 server with a non-root, sudo-enabled user. Our Initial Server Setup with Ubuntu 20.04 guide can show you how to create this account.
You will also need to have Apache installed. You can install Apache using apt. First, update the local package index to reflect the latest upstream changes:

 $ sudo apt update

Then, install the apache2 package:

 $ sudo apt install apache2

And finally, if you have a ufw firewall set up, open up the http and https ports:

 $ sudo ufw allow "Apache Full"

After these steps are complete, be sure you are logged in as your non-root user and continue with the tutorial.

Step 1 — Enabling mod_ssl
Before we can use any SSL certificates, we first have to enable mod_ssl, an Apache module that provides support for SSL encryption.

Enable mod_ssl with the a2enmod command:

$ sudo a2enmod ssl
Restart Apache to activate the module:

$ sudo systemctl restart apache2
The mod_ssl module is now enabled and ready for use.

Step 2 – Creating the SSL Certificate
Now that Apache is ready to use encryption, we can move on to generating a new SSL certificate. The certificate will store some basic information about your site, and will be accompanied by a key file that allows the server to securely handle encrypted data.

We can create the SSL key and certificate files with the openssl command:

 $ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

After you enter the command, you will be taken to a prompt where you can enter information about your website. Before we go over that, let’s take a look at what is happening in the command we are issuing:

openssl: This is the command line tool for creating and managing OpenSSL certificates, keys, and other files.
req -x509: This specifies that we want to use X.509 certificate signing request (CSR) management. X.509 is a public key infrastructure standard that SSL and TLS adhere to for key and certificate management.
-nodes: This tells OpenSSL to skip the option to secure our certificate with a passphrase. We need Apache to be able to read the file, without user intervention, when the server starts up. A passphrase would prevent this from happening, since we would have to enter it after every restart.
-days 365: This option sets the length of time that the certificate will be considered valid. We set it for one year here. Many modern browsers will reject any certificates that are valid for longer than one year.
-newkey rsa:2048: This specifies that we want to generate a new certificate and a new key at the same time. We did not create the key that is required to sign the certificate in a previous step, so we need to create it along with the certificate. The rsa:2048 portion tells it to make an RSA key that is 2048 bits long.
-keyout: This line tells OpenSSL where to place the generated private key file that we are creating.
-out: This tells OpenSSL where to place the certificate that we are creating.
Fill out the prompts appropriately. The most important line is the one that requests the Common Name. You need to enter either the hostname you’ll use to access the server by, or the public IP of the server. It’s important that this field matches whatever you’ll put into your browser’s address bar to access the site, as a mismatch will cause more security errors.

The full list of prompts will look something like this:

Country Name (2 letter code) [XX]:US
State or Province Name (full name) []:Example
Locality Name (eg, city) [Default City]:Example 
Organization Name (eg, company) [Default Company Ltd]:Example Inc
Organizational Unit Name (eg, section) []:Example Dept
Common Name (eg, your name or your server's hostname) []:your_domain_or_ip
Email Address []:[email protected]
Both of the files you created will be placed in the appropriate subdirectories under /etc/ssl.

Next we will update our Apache configuration to use the new certificate and key.

Step 3 – Configuring Apache to Use SSL
Now that we have our self-signed certificate and key available, we need to update our Apache configuration to use them. On Ubuntu, you can place new Apache configuration files (they must end in .conf) into /etc/apache2/sites-available/and they will be loaded the next time the Apache process is reloaded or restarted.

For this tutorial we will create a new minimal configuration file. (If you already have an Apache set up and just need to add SSL to it, you will likely need to copy over the configuration lines that start with SSL, and switch the VirtualHost port from 80 to 443. We will take care of port 80 in the next step.)

Open a new file in the /etc/apache2/sites-available directory:

 $ sudo nano /etc/apache2/sites-available/your_domain_or_ip.conf

Paste in the following minimal VirtualHost configuration:

/etc/apache2/sites-available/your_domain_or_ip.conf

   ServerName your_domain_or_ip
   DocumentRoot /var/www/your_domain_or_ip

   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
   SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

Be sure to update the ServerName line to however you intend to address your server. This can be a hostname, full domain name, or an IP address. Make sure whatever you choose matches the Common Name you chose when making the certificate.

The remaining lines specify a DocumentRoot directory to serve files from, and the SSL options needed to point Apache to our newly-created certificate and key.

Now let’s create our DocumentRoot and put an HTML file in it just for testing purposes:

$ sudo mkdir /var/www/your_domain_or_ip

Open a new index.html file with your text editor:

$ sudo nano /var/www/your_domain_or_ip/index.html

Paste the following into the blank file:

/var/www/your_domain_or_ip/index.html

it worked!

This is not a full HTML file, of course, but browsers are lenient and it will be enough to verify our configuration.

Save and close the file
Next, we need to enable the configuration file with the a2ensite tool:

$ sudo a2ensite your_domain_or_ip.conf

Next, let’s test for configuration errors:

$ sudo apache2ctl configtest

If everything is successful, you will get a result that looks like this:

Output
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

The first line is a message telling you that the ServerName directive is not set globally. If you want to get rid of that message, you can set ServerName to your server’s domain name or IP address in /etc/apache2/apache2.conf. This is optional as the message will do no harm.

If your output has Syntax OK in it, your configuration file has no syntax errors. We can safely reload Apache to implement our changes:

$ sudo systemctl reload apache2

Now load your site in a browser, being sure to use https:// at the beginning.

You should see an error. This is normal for a self-signed certificate! The browser is warning you that it can’t verify the identity of the server, because our certificate is not signed by any of its known certificate authorities. For testing purposes and personal use this can be fine. You should be able to click through to advanced or more information and choose to proceed.

After you do so, your browser will load the it worked! message.

Note: if your browser doesn’t connect at all to the server, make sure your connection isn’t being blocked by a firewall. If you are using ufw, the following commands will open ports 80 and 443:

$ sudo ufw allow "Apache Full"

Next we will add another VirtualHost section to our configuration to serve plain HTTP requests and redirect them to HTTPS.

Step 4 — Redirecting HTTP to HTTPS
Currently, our configuration will only respond to HTTPS requests on port 443. It is good practice to also respond on port 80, even if you want to force all traffic to be encrypted. Let’s set up a VirtualHost to respond to these unencrypted requests and redirect them to HTTPS.

Open the same Apache configuration file we started in previous steps:

$ sudo nano /etc/apache2/sites-available/your_domain_or_ip.conf

At the bottom, create another VirtualHost block to match requests on port 80. Use the ServerName directive to again match your domain name or IP address. Then, use Redirect to match any requests and send them to the SSL VirtualHost. Make sure to include the trailing slash:

/etc/apache2/sites-available/your_domain_or_ip.conf

    ServerName your_domain_or_ip
    Redirect / https://your_domain_or_ip/

Save and close this file when you are finished, then test your configuration syntax again, and reload Apache:

$ sudo apachectl configtest
$ sudo systemctl reload apache2

You can test the new redirect functionality by visiting your site with plain http:// in front of the address. You should be redirected to https:// automatically.

Conclusion
You have now configured Apache to serve encrypted requests using a self-signed SSL certificate, and to redirect unencrypted HTTP requests to HTTPS.

If you are planning on using SSL for a public website, you should look into purchasing a domain name and using a widely supported certificate authority such as Let’s Encrypt.

For more information on using Let’s Encrypt with Apache, please read our How To Secure Apache with Let’s Encrypt on Ubuntu 20.04 tutorial.

How To Enable HTTP/2.0 Support on Apache

Enable HTTP2

HTTP/2 is the new updated HTTP protocol, and its supposed to be much more efficient than the now outdated http/1.1 version. Its goal is to reduce the latency as well as to make the web applications faster by allowing multiple concurrent requests between the web browser and the server across a single TCP connection. If you are looking to speed up the loading time of your website or blog then you should enable http/2.0 in your web server.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step enable HTTP/2.0 support in Apache running Ubuntu 16.04 (Xenial Xerus) server.
Enable HTTP/2.0 Support on Apache running Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Enable HTTP/2.0 Apache web server.

So make sure that your Apache version supporting HTTP/2 protocol. If you have not installed Apache or using older version upgrade it first. Use the following commands to add PPA for installing latest Apache2 version on your Ubuntu system:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get install apache2

Once installed, verify Apache version:

### apache2 -v
Server version: Apache/2.4.17 (Ubuntu)
Server built: 2017-03-05T00:00:00

Enable the HTTP/2.0 module by typing this commands:

sudo a2enmod http2

Restart Apache for the changes to take effect:

systemctl restart apache2

Now open your VirtualHost file ( e.g. most likely at this path /etc/apache2/sites-available/ ) and put this code in:

Protocols h2 http/1.1

Step 3. Verify HTTP/2.

Go to https://tools.keycdn.com/http2-test and test if http/2.0 is detected in your domain.

https://tools.keycdn.com/http2-test

Congratulation’s! You have successfully enable HTTP/2.0 apache web server. Thanks for using this tutorial for enable HTTP/2.0 support on Apache running Ubuntu 16.04 LTS (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official Apache web site.

How To Install Apache on CentOS 7

Apache on CentOS 7

Apache Web Server is an open source Web server creation, deployment and management software. Initially developed by a group of software programmers, it is now maintained by the Apache Software Foundation. Apache HTTP Server is the most popular web server in the world and has been so since April 1996. It played a key role in the growth of the World Wide Web. It is estimated that Apache Server is serving 54.2% of all active websites and 53.3% of the top servers across all domains.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Apache web server on a CentOS 7 server.
Install Apache on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing Apache on CentOS 7.

We will be installing Apache with yum, which is the default package manager for CentOS 7:

yum install httpd openssl mod_ssl

Once Apache has finished installing, the httpd service will need to be started and enabled so it will run automatically when the server starts:

sudo systemctl restart httpd
sudo systemctl status httpd
sudo systemctl enable httpd

You can verify that Apache is really running by opening your favorite web browser and entering the URL http://your-server’s-address. you should get a “Testing 123″ page similar to the image below:

Install Apache on CentOS 7

Step 3. Configure Firewalld for Apache.

Add new rule to Firewalld:

firewall-cmd --permanent --zone=public --add-service=http

## OR ##

firewall-cmd --permanent --zone=public --add-port=80/tcp

Restart firewalld service:

systemctl restart firewalld.service

Congratulation’s! You have successfully installed Apache. Thanks for using this tutorial for installing Apache web server on CentOS 7 system. For additional help or useful information, we recommend you to check the official Apache web site.

How To Install Live Helper Chat on CentOS 7

Live Helper Chat on CentOS 7

Live helper chat is a free, flexible, and open-source live support chat for your website. It is written in PHP and uses MySQL/MariaDB to store its data. It provides lots of features such as online user tracking, multiple chats, archive chat, user screenshots, file upload and much more. It provides desktop clients for operators and also supports XMPP. It is widely used on many websites.

Table of Contents

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Install LAMP server.

Step 3. Installing Live Helper Chat.

Step 4. Configuring MariaDB for Live Helper Chat.

Step 5. Configuring Apache web server for Live Helper Chat.

Step 7. Accessing Live Helper Chat.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Live Helper Chat on a CentOS 7 server.
Install Live Helper Chat on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Install LAMP server.

A CentOS 7 LAMP stack server is required. If you do not have LAMP installed, you can follow our guide here. Also install required PHP modules:

yum -y install php-gd php-imap php-ldap php-pear php-xml php-xmlrpc php-mbstring php-mcrypt curl curl-devel

Step 3. Installing Live Helper Chat.

First thing to do is to go to Live Helper Chat’s download page and download the latest stable version of Live Helper Chat:

wget https://github.com/remdex/livehelperchat/archive/master.zip

After downloading Concrete5 you will need to unzip master.zip. To do this, run:

unzip master.zip
mv livehelperchat-master /var/www/html/livechat

We will need to change some folders permissions:

chown -R apache:apache /var/www/html/livechat

Step 4. Configuring MariaDB for Live Helper Chat.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next we will need to log in to the MariaDB console and create a database for the Live Helper Chat. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Concrete5 installation:

MariaDB [(none)]>CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]>GRANT ALL PRIVILEGES ON livechatdb.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]>exit;

Step 5. Configuring Apache web server for Live Helper Chat.

We will create Apache virtual host for your Live Helper Chat website. First create ‘/etc/httpd/conf.d/vhosts.conf’ file with using a text editor of your choice:

nano /etc/httpd/conf.d/vhosts.conf
IncludeOptional vhosts.d/*.conf

Next, create the virtual host:

mkdir /etc/httpd/vhosts.d/
nano /etc/httpd/vhosts.d/yourdomain.com.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot "/var/www/html/livechat/lhc_web"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/html/livechat/lhc_web">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted

Save and close the file. Restart the Apache service for the changes to take effects:

systemctl restart httpd.service

Next step, we should allow HTTP traffic on port 80 through firewalld. You can do this by running the following command:

firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload

Step 7. Accessing Live Helper Chat.

Live Helper Chat will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com or http://server-ip and complete the required the steps to finish the installation.

Congratulation’s! You have successfully installed Live Helper Chat. Thanks for using this tutorial for installing Live Helper Chat on CentOS 7 system. For additional help or useful information, we recommend you to check the official Live Helper Chat web site.

How To Install LiteCart on CentOS 7

LiteCart on CentOS 7

LiteCart is a free e-commerce, feature rich e-commerce solution. The framework is constructed to be lightweight and easy for developers to modify and build upon. LiteCart relies on the latest HyperText standard HTML 5, the latest CSS 3 for styling, the amazing jQuery framework for client-side dynamics, and the popular web scripting language PHP for server-side dynamics.

Table of Contents

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Install LAMP server.

Step 3. Installing LiteCart.

Step 4. Configuring MariaDB for LiteCart.

Step 5. Configure Apache web server for LiteCart.

Step 6. Accessing LiteCart e-commerce.

 

 

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root accge of Linount, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation LiteCart e-commerce on a CentOS 7 server.
Install LiteCart on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Install LAMP server.

A CentOS 7 LAMP stack server is required. If you do not have LAMP installed, you can follow our guide here. Also install required PHP modules:

yum -y install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy curl curl-devel

Step 3. Installing LiteCart.

First thing to do is to go to LiteCart’s download page and download the latest stable version of LiteCart, At the moment of writing this article it is version 2.0.2:

unzip litecart-2.0.2.zip -d litecart

We will need to change some folders permissions:

chown -R chown apache:apache -R litecart/

Step 4. Configuring MariaDB for LiteCart.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next we will need to log in to the MariaDB console and create a database for the LiteCart. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for LiteCart installation:

MariaDB [(none)]> CREATE DATABASE lite DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON lite.* TO 'liteuser'@'localhost' IDENTIFIED BY 'strong_password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Step 5. Configure Apache web server for LiteCart.

We will create Apache virtual host for your LiteCart website. First create ‘/etc/httpd/conf.d/vhosts.conf’ file with using a text editor of your choice:

nano /etc/httpd/conf.d/vhosts.conf
IncludeOptional vhosts.d/*.conf

Next, create the virtual host:

mkdir /etc/httpd/vhosts.d/
nano /etc/httpd/vhosts.d/yourdomain.com.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot "/var/www/html/litecart/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/html/litecart/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted


Save and close the file. Restart the apache service for the changes to take effects:

systemctl restart httpd.service

Step 6. Accessing LiteCart e-commerce.

LiteCart e-commerce will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/ or http://server-ip and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed LiteCart. Thanks for using this tutorial for installing LiteCart e-commerce on CentOS 7 systems. For additional help or useful information, we recommend you to check the official LiteCart web site.

How To Set up WebDAV using Apache on CentOS 7

WebDAV using Apache on CentOS 7

WebDAV (Web-based Distributed Authoring and Versioning) is an Extension of the HTTP protocol that allows users to edit and manage files and documents stored on servers.

WebDAV provides a frame for users to create, alter, move, Upload, and download documents on an Apache web server. This makes WebDAV a favorite choice for programmers, especially when combined with Subversion or Git.

Table of Contents

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Installing Apache web server.

Step 3. Configure WebDAV.

Step 4. Configure Apache vhost for WebDAV.

Step 5. Accessing WebDAV.

 

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step set up WebDAV using Apache on CentOS 7 server.
Set up WebDAV using Apache on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y install epel-release
yum -y update

Step 2. Installing Apache web server.

Install Apache using YUM:

yum install httpd

Start the Apache web server:

systemctl start httpd.service
systemctl enable httpd.service

For Apache, there are three WebDAV-related modules which will be loaded by default when a Apache web server getting started. You can confirm that with this command:

httpd -M | grep dav

You should be result with:

dav_module (shared)
dav_fs_module (shared)
dav_lock_module (shared)

Step 3. Configure WebDAV.

After installing the WebDAV module, you will need to create a webdav directory:

mkdir /var/www/html/webdav
chown -R apache:apache /var/www/html
chmod -R 755 /var/www/html

Set up password authentication:

htpasswd -c /etc/httpd/.htpasswd chedelics

Now, you need to assign group ownership of the file to the apache user, and lock down the permissions for everyone else. To do this, run the following command:

chown root:apache /etc/httpd/.htpasswd
chmod 640 /etc/httpd/.htpasswd

Step 4. Configure Apache vhost for WebDAV.

Next, you need to create a virtual host file for the webdav directory:

nano /etc/httpd/conf.d/webdav.conf

Add the following content:

DavLockDB /var/www/html/DavLock

 ServerAdmin webmaster@localhost
 DocumentRoot /var/www/html/webdav/
 ErrorLog /var/log/httpd/error.log
 CustomLog /var/log/httpd/access.log combined
 Alias /webdav /var/www/html/webdav
 
 DAV On
 AuthType Basic
 AuthName "webdav"
 AuthUserFile /etc/httpd/.htpasswd
 Require valid-user
 

Save and exit, Restart Apache to put your changes into effect:

systemctl restart httpd.service

Step 5. Accessing WebDAV.

WebDAV will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://mydomain.com/webdav and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed WebDAV using Apache on CentOS 7. Thanks for using this tutorial for set up WebDAV using Apache on CentOS 7 systems. For additional help or useful information, we recommend you to check the official WebDAV web site.

How To Install Akaunting on CentOS 7 Step by Step

Install Akaunting on CentOS 7

Akaunting is a free and online accounting software designed for small businesses to manage their finances and stay on top of their cash flow. Invoicing, accepting online payments and keeping track of expenses couldn’t be simpler. Akaunting is built with modern technologies such as Laravel, Bootstrap, jQuery, Swift Mailer, API etc. In this tutorial we will learn how to Install Akaunting on CentOS 7 step by step.

Prerequisites

This tutorial assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root accge of Linount, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Akaunting online accounting software on a CentOS 7 server.

Install Akaunting on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Install LAMP server.

A CentOS 7 LAMP stack server is required. If you do not have LAMP installed, you can follow our guide here. Also install required PHP modules:

yum -y install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy curl curl-devel

Step 3. Installing Akaunting on CentOS 7.

First thing to do is to go to Akaunting’s download page and download the latest stable version of Akaunting,:

cd /var/www/akaunting
curl -O -J -L https://akaunting.com/download.php?version=latest
unzip Akaunting_1.1.15-Stable.zip

We will need to change some folders permissions:

chown -R chown apache:apache -R /var/www/akaunting

Step 4. Configuring MariaDB for Akaunting.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next we will need to log in to the MariaDB console and create a database for the Akaunting. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Akaunting installation:

MariaDB [(none)]> CREATE DATABASE dbname;
MariaDB [(none)]> GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 5. Configure Apache web server for Akaunting.

We will create Apache virtual host for your Akaunting website. First create ‘/etc/httpd/conf.d/vhosts.conf’ file with using a text editor of your choice:

nano /etc/httpd/conf.d/vhosts.conf
IncludeOptional vhosts.d/*.conf

Next, create the virtual host:

mkdir /etc/httpd/vhosts.d/
nano /etc/httpd/vhosts.d/yourdomain.com.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot "/var/www/akaunting"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/akaunting/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted


Save and close the file. Restart the apache service for the changes to take effects:

systemctl restart httpd.service

Step 6. Accessing Akaunting.

Akaunting will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/ or http://server-ip and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed Akaunting. Thanks for using this tutorial for installing Akaunting online accounting software on CentOS 7 systems. For additional help or useful information, we recommend you to check the official Akaunting web site.