Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Virtual Host DocumentRoot not working |
|
Author |
|
VdtsCoder
Joined: 02 May 2023 Posts: 5 Location: US
|
Posted: Wed 03 May '23 19:41 Post subject: Virtual Host DocumentRoot not working |
|
|
I've got a domain: dev.aecperformance.com and another one, api.aecperformance.com.
dev.aecperformance.com works fine.
api.aecperformance.com does not work.
The DocumentRoot for both api.aecperformance.com and dev.aecperformance.com is:
DocumentRoot "/var/www/dev.aecperformance.com"
If I create a directory /var/www/api.aecperformance.com and add a file api.php the browser will load that file. Right now I'm getting a Not Found error because I deleted the api.aecperformance.com folder with api.php in it.
The server is ignoring DocumentRoot.
How can I make apache load the files in DocumentRoot?
If I open https://api.aecperformance.com I should see the file: /var/www/dev.aecperformance.com/api.php
How can I make the server do that?
Code: |
<VirtualHost *:80>
ServerAdmin mailadm@aecperformance.com
ServerName api.aecperformance.com
DocumentRoot "/var/www/dev.aecperformance.com"
DirectoryIndex "api.php"
ErrorLog ${APACHE_LOG_DIR}/api.error.log
CustomLog ${APACHE_LOG_DIR}/api.access.log combined
</VirtualHost>
<Directory "/var/www/dev.aecperformance.com">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
|
|
|
Back to top |
|
VdtsCoder
Joined: 02 May 2023 Posts: 5 Location: US
|
Posted: Thu 04 May '23 0:23 Post subject: |
|
|
SOLVED - certbot created a different vhost file for port 443.
I was looking at the wrong conf file. |
|
Back to top |
|
|
|
|
|
|