1. Installing Apache
sudo apt updatesudo apt install apache2 -y
2. Start and enable
sudo systemctl start apache2sudo systemctl enable apache2
3. Check the status
sudo systemctl status apache24. Open the firewall (if there is one)
sudo ufw allow 'Apache Full'5. Default folder
/var/www/html6. Create a new site
sudo mkdir -p /var/www/mysitesudo chown -R $USER:$USER /var/www/mysite
7. Create an index file
nano /var/www/mysite/index.htmlVirtual Host (IMPORTANT)
sudo nano /etc/apache2/sites-available/mysite.conf
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
Code: Select all
DocumentRoot /var/www/mysite
<Directory /var/www/mysite>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combinedsudo a2ensite mysite.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
a working Apache
your own site
a ready base for WordPress / Laravel / whatever you want