By Ve Be
Hello,
I would need your support, but for this is better to describe a bit my configuration:
My problem is the following: one of the name virtual hosts (nvh1.com) is working correctly and points out to its directory /var/www/nvh1/html/ but when I am accessing the other (nvh2.com) than mainsite.com is loaded. nvh1.com.conf is configured similar to nvh2.com.conf! What is strange for me is that I’ve tested different configurations and I get the same behavior in following scenario:
Here are also my configuration files: 000-default.conf
ServerAdmin webmaster@mainsite.com
DocumentRoot /var/www/droplet_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>```
**mainsite.com.conf (this was the old 000-default.conf)**
```<VirtualHost *:80>
ServerName mainsite.com
ServerAdmin webmaster@mainsite.com
ServerAlias www.mainsite.com mainsite.org www.mainsite.org
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLProtocol all –SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2: RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /path/to/ssl/ssl.crt
SSLCertificateKeyFile /path/to/ssl/key/myown.key
SSLCertificateChainFile /path/to/ssl/sub.class1.server.ca.pem
ServerName mainsite.com
ServerAdmin webmaster@mainsite.com
ServerAlias www.mainsite.com mainsite.org www.mainsite.org
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>```
**nvh1.com.conf**
```<VirtualHost *:80>
ServerName nvh1.com
ServerAdmin webmaster@nvh1.com
ServerAlias www.nvh1.com
DocumentRoot /var/www/nvh1.com/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>```
**nvh2.com.conf**
```<VirtualHost *:80>
ServerName nvh2.com
ServerAdmin webmaster@nvh2.com
ServerAlias www.nvh2.com
DocumentRoot /var/www/nvh2.com/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>```
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!
selfsolved (see comments): issue was from wordpress which in the last version has a special multisite feature. Since both mainsite.com and nvh2.com had both wordpress and wordpress was not properly configured for multisites nvh2.com was pointing to mainsite.com, eventhough it was a different copy of the wordpres source files. Actual status: wordpress is deleted from nvh2.com folder and a simple index.html shows that apache is solving correctly all virtual base name servers. @sierracircle: thanks for the knowhow, I’ve adopted some of your config lines!
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.