Set Up Your First Website with Apache VirtualHosts

Опубликовано: 03 Апрель 2017
на канале: tutoriaLinux
72,596
615

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: https://www.udemy.com/course/hands-on...

Free Linux Sysadmin Course Playlist:    • The Linux Basics Course: Beginner to ...  

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

Patreon:   / tutorialinux  
Official Site & e-mail list: https://tutorialinux.com/
Twitter:   / tutorialinux  
Facebook:   / tutorialinux  
Podcast: http://kernelpanicpodcast.com


Смотрите видео Set Up Your First Website with Apache VirtualHosts онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь tutoriaLinux 03 Апрель 2017, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 72,596 раз и оно понравилось 615 людям.