Ubuntu Hosting

Initial Server Setup with Ubuntu

Make sure your Ubuntu is secure. Let’s go to setup secure Ubuntu Server.

How To Install Vesta Control Panel on Ubuntu

Lets go to Install VestaCP’s guide.

Missing PHP Extensions

Firstly, please check your version of you PHP

How to Check Version PHP

sudo php -v

php-gd Extension

How to Install php-gd extension.

PHP7.1

sudo apt-get install php7.1-gd

soap Extension

How to Install soap extension.

PHP7.1

sudo apt-get install php7.1-soap 
sudo systemctl restart apache2

.conf Redirect to HTTPS (conf/web/…)

return 301 https://$server_name$request_uri;

Example:

server {
    listen      XX.XX.XX.XX:80;
    server_name sample.com www.sample.com;
    error_log  /var/log/apache2/domains/sample.com.error.log error;

    location / {
        proxy_pass      http://XX.XX.XX.XX:8080;
        return 301 https://$server_name$request_uri;
        location ~* 
        }
    }
}

.htaccess: Redirect to specific URL

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^oldwebsite.com [NC,OR]
 RewriteCond %{HTTP_HOST} ^www.oldwebsite.com [NC]
 RewriteRule ^(.*)$ https://newwebsite.com/$1 [L,R=301,NC]
</IfModule>

.htaccess: Redirect to all new domain

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^oldwebsite.com [NC,OR]
 RewriteCond %{HTTP_HOST} ^www.oldwebsite.com [NC]
 RewriteRule ^(.*)$ https://newwebsite.com/ [L,R=301,NC]
</IfModule>

Leave a comment

Your email address will not be published. Required fields are marked *