Set Up Your First Website with Apache VirtualHosts @tutoriaLinux
Set Up Your First Website with Apache VirtualHosts  @tutoriaLinux
Uploaded April 2017 | Updated September 2026, 2 weeks ago
A quick guide on setting up your first websites with Linux + Apache. I'll walk you through two methods:

1. Ultra Simple
# Simple website in the existing /var/www/html directory
Just add files to /var/www/html

2. Apache virtualhosts (more professional, easier to manage, allows for multitenancy)

# Comment out everything in the 'welcome' config file
vim /etc/httpd/conf.d/welcome.conf

# Create directories
mkdir -p /var/www/test.tutorialinux.com/public_html

# Copy website files to the newly created directory above

# Put your virtualhost definition in the main apache config file (fine for a few sites, painful for true multitenancy)
vim /etc/httpd/conf/httpd.conf

# If you don't have DNS pointing to the domain listed in your ServerName, edit /etc/hosts on the machine you want to VISIT the site from:
vim /etc/hosts

# The site won't be live for other people on the web, but you'll be able to see it.

In this video, I'm using Centos (RedHat) Linux, although you can use whichever Linux distribution you like.





## More Tech Courses ##
###################
Step-by-step project-based Linux course for beginners: udemy.com/course/hands-on-linux-self-hosted-wordpress-for-linux-beginners/?referralCode=19C0A7DEE2FD53C9C09D

Free Linux Sysadmin Course Playlist: youtube.com/playlist?list=PLtK75qxsQaMLZSo7KL-PmiRarU7hrpnwK

DigitalOcean referral link: https://m.do.co/c/0380a1db56a6

Patreon: patreon.com/tutorialinux
Official Site & e-mail list: tutorialinux.com
Twitter: twitter.com/tutorialinux
Facebook: facebook.com/tutorialinux
Podcast: kernelpanicpodcast.com
Set Up Your First Website with Apache VirtualHostsThe ONE Book that Every Linux Sysadmin Should HaveRealities of the Tech Industry: an interview (now with 20% more spice)A Benchmarking Story: Go, Elixir, and a 3500x speedupHow to get respect from your tech-career peersProject Tour: Hashistack (Terraform, Consul, Nomad on AWS)Service Management with systemd (Hands-On Linux Course Preview)Tech Salary Negotiation: What You Need to KnowPython 3 Programming Course: 7 - ListsWhat My First Tech Job Taught MeGetting a Tech Job in 2024Setting Up Putty SSH Client On Windows (With Key-Based Login)
tutoriaLinux |

Set Up Your First Website with Apache VirtualHosts

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER