By renanpaiva
Hi,
I’ve done a virtual host config on my lamp server, but it shows the IP address not de DNS name when I access my website.
<VirtualHost *:80>
ServerAdmin ****@**thy.com
ServerName **thy.com
ServerAlias prm.**thy.com
DocumentRoot /var/www/**thy.com/public_html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml
</IfModule>
</VirtualHost>
What config I’m missing?
Regards, Renan Paiva
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 @renanpaiva,
Did you by any chance, enabled the config, restarted apache and disabled the default one?
Apache includes some tools that allow us to do this.
We’ll be using the a2ensite tool to enable each of our sites. If you would like to read more about this script, you can refer to the a2ensite documentation.
sudo a2ensite example.com.conf
Next, disable the default site defined in 000-default.conf:
sudo a2dissite 000-default.conf
When you are finished, you need to restart Apache to make these changes take effect and use systemctl status to verify the success of the restart.
sudo systemctl restart apache2
sudo systemctl status apache2
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.