Skip to content

Instantly share code, notes, and snippets.

@akramhossainrabbi
Last active July 20, 2025 07:48
Show Gist options
  • Select an option

  • Save akramhossainrabbi/3bc6549de4b81dad28979e1b45b7b56b to your computer and use it in GitHub Desktop.

Select an option

Save akramhossainrabbi/3bc6549de4b81dad28979e1b45b7b56b to your computer and use it in GitHub Desktop.
Configure your website or update website configuration file in Apache:

Configure your website or update website configuration file in Apache:

sudo nano /etc/apache2/sites-available/your_domain.conf
<VirtualHost *:80>
    ServerName your_domain
    ServerAlias www.your_domain 
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/your_site
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite your_domain
sudo a2dissite 000-default
sudo systemctl reload apache2
nano /var/www/your_site/index.html
<html>
  <head>
    <title>your_domain website</title>
  </head>
  <body>
    <h1>Hello World!</h1>

    <p>This is the landing page of <strong>your_domain</strong>.</p>
  </body>
</html>
http://server_domain_or_IP

Getting 404 not found?

<VirtualHost *:80>
    ...

    <Directory /var/www/your_site>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
sudo a2enmod rewrite
sudo systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment