Hello guys, I'm new to infrastructure and I just installed aapanel for a client. Currently we're under development, using a temporary domain. I have a project with the following structure:
- domain.com = site / React
- admin.domain.com = administrative / React
- back.domain.com = backend / Node
Everything is working correctly. But now I need a "site" to serve just images for my apps. So I set a new site statics.domain.com. The problem is that when I access that, I see the files from admin.domain.com, not from the one which I set up.
I don't know what caused that, but I just followed the same steps that I did with the other ones. Even if I turn admin.domain.com off, statics.domain.com points to this folder...
I suspect something is wrong with admin configuration. Here's what I have. Maybe the rewrite is causing this?
`<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot "/www/wwwroot/admin_imob"
ServerName
ServerAlias
#errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/-error_log"
CustomLog "/www/wwwlogs/-access_log" combined
#DENY FILES
<Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
#PHP
<FilesMatch \.php$>
SetHandler "proxy:unix:/tmp/php-cgi-74.sock|fcgi://localhost"
</FilesMatch>
#PATH
<Directory "/www/wwwroot/admin_imob">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@example.com
DocumentRoot "/www/wwwroot/admin_imob/"
ServerName SSL.
ServerAlias admin.
#errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/-error_log"
CustomLog "/www/wwwlogs/-access_log" combined
#SSL
SSLEngine On
...
SSLHonorCipherOrder On
#PHP
<FilesMatch \.php$>
SetHandler "proxy:unix:/tmp/php-cgi-74.sock|fcgi://localhost"
</FilesMatch>
#DENY FILES
<Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
#PATH
<Directory "/www/wwwroot/admin_imob/">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php index.html index.htm default.php default.html default.htm
</Directory>
</VirtualHost>`
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
This rewrite is because react works with a single index on the root, so if I try to access any page directly other than the root, it doesn't find it