by George Damian , 9 months ago
In the following article I will guide you through the process of setting up a fresh LAMP environment on a Centos 7 server with Apache, PHP 7 and MariaDB.
I chose a DigitalOcean droplet for this server but you can use whatever hosting provider you, since the setup steps are pretty much the same for all hosting providers. As shown in the image below, I chose a 2GB of RAM, single CPU and 50GB of SSD for $10 a month.
Create Dropplet and access credentials
Before hitting that create button, don’t forget to create a set of SSH Keys and add it to your droplet if you want to login to your server via SSH Keys. In order to create the SSH Keys you can follow the Windows tutorial or Linux/MacOS tutorial.
As the Windows tutorial wasn’t quite matching my Windows 10 config, I had to improvise a bit, by doing the following:
ssh-keygen -t rsa
I have decided to use regular login as fallback, so I had to
PasswordAuthentication Yes parameter
inside /etc/ssh/sshd_config and restart the ssh daemon via
service sshd restart. Now that you are
here, as a additional security measure, you can also disable root login by
updating the line
Either way you choose to use your server ( SSH Keys or Regular credentials ), after initial login, don’t forget to create a privileged user, and use that one instead of root for further usage:
passwd devgpasswd -a dev wheel
usermod -d /var/www/domain.com username #( change homedir for easier access if using SFTP )
I personally like nano as my file editor, so on each fresh system I start by installing it. You can ignore this step if you use another editor:
sudo yum install nano
Another thing I will do with this server, is to assingn a domain name to it, so then we can easily access the web server and even the other services by pointing to it instead of the IP address. This can be done by updating your domain nameservers, making point to digitalocean nameservers, and then in the digitalocean panel, you will need to park your domain, as in the picture below.
Installing the LAMP Stack
We will now start installing the LAMP Stack, including PHP 7.2, MariaDB, Apache and couple additional security related programs.
1) Install PHP 7.2
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install yum-utils
sudo yum-config-manager --enable remi-php72
sudo yum -y install php php-opcache
sudo yum -y install php-mysqlnd php-pdo php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel
2) Install MariaDB
sudo yum -y install mariadb-server mariadb
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Then when the mysql installation prompt will start, you will just have to go with these simple options:
Enter current password for root (enter for none): Just press enter
New password: Root Pass
Re-enter new password: Root Pass
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Reload privilege tables now? [Y/n] Y
After installation is complete, what I usually do instead of using softs like PHPMyAdmin, is I create a mysql user with remote access so I can manage the databases via clients like HeidiSQL. Run the command below and enter the root password entered in the steps above.
mysql –u root –p
This will create a user with access over all DBs and will only be allowed to connect from specified IP address. To allow remote access from any IP, use a wildcard (%)
GRANT ALL PRIVILEGES ON *.* TO 'user'@IP_ADDRESS' IDENTIFIED BY 'password' WITH GRANT OPTION;
Then if you want to use another MySql user for your actual web apps, create another like down below
GRANT ALL PRIVILEGES ON *.* TO 'app'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
3) Install Apache
sudo yum -y install httpd #( should be already installed)
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
Create a folder to serve your actual website:
sudo mkdir /var/www/html/domain.com sudo chown -R apache:apache /var/www/html sudo chmod -R 755 /var/www/html
Add the Apache virtualhosts:
sudo mkdir /etc/httpd/sites-enabled && sudo nano /etc/httpd/conf/httpd.conf
Then at the end of that configuration file, add the following line
After you've addded that line, it's time to create a new virtualhost file for our domain, so we will start by creating a new file like this one:
sudo nano /etc/httpd/sites-enabled/domain.com.conf
And inside this file you will need to add something like this:
<VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com DocumentRoot /var/www/html/domain.com </VirtualHost> <Directory /var/www/html/domain.com> Options +FollowSymLinks RewriteEngine On </Directory>
Save that file and restart the Apache server with
sudo apachectl restart. You can then repeat this procedure to serve as many domains you want.
Additonal security implementations
Fail2ban will automatically ban continuous failed SSH logins, in the case you chose not to use SSH keys.
sudo yum install fail2ban
sudo systemctl enable fail2ban
sudo nano /etc/fail2ban/jail.local
And inside the config file, you can add the following rules or update them as you wish:
[DEFAULT] # Ban hosts for one hour: bantime = 3600 # Override /etc/fail2ban/jail.d/00-firewalld.conf: banaction = iptables-multiport [sshd] enabled = true ignoreip = 127.0.0.1/8 126.96.36.199 findtime = 600 maxretry = 3 ignoreip = 127.0.0.1/8
Mod_evasive is an Apache module that will ban abusive HTTP requests made by users. This will be able to handle low to moderate DDOS attacks on your server.
sudo yum install mod_evasive –y
sudo nano /etc/httpd/conf.d/mod_evasive.conf
Then to get you started, here are some rules to get you started:
3) Install SSL with CertBot
SSL is a must these days, so grab your certificates using Certbot and following commands
sudo yum install certbot-apache sudo certbot –apache
When you are asked about domains to install the certificates for, leave blank for all of them. In order to automatically renew your certificates, let's add a cron rule to renew them once 3 months, so open up the crontab with
sudo nano /etc/crontab and add the following line:
5 8 * * 0 root certbot renew --quiet > /dev/null 2>&1
This should get your data secured.
Now if everything worked well, you should have your own LAMP server ready to go! This should be enough for your favourite PHP powered apps like Wordpress/Joomla/Drupal or PHP Frameworks like Laravel/Symfony/CakePHP.
Web applications are getting more powerful, therefore the tools for building them need to increase in power too. Web frameworks are becoming better and they make the whole web development process a piece of cake.
While the availability of different frameworks is cool, it generates confusion among developers. Questions like “Which is the best framework?”, “Which is the easiest to learn?”, “Which framework do companies use more?”, are raised.
In this article, we would have a brief overview of the three big frontend web development frameworks, Angular, React, Vue.
We would be looking at the three frameworks in alphabetical order.
Open sourced in 2010, Angular is a powerful web framework created by Misko Hevery. Angular was built as a side project while Hevery was a developer at Google.
Open sourced in 2013, React was created by Jordan Walke. Just like in the case of Angular, React was created while Walke was an employee of a big company, this time Facebook.
Unlike Angular, React is not a framework, instead it’s library. React was built under the influence of XHP which serves as an HTML component for PHP.
React uses JSX, which adds XML/HTML syntax to React applications. The main objective of creating the library was to build HTML components and it does it well.
Open sourced in 2014, Vue was created by Evan You. Unlike React and Angular, Vue wasn’t built with the influence of any big company.
Vue is more like a combination of React and Angular as Evan You merged what he felt were the best components of both frameworks. Vue is used to build event driven web applications using native web APIs, HTML templates and CSS.
Angular, React and Vue are powerful frontend web frameworks, they also have their best use cases.
To wrap it up, let’s take a look at some of them: Angular is the best tool to use for single page applications, React is the best for DOM management, Vue is best for building event driven web applications.
the evolution of technology started, we’re in a constant state of change. Every
year we make some of the assumptions and estimates regarding the new technology
trends for the New Year. Most of those estimates are in actual are informed
guess, based on the ongoing work in the variety of fields. So, if you love to
stay update or if you love the latest technology trends, this piece of writing
is all about your fantasies.
In this writing output, we will discuss some of the most awaiting tech trends of 2019. So, keep on reading to know more.
1. Data privacy
With the involvement of the internet in the most vital decision of our lives, our privacy has become more prone to privacy breaches. Among all internet of things devices, it becomes effortless for hackers to perform data breaches. With the new tech trend discussion going on, here are the two most positive and latest trend in data security. Zero knowledge proof is the technological trends that will enable the users to enhance the transactions security with the use of mathematics.
Along with Zero Knowledge Proof, the trendsetters are also working towards securing the businesses with the continuous adapting technology-CARTA. CARTA is the abbreviation for Continuous adaptive Risk and Trust Assessment, and it offers the maximum protection by adopting according to the nature of business transaction and experiences.
2. Artificial intelligence
Automation is the new buzz in the market and every business regardless of the nature of service offering is indulge in it. Artificial intelligence is the part of automation and no matter how old this technology might get. But the advancement in it will always pose the potential to change our lives for good. The concept of artificial intelligence comprises machines that portray intelligence akin to human and perform task accordingly. With the further advancements in the artificial intelligence, now we will make the machine capable of making a decision based on experience.
3. Machine Learning
Machine learning is a type of artificial intelligence. As we have mentioned above that now, the developers are moving towards making the machine capable of decision making this is what machine learning is all about. With the help of machine learning, now the machines do not have to depend on the formulas, codes and algorithms to perform tasks as now they can perform according to the experience and situations.
4. Robotic process automation
The automation process does not end t artificial intelligence or machine learning, but it goes way beyond that to RPA. RPA is the technological facility that offers ease and convenience to the businesses and individual as a whole. It assists with the automation of the processes, facilitating the transactions and dealing with large piles of data. In 2019, we will witness more advancement into the field of RPA, although it is posing a threat to the employment status across the globe, however, at the same time in the automation field, it is creating lucrative opportunities as well.
Well, yes, most of you will think that it is related to cryptocurrencies till now. However, with the changing pattern of security and demand for a secure and safe working environment, the blockchain has become one of the most sought-after technology.
The blockchain is the term used for the process which is widely in use for the protection of transaction information in cryptocurrencies. A blockchain will allow only the flow of information in one direction i-e in forwarding direction and thus protect the data from being misused. Due to the one way flow of data, cryptocurrencies are the most secure form of the transaction now, and the indulgence of blockchain process in another field will help to gain the same safety.
6. Virtual reality and augmented reality
In the start, virtual reality only offers the creativity in the field of games. However, with the new insight into the field of virtual reality, now the developers are more concerned with the use of this technology in almost every other field. Virtual reality is something that tends the person to immerse into a certain environment where on the other hand augmented reality offers a more enhanced environment. The use of VR and AR in 2019 will be more inclined to be used in security, medical and training fields.
7. Internet of things
Isn’t it feel fantastic to control most of your life through a simple internet connection and a device? Well, the internet of things is all about connecting various things through a single platform. The advancement in the IoT leads us to control our lives, our appliances and protect our homes. This cloud technology is connecting the various devices over cloud through simple internet connectivity and that pretty much our future.
8. Edge computing
One step ahead of cloud computing, edge computing offers the users a facility of small data centers, It can process the data without being connected to the centralised station. This not only helps us to manage the large piles of data but also save lots of time.
9. 3D printing
By just adding the little bit of information in the system now you can make any 3D model. In 3D printing, a model is prepared under the supervision of a computer in which the material is added together, and then the machines follow the commands from a computer.
10. Digital twins
Who does not want to be at two different places at the same time? Well, we all love to experience it. The digital twins are the digital representation of anything in the real world. In 2019, we will see more advancement into this technology to get more on the real world affairs.
So, we have mentioned some of the most expected trends that are going to be on top in the year 2019. If you know any new trend or want to share your experience with any of this technology, we are more than hearing all you need is to do let us know about it in comments.