UBUNTU DUMP‎ > ‎

Ubuntu - Virtual Host

posted 22 Dec 2016, 07:33 by Donald Ross   [ updated 24 Sept 2017, 07:57 ]
***NOTES - https://www.youtube.com/watch?v=yUWtrYlM_9c

192.168.100.61

donald@ubuntuWEB1:~$ cat /etc/apache2/sites-available/000-default.conf
NameVirtualHost *

<VirtualHost *:8080>
        ServerName sitea.com
        ServerAlias www.sitea.com
        DocumentRoot /var/www/html/sitea
        ErrorLog /var/www/html/logs/sitea.log
        CustomLog /var/www/html/logs/sitea.log combined
</VirtualHost>

<VirtualHost *:80>
        ServerName siteb.com
        ServerAlias www.siteb.com
        DocumentRoot /var/www/html/siteb
        ErrorLog /var/www/html/logs/siteb.log
        CustomLog /var/www/html/logs/siteb.log combined
</VirtualHost>

<VirtualHost *:80>
        ServerName sitec.com
        ServerAlias www.sitec.com
        DocumentRoot /var/www/html/sitec
        ErrorLog /var/www/html/logs/sitec.log
        CustomLog /var/www/html/logs/sitec.log combined
</VirtualHost>

---------------------

donald@ubuntuWEB1:~$ cat /etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80
Listen 8080

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
donald@ubuntuWEB1:~$

------

donald@ubuntuWEB1:/var/www/html$ ls
index.html  logs  sitea  siteb  sitec

-------


#QUICK ADD~

sudo mkdir /var/www/html/lab82
sudo mkdir /var/www/html/lab82/index.html

###add listening ports###
sudo nano /etc/apache2/ports.conf
#ADD THIS###
Listen 88
#ADD THIS###

###add virtual host###
sudo nano /etc/apache2/sites-available/000-default.conf
#ADD THIS###
<VirtualHost *:82>

DocumentRoot /var/www/html/lab82

</VirtualHost>
#ADD THIS###

sudo service apache2 restart



Comments