Apache web server: How to install and configure a website
Apache web server: How to install and configure a website
For the full step-by-step article, head to https://www.techrepublic.com/article/how-to-use-the-apache-web-server-to-install-and-configure-a-website/
List of Commands:
sudo apt-get install apache2 -y
sudo apt-get install lamp-server^
sudo systemctl enable apache2
sudo mv /var/www/html/index.html /var/www/html/index.html.bak
sudo nano /var/www/html/index.html
!DOCTYPE html
html
body
h1 Hello, TechRepublic! /h1
p How are you doing? /p
/body
/html
sudo mkdir -p /var/www/html/test
sudo chown -R $USER:$USER /var/www/html/test
sudo chmod -R 755 /var/www/html/test
sudo cp /var/www/html/index.html /var/www/html/test/
sudo nano /etc/apache2/sites-available/test.conf
VirtualHost *:80
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/html/test
ErrorLog $/error.log
CustomLog $/access.log combined
/VirtualHost
sudo a2ensite test.conf
sudo systemctl reload apache2
Video Editor: https://www.techrepublic.com/meet-the-team/us/mackenzie-burke/
Watch more How To videos: https://www.youtube.com/channel/UCKyMiy1zmJ7aZ8aP6DLZLIA/
Watch more TechRepublic videos: https://www.techrepublic.com/videos/
Follow TechRepublic on Twitter: http://twitter.com/TechRepublic/
Follow TechRepublic on Facebook: http://www.facebook.com/TechRepublic/
Follow TechRepublic on Instagram: https://www.instagram.com/TechRepublic/
Follow TechRepublic on LinkedIn: https://www.linkedin.com/company/tech…
Watch Tech Stories, a series of mini documentaries from TechRepublic: https://www.youtube.com/watch?v=RRPAs…