Apache2 Virtual Hosts Installation on Ubuntu

How to configure Apache2 quickly

By Robin Rowe

HOLLYWOOD, CA (LinuxMovies) 2015/10/18 – Ubuntu makes it easy to configure Apache2 for virtual hosts. Just follow these steps…

Apache2 Update/Install

apt-get update
apt-get install apache2 php5-gd

Create Website Directory

mkdir -p /var/www/example.com
chown -R www-data:www-data /var/www/example.com
chmod -R 755 /var/www/example.com

Create Website Data

vi /var/www/example.com/index.html
<html>
<body>
 <h1>Example.com</h1>
 </body>
</html>

Create Sites-available Conf

cd /etc/apache2/sites-available
cp 000-default.conf example.com.conf
sed -i s/default/example/g example.com.conf
a2ensite example.com.conf
service apache2 reload

DNS

Set domain registrar to point to your DNS host. Set your DNS host to serve your site.

Leave a Reply

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