Your project 1 will be a real website with its own Git repository, Apache configuration, and domain name. This guide walks you through getting it all set up and served out via Apache.
Follow these steps to set turn the project 1 folder on your local machine into a Git repository.
Your changes are now recorded in your local Git repository.
Follow these steps to create a centralized version of your repository.
Follow these steps to pull the centralized version of your repository down onto your droplet.
We’re not ready to view it in the browser yet. First we need a domain name.
It’s considered bad form to share your web site via its IP address. Instead, we give it a more mnemonic domain name. Follow these steps to get a free domain name that you will use to identify your Digital Ocean droplet.
You’re ready now to start serving our your project. This new site will be served out on port 80, just like your blog. The ServerName
directive will funnel all HTTP requests starting with the subdomain project1
to this site.
cd ~/YOUR-REPOSITORY-NAME pwdObserve the path that is printed. You will be entering it in the next step.
/etc/apache2/sites-available/project1.conf
using your favorite command-line text editor and sudo
. Fill it with this content, replacing YOUR-DOMAIN-NAME
, YOUR-USERNAME
, and YOUR-REPOSITORY-NAME
with their actual values: <VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName project1.YOUR-DOMAIN-NAME
DocumentRoot /home/YOUR-USERNAME/YOUR-REPOSITORY-NAME
# Allow access to all files.
<Directory /home/YOUR-USERNAME/YOUR-REPOSITORY-NAME>
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite project1 sudo service apache2 restart
http://project1.YOUR-DOMAIN-NAME
in a web browser. You should see your index.html
.Now that you have a domain name, you are able to encrypt HTTP requests to and from your server with the help of an SSL certificate from Let’s Encrypt. Add a certificate by following these steps:
Comments