Resources for Setting Up New Server

Upcloud and A2hosting are two fantastic VPS hosting.

SETTING UP NEW SERVER ON A2 HOSTING

This is for CentOS 7 on A2server

A2 hosting was chosen because of:

1. Setting up LAMP stack

2. Accessing your account:

3. Back-up data (document from A2), also should see Khoi’s document on OE:

tar cvpzf /backups/backup-$(date +\%Y\%m\%d).tgz --exclude=/proc --exclude=/lost+found --exclude=/backups --exclude=/dev --exclude=/sys --exclude=/boot/grub --exclude=/etc/fstab --exclude=/etc/sysconfig/network-scripts/ --exclude=/etc/udev/rules.d/70-persistent-net.rules --exclude=/home/some_other_folders

4. Install EPEL repository on CentOS 7:

5. Change timezone on Linux shell:

6. Set default text Editor:

7. Obtaining free SSL certificate (from Let’sEncrypt):

8. Setting up owner of /var/www/html folders, to easy update website:

9. Creating groups, users; Assigning passwords:

10. Force using https access using .htaccess:

11. Configure PHP to read .htaccess file on a CentOS 7 server

We need to modify the httpd.conf file:

vi /etc/httpd/conf/httpd.conf

In this file: after <Directory "/var/www/html">, modify AllowOverride None to AllowOverride Options.

Save the file (hit Esc, type :wq and then Enter)

Restart httpd service:

systemctl restart httpd

12. Dreamweaver:

13. Setting up firewall for CentOS 7:

14. MySQL/MariaDB

15. Installing phpMyAdmin

16. Working with tar files

17. Setting up multiple websites with multiple domains on the same server

<VirtualHost XX.XX.XX.XX:80>
    DocumentRoot /var/www/html/site2.com
    ServerName server.site2.com
    ServerAlias site2.com www.site2.com
</VirtualHost>
    • After that use “/usr/local/sbin/certbot --apache -d example.com -d www.example.com” . The content of site2.com.conf file will be automatically changed. Here is example of the content of site2.com.conf after running the “certbot-auto…”

<VirtualHost XX.XX.XX.XX:80>
    DocumentRoot /var/www/html/site2.com
    ServerName server.site2.com
    ServerAlias site2.com www.site2.com
</VirtualHost>
<IfModule mod_ssl.c>
    <VirtualHost XX.XX.XX.XX:443>
        DocumentRoot /var/www/html/site2.com
        ServerName server.site2.com
        ServerAlias site2.com www.site2.com
        SSLCertificateFile /etc/letsencrypt/live/site2.com/cert.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/site2.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateChainFile /etc/letsencrypt/live/site2.com/chain.pem
    </VirtualHost>
</IfModule>

18. Working with WordPress

19. Setting up Booked Scheduler

Last updated