sudo mkdir -p /www/domain
2. Change permissions
sudo chown 755 /www/domain sudo chown -R www-data:www-data /www/domain
3. Edit Apache2 conf
sudo gedit /etc/apache2/apache2.conf Add these lines:
1 2 3 4 5 6 7 8 9 10 11 12 | < VirtualHost *:80> # This first-listed virtual host is also the default for *:80 ServerName gabo.com ServerAlias gabo.com DocumentRoot /www/domain </ VirtualHost > < Directory /www/domain/> Options Indexes FollowSymLinks AllowOverride None Require all granted </ Directory > |
4. Add DNS line in /etc/hosts
127.0.0.1 gabo.com
5. Create index file
touch /wwww/domain/index.html add HTML code:
1 2 3 4 5 | < http > < body > < h1 >Hello!</ h1 > </ body > </ http > |
6. Open domain gabo.com in browser.
No comments:
Post a Comment