By chsoneal
I followed the tutorial for setting up virtual hosts on apache with Ubuntu 18.04. One of my sites is running and findable using it’s domain name (I own both domains). The other is only findable if I type in the server IP. Any suggestions on where to look for errors in my config?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @chsoneal,
Can you confirm you’ve created separate Vhost files for your websites? If you haven’t please make sure you have like so
Create the Vhost for your domain in Directory - /etc/apache2/sites-available/example.com.conf where example.com.conf is your domain name. The file should contain the following
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/example.com/public_html
<Directory /var/www/example.com/public_html>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined
</VirtualHost>
Please note, you’ll need to replace example.com with your domain name. Once you have created your website, type in the following
sudo a2ensite example.com
And then create your symlink
udo ln -s /etc/apache2/sites-available/example.com.conf /etc/apache2/sites-enabled/
Restart your Apache and you are ready to go!
Regards, KDSYs
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.